Teuchos - Trilinos Tools Package  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Teuchos_StandardDependencyXMLConverters.hpp
Go to the documentation of this file.
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Teuchos: Common Tools Package
5 // Copyright (2004) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
38 //
39 // ***********************************************************************
40 // @HEADER
41 
42 #ifndef TEUCHOS_STANDARDDEPENDENCYXMLCONVERTERS_HPP
43 #define TEUCHOS_STANDARDDEPENDENCYXMLCONVERTERS_HPP
44 
54 
55 
56 namespace Teuchos {
57 
58 
61 class TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT VisualDependencyXMLConverter : public DependencyXMLConverter{
62 
63 public:
64 
67 
78  virtual void convertSpecialVisualAttributes(
79  RCP<const VisualDependency> dependency,
80  XMLObject& xmlObj,
81  const XMLParameterListWriter::EntryIDsMap& entryIDsMap) const = 0;
82 
94  virtual RCP<VisualDependency> convertSpecialVisualAttributes(
95  const XMLObject& xmlObj,
97  const Dependency::ParameterEntryList dependets,
98  bool showIf,
99  const XMLParameterListReader::EntryIDsMap& entryIDsMap) const = 0;
100 
102 
105 
107  RCP<Dependency> convertXML(
108  const XMLObject& xmlObj,
109  const Dependency::ConstParameterEntryList dependees,
110  const Dependency::ParameterEntryList dependets,
111  const XMLParameterListReader::EntryIDsMap& entryIDsMap,
112  const IDtoValidatorMap& validatorIDsMap) const;
113 
115  void convertDependency(
116  const RCP<const Dependency> dependency,
117  XMLObject& xmlObj,
118  const XMLParameterListWriter::EntryIDsMap& entryIDsMap,
119  ValidatortoIDMap& validatorIDsMap) const;
120 
122 
123 private:
124 
127 
129  static const std::string& getShowIfAttributeName(){
130  static const std::string showIfAttributeName = "showIf";
131  return showIfAttributeName;
132  }
133 
135 
136 };
137 
140 class TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT ValidatorDependencyXMLConverter : public DependencyXMLConverter{
141 
142 public:
143 
146 
157  virtual void convertSpecialValidatorAttributes(
159  XMLObject& xmlObj,
160  ValidatortoIDMap& validatorIDsMap) const = 0;
161 
172  virtual RCP<ValidatorDependency> convertSpecialValidatorAttributes(
173  const XMLObject& xmlObj,
174  RCP<const ParameterEntry> dependee,
175  const Dependency::ParameterEntryList dependents,
176  const IDtoValidatorMap& validatorIDsMap) const = 0;
177 
179 
182 
184  RCP<Dependency> convertXML(
185  const XMLObject& xmlObj,
186  const Dependency::ConstParameterEntryList dependees,
187  const Dependency::ParameterEntryList dependets,
188  const XMLParameterListReader::EntryIDsMap& entryIDsMap,
189  const IDtoValidatorMap& validatorIDsMap) const;
190 
192  void convertDependency(
193  const RCP<const Dependency> dependency,
194  XMLObject& xmlObj,
195  const XMLParameterListWriter::EntryIDsMap& entryIDsMap,
196  ValidatortoIDMap& validatorIDsMap) const;
197 
199 
200 };
201 
220 class TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT StringVisualDependencyXMLConverter : public VisualDependencyXMLConverter{
221 
222 public:
223 
226 
228  void convertSpecialVisualAttributes(
229  RCP<const VisualDependency> dependency,
230  XMLObject& xmlObj,
231  const XMLParameterListWriter::EntryIDsMap& entryIDsMap) const;
232 
234  RCP<VisualDependency> convertSpecialVisualAttributes(
235  const XMLObject& xmlObj,
236  const Dependency::ConstParameterEntryList dependees,
237  const Dependency::ParameterEntryList dependets,
238  bool showIf,
239  const XMLParameterListReader::EntryIDsMap& entryIDsMap) const;
240 
242  static const std::string& getStringValuesTagName(){
243  static const std::string stringValuesTagName = "StringValues";
244  return stringValuesTagName;
245  }
246 
248 
249 private:
250 
253 
255  static const std::string& getStringTagName(){
256  static const std::string stringTagName = "String";
257  return stringTagName;
258  }
259 
261  static const std::string& getValueAttributeName(){
262  static const std::string valueAttributeName = "value";
263  return valueAttributeName;
264  }
265 
267 
268 };
269 
283 class TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT BoolVisualDependencyXMLConverter : public VisualDependencyXMLConverter{
284 
285 public:
286 
289 
291  void convertSpecialVisualAttributes(
292  RCP<const VisualDependency> dependency,
293  XMLObject& xmlObj,
294  const XMLParameterListWriter::EntryIDsMap& entryIDsMap) const;
295 
297  RCP<VisualDependency> convertSpecialVisualAttributes(
298  const XMLObject& xmlObj,
299  const Dependency::ConstParameterEntryList dependees,
300  const Dependency::ParameterEntryList dependets,
301  bool showIf,
302  const XMLParameterListReader::EntryIDsMap& entryIDsMap) const;
303 
305 
306 };
307 
324 template<class T>
326 
327 public:
328 
331 
334  RCP<const VisualDependency> dependency,
335  XMLObject& xmlObj,
336  const XMLParameterListWriter::EntryIDsMap& entryIDsMap) const;
337 
340  const XMLObject& xmlObj,
341  const Dependency::ConstParameterEntryList dependees,
342  const Dependency::ParameterEntryList dependets,
343  bool showIf,
344  const XMLParameterListReader::EntryIDsMap& entryIDsMap) const;
345 
347 
348 };
349 
350 template<class T>
352  RCP<const VisualDependency> dependency,
353  XMLObject& xmlObj,
354  const XMLParameterListWriter::EntryIDsMap& /* entryIDsMap */) const
355 {
356  RCP<const NumberVisualDependency<T> > castedDependency =
357  rcp_dynamic_cast<const NumberVisualDependency<T> >(dependency);
358  RCP<const SimpleFunctionObject<T> > functionObject =
359  castedDependency->getFunctionObject();
360 
361  if(functionObject != null){
362  XMLObject functionXML =
364  xmlObj.addChild(functionXML);
365  }
366 
367 }
368 
369 template<class T>
372  const XMLObject& xmlObj,
373  const Dependency::ConstParameterEntryList dependees,
374  const Dependency::ParameterEntryList dependents,
375  bool showIf,
376  const XMLParameterListReader::EntryIDsMap& /* entryIDsMap */) const
377 {
378  TEUCHOS_TEST_FOR_EXCEPTION(dependees.size() > 1,
380  "A NumberVisualDependency can only have 1 dependee!" <<
381  std::endl << std::endl);
382  int functionIndex = xmlObj.findFirstChild(FunctionObject::getXMLTagName());
383  RCP<SimpleFunctionObject<T> > functionObject = null;
384  if(functionIndex != -1){
385  functionObject = rcp_dynamic_cast<SimpleFunctionObject<T> >(
386  FunctionObjectXMLConverterDB::convertXML(xmlObj.getChild(functionIndex)));
387  }
388  return rcp(new NumberVisualDependency<T>(
389  *(dependees.begin()), dependents, showIf, functionObject));
390 
391 }
392 
409 class TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT ConditionVisualDependencyXMLConverter :
411 {
412 
413 public:
414 
417 
419  void convertSpecialVisualAttributes(
420  RCP<const VisualDependency> dependency,
421  XMLObject& xmlObj,
422  const XMLParameterListWriter::EntryIDsMap& entryIDsMap) const;
423 
425  RCP<VisualDependency> convertSpecialVisualAttributes(
426  const XMLObject& xmlObj,
427  const Dependency::ConstParameterEntryList dependees,
428  const Dependency::ParameterEntryList dependets,
429  bool showIf,
430  const XMLParameterListReader::EntryIDsMap& entryIDsMap) const;
431 
433 
434 };
435 
436 
456 class TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT StringValidatorDependencyXMLConverter :
458 
459 public:
460 
463 
465  void convertSpecialValidatorAttributes(
467  XMLObject& xmlObj,
468  ValidatortoIDMap& validatorIDsMap) const;
469 
471  RCP<ValidatorDependency> convertSpecialValidatorAttributes(
472  const XMLObject& xmlObj,
473  RCP<const ParameterEntry> dependee,
474  const Dependency::ParameterEntryList dependents,
475  const IDtoValidatorMap& validatorIDsMap) const;
476 
478  static const std::string& getValuesAndValidatorsTag(){
479  static const std::string valuesAndValidatorsTag = "ValuesAndValidators";
480  return valuesAndValidatorsTag;
481  }
482 
484 
485 private:
488 
490  static const std::string& getPairTag(){
491  static const std::string pairTag = "Pair";
492  return pairTag;
493  }
494 
496  static const std::string& getValueAttributeName(){
497  static const std::string valueAttributeName = "value";
498  return valueAttributeName;
499  }
500 
502  static const std::string& getValidatorIdAttributeName(){
503  static const std::string validatorIDAttributeName = "validatorId";
504  return validatorIDAttributeName;
505  }
506 
508  static const std::string& getDefaultValidatorIdAttributeName(){
509  static const std::string defaultValidatorIdAttributeName =
510  "defaultValidatorId";
511  return defaultValidatorIdAttributeName;
512  }
513 
515 
516 };
517 
534 class TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT BoolValidatorDependencyXMLConverter : public ValidatorDependencyXMLConverter{
535 
536 public:
537 
540 
542  void convertSpecialValidatorAttributes(
544  XMLObject& xmlObj,
545  ValidatortoIDMap& validatorIDsMap) const;
546 
548  RCP<ValidatorDependency> convertSpecialValidatorAttributes(
549  const XMLObject& xmlObj,
550  RCP<const ParameterEntry> dependee,
551  const Dependency::ParameterEntryList dependents,
552  const IDtoValidatorMap& validatorIDsMap) const;
553 
555 
556 private:
557 
560 
562  static const std::string& getFalseValidatorIdAttributeName(){
563  static const std::string falseValidatorIdAttributeName =
564  "falseValidatorId";
565  return falseValidatorIdAttributeName;
566  }
567 
569  static const std::string& getTrueValidatorIdAttributeName(){
570  static const std::string trueValidatorIdAttributeName =
571  "trueValidatorId";
572  return trueValidatorIdAttributeName;
573  }
574 
576 
577 };
578 
601 template<class T>
604 
605 public:
606 
609 
613  XMLObject& xmlObj,
614  ValidatortoIDMap& validatorIDsMap) const;
615 
618  const XMLObject& xmlObj,
619  RCP<const ParameterEntry> dependee,
620  const Dependency::ParameterEntryList dependents,
621  const IDtoValidatorMap& validatorIDsMap) const;
622 
624  static const std::string& getRangesAndValidatorsTag(){
625  static const std::string rangesAndValidatorsTag = "RangesAndValidators";
626  return rangesAndValidatorsTag;
627  }
628 
630 
631 private:
634 
635 
637  static const std::string& getPairTag(){
638  static const std::string pairTag = "Pair";
639  return pairTag;
640  }
641 
643  static const std::string& getMinAttributeName(){
644  static const std::string minAttributeName = "min";
645  return minAttributeName;
646  }
647 
649  static const std::string& getMaxAttributeName(){
650  static const std::string maxAttributeName = "max";
651  return maxAttributeName;
652  }
653 
654 
656  static const std::string& getValidatorIdAttributeName(){
657  static const std::string validatorIdAttributeName = "validatorId";
658  return validatorIdAttributeName;
659  }
660 
662  static const std::string& getDefaultValidatorIdAttributeName(){
663  static const std::string defaultValidatorIdAttributeName =
664  "defaultValidatorId";
665  return defaultValidatorIdAttributeName;
666  }
667 
669 
670 };
671 
672 template<class T>
673 void
676  XMLObject& xmlObj,
677  ValidatortoIDMap& validatorIDsMap) const
678 {
679  RCP<const RangeValidatorDependency<T> > castedDependency =
680  rcp_dynamic_cast<const RangeValidatorDependency<T> >(dependency, true);
681 
682  XMLObject rangesAndValidatorsTag(getRangesAndValidatorsTag());
683 
684  castedDependency->getRangeToValidatorMap();
685  for(
687  it = castedDependency->getRangeToValidatorMap().begin();
688  it != castedDependency->getRangeToValidatorMap().end();
689  ++it)
690  {
691  T min = it->first.first;
692  T max = it->first.second;
693  if(validatorIDsMap.find(it->second) == validatorIDsMap.end()){
694  validatorIDsMap.insert(it->second);
695  }
697  validatorIDsMap.find(it->second)->second;
698  XMLObject pairTag(getPairTag());
699  pairTag.addAttribute(getMinAttributeName(), min);
700  pairTag.addAttribute(getMaxAttributeName(), max);
701  pairTag.addAttribute(getValidatorIdAttributeName(), validatorID);
702  rangesAndValidatorsTag.addChild(pairTag);
703  }
704  xmlObj.addChild(rangesAndValidatorsTag);
705  RCP<const ParameterEntryValidator> defaultValidator =
706  castedDependency->getDefaultValidator();
707  if(nonnull(defaultValidator)){
708  if(validatorIDsMap.find(defaultValidator) == validatorIDsMap.end()){
709  validatorIDsMap.insert(defaultValidator);
710  }
711  xmlObj.addAttribute(
712  getDefaultValidatorIdAttributeName(),
713  validatorIDsMap.find(defaultValidator)->second);
714  }
715 }
716 
717 template<class T>
720  const XMLObject& xmlObj,
721  RCP<const ParameterEntry> dependee,
722  const Dependency::ParameterEntryList dependents,
723  const IDtoValidatorMap& validatorIDsMap) const
724 {
725 
726  int result = xmlObj.findFirstChild(getRangesAndValidatorsTag());
727  TEUCHOS_TEST_FOR_EXCEPTION(result == -1,
729  "Error: All RangeValidatorDependencies must have a " <<
730  getRangesAndValidatorsTag() << " tag!" << std::endl << std::endl);
731 
732  XMLObject rangesAndValidatorsTag = xmlObj.getChild(result);
733 
735  rangesAndValidators;
736  for(int i = 0 ; i < rangesAndValidatorsTag.numChildren(); ++i){
737  XMLObject child = rangesAndValidatorsTag.getChild(i);
738  T min = child.getRequired<T>(getMinAttributeName());
739  T max = child.getRequired<T>(getMaxAttributeName());
742  getValidatorIdAttributeName());
743 
745  validatorIDsMap.find(currentID) == validatorIDsMap.end(),
747  "Could not find validator in given ValidatorIDsMap! " << std::endl <<
748  std::endl);
749  RCP<ParameterEntryValidator> validator =
750  validatorIDsMap.find(currentID)->second;
751 
752  rangesAndValidators.insert(
754  typename RangeValidatorDependency<T>::Range(min, max), validator));
755  }
756 
757  RCP<ParameterEntryValidator> defaultValidator = null;
758  if(xmlObj.hasAttribute(getDefaultValidatorIdAttributeName())){
761  getDefaultValidatorIdAttributeName());
763  validatorIDsMap.find(defaultValiID) == validatorIDsMap.end(),
765  "Could not find a validator (for the default validator) " <<
766  "corresponding to the ID " << defaultValiID <<
767  " in the given validatorIDsMap!" << std::endl << std::endl);
768  defaultValidator = validatorIDsMap.find(defaultValiID)->second;
769  }
770 
771  return rcp(new RangeValidatorDependency<T>(
772  dependee, dependents, rangesAndValidators, defaultValidator));
773 }
774 
779 template<class DependeeType, class DependentType>
781 
782 public:
783 
786 
789  const XMLObject& xmlObj,
790  const Dependency::ConstParameterEntryList dependees,
791  const Dependency::ParameterEntryList dependets,
792  const XMLParameterListReader::EntryIDsMap& entryIDsMap,
793  const IDtoValidatorMap& validatorIDsMap) const;
794 
796  void convertDependency(
797  const RCP<const Dependency> dependency,
798  XMLObject& xmlObj,
799  const XMLParameterListWriter::EntryIDsMap& entryIDsMap,
800  ValidatortoIDMap& validatorIDsMap) const;
801 
803 
804 protected:
805 
825  RCP<const ParameterEntry> dependee,
827  RCP<const SimpleFunctionObject<DependeeType> > function) const = 0;
828 
829 };
830 
831 template<class DependeeType, class DependentType>
834  const XMLObject& xmlObj,
835  const Dependency::ConstParameterEntryList dependees,
836  const Dependency::ParameterEntryList dependents,
837  const XMLParameterListReader::EntryIDsMap& /* entryIDsMap */,
838  const IDtoValidatorMap& /* validatorIDsMap */) const
839 {
840  TEUCHOS_TEST_FOR_EXCEPTION(dependees.size() > 1,
842  "A ArrayModifierDependency can only have 1 dependee!" <<
843  std::endl << std::endl);
844  RCP<SimpleFunctionObject<DependeeType> > functionObject = null;
845  int functionIndex = xmlObj.findFirstChild(FunctionObject::getXMLTagName());
846  if(functionIndex != -1){
847  functionObject = rcp_dynamic_cast<SimpleFunctionObject<DependeeType> >(
848  FunctionObjectXMLConverterDB::convertXML(xmlObj.getChild(functionIndex)));
849  }
850  return
851  getConcreteDependency(*(dependees.begin()), dependents, functionObject);
852 }
853 
854 template<class DependeeType, class DependentType>
855 void
857  const RCP<const Dependency> dependency,
858  XMLObject& xmlObj,
859  const XMLParameterListWriter::EntryIDsMap& /* entryIDsMap */,
860  ValidatortoIDMap& /* validatorIDsMap */) const
861 {
864  dependency);
866  castedDep->getFunctionObject();
867  if(functionObject != null){
869  functionObject);
870  xmlObj.addChild(functionXML);
871  }
872 }
873 
874 
889 template<class DependeeType, class DependentType>
891  public ArrayModifierDependencyXMLConverter<DependeeType, DependentType>{
892 
893 protected:
894 
899  RCP<const ParameterEntry> dependee,
901  RCP<const SimpleFunctionObject<DependeeType> > function) const;
903 
904 };
905 
906 template<class DependeeType, class DependentType>
909  RCP<const ParameterEntry> dependee,
911  RCP<const SimpleFunctionObject<DependeeType> > function) const
912 {
913 return rcp(
915  dependee, dependents, function));
916 }
917 
918 
935 template<class DependeeType, class DependentType>
937  public ArrayModifierDependencyXMLConverter<DependeeType, DependentType>
938 {
939 
940 protected:
941 
946  RCP<const ParameterEntry> dependee,
948  RCP<const SimpleFunctionObject<DependeeType> > function) const;
950 
951 };
952 
953 template<class DependeeType, class DependentType>
956  RCP<const ParameterEntry> dependee,
958  RCP<const SimpleFunctionObject<DependeeType> > function) const
959 {
960 return rcp(
962  dependee, dependents, function));
963 }
964 
981 template<class DependeeType, class DependentType>
983  public ArrayModifierDependencyXMLConverter<DependeeType, DependentType>
984 {
985 
986 protected:
987 
992  RCP<const ParameterEntry> dependee,
994  RCP<const SimpleFunctionObject<DependeeType> > function) const;
996 
997 };
998 
999 template<class DependeeType, class DependentType>
1002  RCP<const ParameterEntry> dependee,
1003  Dependency::ParameterEntryList dependents,
1004  RCP<const SimpleFunctionObject<DependeeType> > function) const
1005 {
1006 return rcp(
1008  dependee, dependents, function));
1009 }
1010 
1011 
1012 
1013 } // namespace Teuchos
1014 
1015 
1016 #endif // TEUCHOS_STANDARDDEPENDENCYXMLCONVERTERS_HPP
const_iterator find(int id) const
Retrieves and iterator to a validator and id based on the id given.
A dependency in which the number of rows in a parameter with a TwoDArray depends on the value of anot...
Maps Validators to integers.
std::set< RCP< const ParameterEntry >, RCPConstComp > ConstParameterEntryList
A list of dependents.
static XMLObject convertFunctionObject(RCP< const FunctionObject > function)
Given a FunctionObject, converts the FunctionObject to XML.
A dependency in which the number of rows in a parameter with a TwoDArray depends on the value of anot...
std::set< RCP< ParameterEntry >, RCPComp > ParameterEntryList
A list of Dependees.
bool nonnull(const std::shared_ptr< T > &p)
Returns true if p.get()!=NULL.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
A class for converting TwoDRowDependencies to and from XML.
void addChild(const XMLObject &child)
Add a child node to the node.
void convertSpecialVisualAttributes(RCP< const VisualDependency > dependency, XMLObject &xmlObj, const XMLParameterListWriter::EntryIDsMap &entryIDsMap) const
void convertSpecialValidatorAttributes(RCP< const ValidatorDependency > dependency, XMLObject &xmlObj, ValidatortoIDMap &validatorIDsMap) const
virtual RCP< ArrayModifierDependency< DependeeType, DependentType > > getConcreteDependency(RCP< const ParameterEntry > dependee, Dependency::ParameterEntryList dependents, RCP< const SimpleFunctionObject< DependeeType > > function) const
Obtains a concrete ArrayModifierDependency given a dependee, dependtns, and a funciton object...
A RangeValidatorDependency says the following about the relationship between two parameters: Dependen...
A database for FunctionObjectXMLConverters.
static const std::string & getStringValuesTagName()
Gets the StringValues Tag.
virtual RCP< ArrayModifierDependency< DependeeType, DependentType > > getConcreteDependency(RCP< const ParameterEntry > dependee, Dependency::ParameterEntryList dependents, RCP< const SimpleFunctionObject< DependeeType > > function) const
Obtains a concrete ArrayModifierDependency given a dependee, dependtns, and a funciton object...
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Deprecated.
An abstract base class for converting Dependencies to and from XML.
Representation of an XML data tree. XMLObject is a ref-counted handle to a XMLObjectImplem object...
A converter used to convert ArrayModifierDepdencies to and from xml.
A collection of Exceptions thrown when converting Dependencys to and from XML.
std::map< RCP< const ParameterEntry >, ParameterEntry::ParameterEntryID, RCPConstComp > EntryIDsMap
const_iterator end() const
Returns a const_reference to the end of the map.
Thrown when the rangesAndValidators tag for the RangeValidatorDepencyConverter can&#39;t be found...
A NumberArrayLengthDependency says the following about the relationship between two parameters: The l...
static const std::string & getXMLTagName()
Returns the name of the XML tag used to indicate a funciton object.
virtual RCP< ArrayModifierDependency< DependeeType, DependentType > > getConcreteDependency(RCP< const ParameterEntry > dependee, Dependency::ParameterEntryList dependents, RCP< const SimpleFunctionObject< DependeeType > > function) const
Obtains a concrete ArrayModifierDependency given a dependee, dependtns, and a funciton object...
A class for mapping validators to integers.
void insert(RCP< const ParameterEntryValidator > toInsert)
inserts an IDValidatorPair into the map.
void addAttribute(const std::string &name, T value)
Lookup whether or not Doubles are allowed.
A class for converting TwoDColDependencies to and from XML.
const_iterator end() const
Returns a const_reference to the end of the map.
A collection of standard dependencies.
void convertDependency(const RCP< const Dependency > dependency, XMLObject &xmlObj, const XMLParameterListWriter::EntryIDsMap &entryIDsMap, ValidatortoIDMap &validatorIDsMap) const
Converts back and forth between XML and Dependencies.
An xml converter for StringValidatorDependencies.
An xml converter for ConditionVisualDependencies.
const_iterator find(const RCP< const ParameterEntryValidator > validator) const
Returns an iterator to the validator and id specified by the validator.
RCP< Dependency > convertXML(const XMLObject &xmlObj, const Dependency::ConstParameterEntryList dependees, const Dependency::ParameterEntryList dependets, const XMLParameterListReader::EntryIDsMap &entryIDsMap, const IDtoValidatorMap &validatorIDsMap) const
std::map< ParameterEntry::ParameterEntryID, RCP< ParameterEntry > > EntryIDsMap
Convenience typedef.
Thrown when a Dependency has too many dependees specified in its XML.
int numChildren() const
Return the number of child nodes owned by this node.
An abstract base class for all dependencies which modify the dimensional attributes of an Array param...
Smart reference counting pointer class for automatic garbage collection.
int findFirstChild(std::string tagName) const
Returns the index of the first child found with the given tag name. Returns -1 if no child is found...
static RCP< FunctionObject > convertXML(const XMLObject &xmlObject)
Given an XMLObject, converts the XMLObject to a FunctionObject.
std::pair< Range, RCP< const ParameterEntryValidator > > RangeValidatorPair
Convenience typedef.
const XMLObject & getChild(int i) const
Return the i-th child node.
bool hasAttribute(const std::string &name) const
Find out if the current node has an attribute of the specified name.
Thrown when converting a dependency that has validaotrs to and from XML. This excetpion indicates tha...
std::pair< T, T > Range
Convenience typedef.
An xml converter for NumberArrayLengthDependencies.
virtual RCP< ArrayModifierDependency< DependeeType, DependentType > > getConcreteDependency(RCP< const ParameterEntry > dependee, Dependency::ParameterEntryList dependents, RCP< const SimpleFunctionObject< DependeeType > > function) const =0
Obtains a concrete ArrayModifierDependency given a dependee, dependtns, and a funciton object...
A number visual dependency says the following about the relationship between two elements in a Parame...
const std::string & getRequired(const std::string &name) const
Get an attribute, throwing an std::exception if it is not found.
std::map< Range, RCP< const ParameterEntryValidator > > RangeToValidatorMap
Convenience typedef.