|
Teuchos Package Browser (Single Doxygen Collection)
Version of the Day
|
00001 // @HEADER 00002 // *********************************************************************** 00003 // 00004 // Teuchos: Common Tools Package 00005 // Copyright (2004) Sandia Corporation 00006 // 00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive 00008 // license for use of this work by or on behalf of the U.S. Government. 00009 // 00010 // Redistribution and use in source and binary forms, with or without 00011 // modification, are permitted provided that the following conditions are 00012 // met: 00013 // 00014 // 1. Redistributions of source code must retain the above copyright 00015 // notice, this list of conditions and the following disclaimer. 00016 // 00017 // 2. Redistributions in binary form must reproduce the above copyright 00018 // notice, this list of conditions and the following disclaimer in the 00019 // documentation and/or other materials provided with the distribution. 00020 // 00021 // 3. Neither the name of the Corporation nor the names of the 00022 // contributors may be used to endorse or promote products derived from 00023 // this software without specific prior written permission. 00024 // 00025 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY 00026 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00027 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00028 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE 00029 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00033 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00036 // 00037 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 00038 // 00039 // *********************************************************************** 00040 // @HEADER 00041 00042 #ifndef TEUCHOS_STANDARDDEPENDENCYXMLCONVERTERS_HPP 00043 #define TEUCHOS_STANDARDDEPENDENCYXMLCONVERTERS_HPP 00044 00050 #include "Teuchos_DependencyXMLConverter.hpp" 00051 #include "Teuchos_StandardDependencies.hpp" 00052 #include "Teuchos_XMLDependencyExceptions.hpp" 00053 #include "Teuchos_FunctionObjectXMLConverterDB.hpp" 00054 00055 00056 namespace Teuchos { 00057 00058 00061 class TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT VisualDependencyXMLConverter : public DependencyXMLConverter{ 00062 00063 public: 00064 00067 00078 virtual void convertSpecialVisualAttributes( 00079 RCP<const VisualDependency> dependency, 00080 XMLObject& xmlObj, 00081 const XMLParameterListWriter::EntryIDsMap& entryIDsMap) const = 0; 00082 00094 virtual RCP<VisualDependency> convertSpecialVisualAttributes( 00095 const XMLObject& xmlObj, 00096 const Dependency::ConstParameterEntryList dependees, 00097 const Dependency::ParameterEntryList dependets, 00098 bool showIf, 00099 const XMLParameterListReader::EntryIDsMap& entryIDsMap) const = 0; 00100 00102 00105 00107 RCP<Dependency> convertXML( 00108 const XMLObject& xmlObj, 00109 const Dependency::ConstParameterEntryList dependees, 00110 const Dependency::ParameterEntryList dependets, 00111 const XMLParameterListReader::EntryIDsMap& entryIDsMap, 00112 const IDtoValidatorMap& validatorIDsMap) const; 00113 00115 void convertDependency( 00116 const RCP<const Dependency> dependency, 00117 XMLObject& xmlObj, 00118 const XMLParameterListWriter::EntryIDsMap& entryIDsMap, 00119 ValidatortoIDMap& validatorIDsMap) const; 00120 00122 00123 private: 00124 00127 00129 static const std::string& getShowIfAttributeName(){ 00130 static const std::string showIfAttributeName = "showIf"; 00131 return showIfAttributeName; 00132 } 00133 00135 00136 }; 00137 00140 class TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT ValidatorDependencyXMLConverter : public DependencyXMLConverter{ 00141 00142 public: 00143 00146 00157 virtual void convertSpecialValidatorAttributes( 00158 RCP<const ValidatorDependency> dependency, 00159 XMLObject& xmlObj, 00160 ValidatortoIDMap& validatorIDsMap) const = 0; 00161 00172 virtual RCP<ValidatorDependency> convertSpecialValidatorAttributes( 00173 const XMLObject& xmlObj, 00174 RCP<const ParameterEntry> dependee, 00175 const Dependency::ParameterEntryList dependents, 00176 const IDtoValidatorMap& validatorIDsMap) const = 0; 00177 00179 00182 00184 RCP<Dependency> convertXML( 00185 const XMLObject& xmlObj, 00186 const Dependency::ConstParameterEntryList dependees, 00187 const Dependency::ParameterEntryList dependets, 00188 const XMLParameterListReader::EntryIDsMap& entryIDsMap, 00189 const IDtoValidatorMap& validatorIDsMap) const; 00190 00192 void convertDependency( 00193 const RCP<const Dependency> dependency, 00194 XMLObject& xmlObj, 00195 const XMLParameterListWriter::EntryIDsMap& entryIDsMap, 00196 ValidatortoIDMap& validatorIDsMap) const; 00197 00199 00200 }; 00201 00220 class TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT StringVisualDependencyXMLConverter : public VisualDependencyXMLConverter{ 00221 00222 public: 00223 00226 00228 void convertSpecialVisualAttributes( 00229 RCP<const VisualDependency> dependency, 00230 XMLObject& xmlObj, 00231 const XMLParameterListWriter::EntryIDsMap& entryIDsMap) const; 00232 00234 RCP<VisualDependency> convertSpecialVisualAttributes( 00235 const XMLObject& xmlObj, 00236 const Dependency::ConstParameterEntryList dependees, 00237 const Dependency::ParameterEntryList dependets, 00238 bool showIf, 00239 const XMLParameterListReader::EntryIDsMap& entryIDsMap) const; 00240 00242 static const std::string& getStringValuesTagName(){ 00243 static const std::string stringValuesTagName = "StringValues"; 00244 return stringValuesTagName; 00245 } 00246 00248 00249 private: 00250 00253 00255 static const std::string& getStringTagName(){ 00256 static const std::string stringTagName = "String"; 00257 return stringTagName; 00258 } 00259 00261 static const std::string& getValueAttributeName(){ 00262 static const std::string valueAttributeName = "value"; 00263 return valueAttributeName; 00264 } 00265 00267 00268 }; 00269 00283 class TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT BoolVisualDependencyXMLConverter : public VisualDependencyXMLConverter{ 00284 00285 public: 00286 00289 00291 void convertSpecialVisualAttributes( 00292 RCP<const VisualDependency> dependency, 00293 XMLObject& xmlObj, 00294 const XMLParameterListWriter::EntryIDsMap& entryIDsMap) const; 00295 00297 RCP<VisualDependency> convertSpecialVisualAttributes( 00298 const XMLObject& xmlObj, 00299 const Dependency::ConstParameterEntryList dependees, 00300 const Dependency::ParameterEntryList dependets, 00301 bool showIf, 00302 const XMLParameterListReader::EntryIDsMap& entryIDsMap) const; 00303 00305 00306 }; 00307 00324 template<class T> 00325 class NumberVisualDependencyXMLConverter : public VisualDependencyXMLConverter{ 00326 00327 public: 00328 00331 00333 void convertSpecialVisualAttributes( 00334 RCP<const VisualDependency> dependency, 00335 XMLObject& xmlObj, 00336 const XMLParameterListWriter::EntryIDsMap& entryIDsMap) const; 00337 00339 RCP<VisualDependency> convertSpecialVisualAttributes( 00340 const XMLObject& xmlObj, 00341 const Dependency::ConstParameterEntryList dependees, 00342 const Dependency::ParameterEntryList dependets, 00343 bool showIf, 00344 const XMLParameterListReader::EntryIDsMap& entryIDsMap) const; 00345 00347 00348 }; 00349 00350 template<class T> 00351 void NumberVisualDependencyXMLConverter<T>::convertSpecialVisualAttributes( 00352 RCP<const VisualDependency> dependency, 00353 XMLObject& xmlObj, 00354 const XMLParameterListWriter::EntryIDsMap& entryIDsMap) const 00355 { 00356 RCP<const NumberVisualDependency<T> > castedDependency = 00357 rcp_dynamic_cast<const NumberVisualDependency<T> >(dependency); 00358 RCP<const SimpleFunctionObject<T> > functionObject = 00359 castedDependency->getFunctionObject(); 00360 00361 if(functionObject != null){ 00362 XMLObject functionXML = 00363 FunctionObjectXMLConverterDB::convertFunctionObject(functionObject); 00364 xmlObj.addChild(functionXML); 00365 } 00366 00367 } 00368 00369 template<class T> 00370 RCP<VisualDependency> 00371 NumberVisualDependencyXMLConverter<T>::convertSpecialVisualAttributes( 00372 const XMLObject& xmlObj, 00373 const Dependency::ConstParameterEntryList dependees, 00374 const Dependency::ParameterEntryList dependents, 00375 bool showIf, 00376 const XMLParameterListReader::EntryIDsMap& entryIDsMap) const 00377 { 00378 TEUCHOS_TEST_FOR_EXCEPTION(dependees.size() > 1, 00379 TooManyDependeesException, 00380 "A NumberVisualDependency can only have 1 dependee!" << 00381 std::endl << std::endl); 00382 int functionIndex = xmlObj.findFirstChild(FunctionObject::getXMLTagName()); 00383 RCP<SimpleFunctionObject<T> > functionObject = null; 00384 if(functionIndex != -1){ 00385 functionObject = rcp_dynamic_cast<SimpleFunctionObject<T> >( 00386 FunctionObjectXMLConverterDB::convertXML(xmlObj.getChild(functionIndex))); 00387 } 00388 return rcp(new NumberVisualDependency<T>( 00389 *(dependees.begin()), dependents, showIf, functionObject)); 00390 00391 } 00392 00409 class TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT ConditionVisualDependencyXMLConverter : 00410 public VisualDependencyXMLConverter 00411 { 00412 00413 public: 00414 00417 00419 void convertSpecialVisualAttributes( 00420 RCP<const VisualDependency> dependency, 00421 XMLObject& xmlObj, 00422 const XMLParameterListWriter::EntryIDsMap& entryIDsMap) const; 00423 00425 RCP<VisualDependency> convertSpecialVisualAttributes( 00426 const XMLObject& xmlObj, 00427 const Dependency::ConstParameterEntryList dependees, 00428 const Dependency::ParameterEntryList dependets, 00429 bool showIf, 00430 const XMLParameterListReader::EntryIDsMap& entryIDsMap) const; 00431 00433 00434 }; 00435 00436 00456 class TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT StringValidatorDependencyXMLConverter : 00457 public ValidatorDependencyXMLConverter{ 00458 00459 public: 00460 00463 00465 void convertSpecialValidatorAttributes( 00466 RCP<const ValidatorDependency> dependency, 00467 XMLObject& xmlObj, 00468 ValidatortoIDMap& validatorIDsMap) const; 00469 00471 RCP<ValidatorDependency> convertSpecialValidatorAttributes( 00472 const XMLObject& xmlObj, 00473 RCP<const ParameterEntry> dependee, 00474 const Dependency::ParameterEntryList dependents, 00475 const IDtoValidatorMap& validatorIDsMap) const; 00476 00478 static const std::string& getValuesAndValidatorsTag(){ 00479 static const std::string valuesAndValidatorsTag = "ValuesAndValidators"; 00480 return valuesAndValidatorsTag; 00481 } 00482 00484 00485 private: 00488 00490 static const std::string& getPairTag(){ 00491 static const std::string pairTag = "Pair"; 00492 return pairTag; 00493 } 00494 00496 static const std::string& getValueAttributeName(){ 00497 static const std::string valueAttributeName = "value"; 00498 return valueAttributeName; 00499 } 00500 00502 static const std::string& getValidatorIdAttributeName(){ 00503 static const std::string validatorIDAttributeName = "validatorId"; 00504 return validatorIDAttributeName; 00505 } 00506 00508 static const std::string& getDefaultValidatorIdAttributeName(){ 00509 static const std::string defaultValidatorIdAttributeName = 00510 "defaultValidatorId"; 00511 return defaultValidatorIdAttributeName; 00512 } 00513 00515 00516 }; 00517 00534 class TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT BoolValidatorDependencyXMLConverter : public ValidatorDependencyXMLConverter{ 00535 00536 public: 00537 00540 00542 void convertSpecialValidatorAttributes( 00543 RCP<const ValidatorDependency> dependency, 00544 XMLObject& xmlObj, 00545 ValidatortoIDMap& validatorIDsMap) const; 00546 00548 RCP<ValidatorDependency> convertSpecialValidatorAttributes( 00549 const XMLObject& xmlObj, 00550 RCP<const ParameterEntry> dependee, 00551 const Dependency::ParameterEntryList dependents, 00552 const IDtoValidatorMap& validatorIDsMap) const; 00553 00555 00556 private: 00557 00560 00562 static const std::string& getFalseValidatorIdAttributeName(){ 00563 static const std::string falseValidatorIdAttributeName = 00564 "falseValidatorId"; 00565 return falseValidatorIdAttributeName; 00566 } 00567 00569 static const std::string& getTrueValidatorIdAttributeName(){ 00570 static const std::string trueValidatorIdAttributeName = 00571 "trueValidatorId"; 00572 return trueValidatorIdAttributeName; 00573 } 00574 00576 00577 }; 00578 00601 template<class T> 00602 class RangeValidatorDependencyXMLConverter : 00603 public ValidatorDependencyXMLConverter{ 00604 00605 public: 00606 00609 00611 void convertSpecialValidatorAttributes( 00612 RCP<const ValidatorDependency> dependency, 00613 XMLObject& xmlObj, 00614 ValidatortoIDMap& validatorIDsMap) const; 00615 00617 RCP<ValidatorDependency> convertSpecialValidatorAttributes( 00618 const XMLObject& xmlObj, 00619 RCP<const ParameterEntry> dependee, 00620 const Dependency::ParameterEntryList dependents, 00621 const IDtoValidatorMap& validatorIDsMap) const; 00622 00624 static const std::string& getRangesAndValidatorsTag(){ 00625 static const std::string rangesAndValidatorsTag = "RangesAndValidators"; 00626 return rangesAndValidatorsTag; 00627 } 00628 00630 00631 private: 00634 00635 00637 static const std::string& getPairTag(){ 00638 static const std::string pairTag = "Pair"; 00639 return pairTag; 00640 } 00641 00643 static const std::string& getMinAttributeName(){ 00644 static const std::string minAttributeName = "min"; 00645 return minAttributeName; 00646 } 00647 00649 static const std::string& getMaxAttributeName(){ 00650 static const std::string maxAttributeName = "max"; 00651 return maxAttributeName; 00652 } 00653 00654 00656 static const std::string& getValidatorIdAttributeName(){ 00657 static const std::string validatorIdAttributeName = "validatorId"; 00658 return validatorIdAttributeName; 00659 } 00660 00662 static const std::string& getDefaultValidatorIdAttributeName(){ 00663 static const std::string defaultValidatorIdAttributeName = 00664 "defaultValidatorId"; 00665 return defaultValidatorIdAttributeName; 00666 } 00667 00669 00670 }; 00671 00672 template<class T> 00673 void 00674 RangeValidatorDependencyXMLConverter<T>::convertSpecialValidatorAttributes( 00675 RCP<const ValidatorDependency> dependency, 00676 XMLObject& xmlObj, 00677 ValidatortoIDMap& validatorIDsMap) const 00678 { 00679 RCP<const RangeValidatorDependency<T> > castedDependency = 00680 rcp_dynamic_cast<const RangeValidatorDependency<T> >(dependency, true); 00681 00682 XMLObject rangesAndValidatorsTag(getRangesAndValidatorsTag()); 00683 00684 castedDependency->getRangeToValidatorMap(); 00685 for( 00686 typename RangeValidatorDependency<T>::RangeToValidatorMap::const_iterator 00687 it = castedDependency->getRangeToValidatorMap().begin(); 00688 it != castedDependency->getRangeToValidatorMap().end(); 00689 ++it) 00690 { 00691 T min = it->first.first; 00692 T max = it->first.second; 00693 if(validatorIDsMap.find(it->second) == validatorIDsMap.end()){ 00694 validatorIDsMap.insert(it->second); 00695 } 00696 ParameterEntryValidator::ValidatorID validatorID = 00697 validatorIDsMap.find(it->second)->second; 00698 XMLObject pairTag(getPairTag()); 00699 pairTag.addAttribute(getMinAttributeName(), min); 00700 pairTag.addAttribute(getMaxAttributeName(), max); 00701 pairTag.addAttribute(getValidatorIdAttributeName(), validatorID); 00702 rangesAndValidatorsTag.addChild(pairTag); 00703 } 00704 xmlObj.addChild(rangesAndValidatorsTag); 00705 RCP<const ParameterEntryValidator> defaultValidator = 00706 castedDependency->getDefaultValidator(); 00707 if(nonnull(defaultValidator)){ 00708 if(validatorIDsMap.find(defaultValidator) == validatorIDsMap.end()){ 00709 validatorIDsMap.insert(defaultValidator); 00710 } 00711 xmlObj.addAttribute( 00712 getDefaultValidatorIdAttributeName(), 00713 validatorIDsMap.find(defaultValidator)->second); 00714 } 00715 } 00716 00717 template<class T> 00718 RCP<ValidatorDependency> 00719 RangeValidatorDependencyXMLConverter<T>::convertSpecialValidatorAttributes( 00720 const XMLObject& xmlObj, 00721 RCP<const ParameterEntry> dependee, 00722 const Dependency::ParameterEntryList dependents, 00723 const IDtoValidatorMap& validatorIDsMap) const 00724 { 00725 00726 int result = xmlObj.findFirstChild(getRangesAndValidatorsTag()); 00727 TEUCHOS_TEST_FOR_EXCEPTION(result == -1, 00728 MissingRangesAndValidatorsTagException, 00729 "Error: All RangeValidatorDependencies must have a " << 00730 getRangesAndValidatorsTag() << " tag!" << std::endl << std::endl); 00731 00732 XMLObject rangesAndValidatorsTag = xmlObj.getChild(result); 00733 00734 typename RangeValidatorDependency<T>::RangeToValidatorMap 00735 rangesAndValidators; 00736 for(int i = 0 ; i < rangesAndValidatorsTag.numChildren(); ++i){ 00737 XMLObject child = rangesAndValidatorsTag.getChild(i); 00738 T min = child.getRequired<T>(getMinAttributeName()); 00739 T max = child.getRequired<T>(getMaxAttributeName()); 00740 ParameterEntryValidator::ValidatorID currentID = 00741 child.getRequired<ParameterEntryValidator::ValidatorID>( 00742 getValidatorIdAttributeName()); 00743 00744 TEUCHOS_TEST_FOR_EXCEPTION( 00745 validatorIDsMap.find(currentID) == validatorIDsMap.end(), 00746 MissingValidatorException, 00747 "Could not find validator in given ValidatorIDsMap! " << std::endl << 00748 std::endl); 00749 RCP<ParameterEntryValidator> validator = 00750 validatorIDsMap.find(currentID)->second; 00751 00752 rangesAndValidators.insert( 00753 typename RangeValidatorDependency<T>::RangeValidatorPair( 00754 typename RangeValidatorDependency<T>::Range(min, max), validator)); 00755 } 00756 00757 RCP<ParameterEntryValidator> defaultValidator = null; 00758 if(xmlObj.hasAttribute(getDefaultValidatorIdAttributeName())){ 00759 ParameterEntryValidator::ValidatorID defaultValiID = 00760 xmlObj.getRequired<ParameterEntryValidator::ValidatorID>( 00761 getDefaultValidatorIdAttributeName()); 00762 TEUCHOS_TEST_FOR_EXCEPTION( 00763 validatorIDsMap.find(defaultValiID) == validatorIDsMap.end(), 00764 MissingValidatorException, 00765 "Could not find a validator (for the default validator) " << 00766 "corresponding to the ID " << defaultValiID << 00767 " in the given validatorIDsMap!" << std::endl << std::endl); 00768 defaultValidator = validatorIDsMap.find(defaultValiID)->second; 00769 } 00770 00771 return rcp(new RangeValidatorDependency<T>( 00772 dependee, dependents, rangesAndValidators, defaultValidator)); 00773 } 00774 00779 template<class DependeeType, class DependentType> 00780 class ArrayModifierDependencyXMLConverter : public DependencyXMLConverter{ 00781 00782 public: 00783 00786 00788 RCP<Dependency> convertXML( 00789 const XMLObject& xmlObj, 00790 const Dependency::ConstParameterEntryList dependees, 00791 const Dependency::ParameterEntryList dependets, 00792 const XMLParameterListReader::EntryIDsMap& entryIDsMap, 00793 const IDtoValidatorMap& validatorIDsMap) const; 00794 00796 void convertDependency( 00797 const RCP<const Dependency> dependency, 00798 XMLObject& xmlObj, 00799 const XMLParameterListWriter::EntryIDsMap& entryIDsMap, 00800 ValidatortoIDMap& validatorIDsMap) const; 00801 00803 00804 protected: 00805 00823 virtual RCP<ArrayModifierDependency<DependeeType, DependentType> > 00824 getConcreteDependency( 00825 RCP<const ParameterEntry> dependee, 00826 Dependency::ParameterEntryList dependents, 00827 RCP<const SimpleFunctionObject<DependeeType> > function) const = 0; 00828 00829 }; 00830 00831 template<class DependeeType, class DependentType> 00832 RCP<Dependency> 00833 ArrayModifierDependencyXMLConverter<DependeeType, DependentType>::convertXML( 00834 const XMLObject& xmlObj, 00835 const Dependency::ConstParameterEntryList dependees, 00836 const Dependency::ParameterEntryList dependents, 00837 const XMLParameterListReader::EntryIDsMap& entryIDsMap, 00838 const IDtoValidatorMap& validatorIDsMap) const 00839 { 00840 TEUCHOS_TEST_FOR_EXCEPTION(dependees.size() > 1, 00841 TooManyDependeesException, 00842 "A ArrayModifierDependency can only have 1 dependee!" << 00843 std::endl << std::endl); 00844 RCP<SimpleFunctionObject<DependeeType> > functionObject = null; 00845 int functionIndex = xmlObj.findFirstChild(FunctionObject::getXMLTagName()); 00846 if(functionIndex != -1){ 00847 functionObject = rcp_dynamic_cast<SimpleFunctionObject<DependeeType> >( 00848 FunctionObjectXMLConverterDB::convertXML(xmlObj.getChild(functionIndex))); 00849 } 00850 return 00851 getConcreteDependency(*(dependees.begin()), dependents, functionObject); 00852 } 00853 00854 template<class DependeeType, class DependentType> 00855 void 00856 ArrayModifierDependencyXMLConverter<DependeeType, DependentType>::convertDependency( 00857 const RCP<const Dependency> dependency, 00858 XMLObject& xmlObj, 00859 const XMLParameterListWriter::EntryIDsMap& entryIDsMap, 00860 ValidatortoIDMap& validatorIDsMap) const 00861 { 00862 RCP<const ArrayModifierDependency<DependeeType, DependentType> > castedDep = 00863 rcp_dynamic_cast<const ArrayModifierDependency<DependeeType, DependentType> >( 00864 dependency); 00865 RCP<const SimpleFunctionObject<DependeeType> > functionObject = 00866 castedDep->getFunctionObject(); 00867 if(functionObject != null){ 00868 XMLObject functionXML = FunctionObjectXMLConverterDB::convertFunctionObject( 00869 functionObject); 00870 xmlObj.addChild(functionXML); 00871 } 00872 } 00873 00874 00889 template<class DependeeType, class DependentType> 00890 class NumberArrayLengthDependencyXMLConverter : 00891 public ArrayModifierDependencyXMLConverter<DependeeType, DependentType>{ 00892 00893 protected: 00894 00897 virtual RCP<ArrayModifierDependency<DependeeType, DependentType> > 00898 getConcreteDependency( 00899 RCP<const ParameterEntry> dependee, 00900 Dependency::ParameterEntryList dependents, 00901 RCP<const SimpleFunctionObject<DependeeType> > function) const; 00903 00904 }; 00905 00906 template<class DependeeType, class DependentType> 00907 RCP<ArrayModifierDependency<DependeeType, DependentType> > 00908 NumberArrayLengthDependencyXMLConverter<DependeeType, DependentType>::getConcreteDependency( 00909 RCP<const ParameterEntry> dependee, 00910 Dependency::ParameterEntryList dependents, 00911 RCP<const SimpleFunctionObject<DependeeType> > function) const 00912 { 00913 return rcp( 00914 new NumberArrayLengthDependency<DependeeType, DependentType>( 00915 dependee, dependents, function)); 00916 } 00917 00918 00935 template<class DependeeType, class DependentType> 00936 class TwoDRowDependencyXMLConverter : 00937 public ArrayModifierDependencyXMLConverter<DependeeType, DependentType> 00938 { 00939 00940 protected: 00941 00944 virtual RCP<ArrayModifierDependency<DependeeType, DependentType> > 00945 getConcreteDependency( 00946 RCP<const ParameterEntry> dependee, 00947 Dependency::ParameterEntryList dependents, 00948 RCP<const SimpleFunctionObject<DependeeType> > function) const; 00950 00951 }; 00952 00953 template<class DependeeType, class DependentType> 00954 RCP<ArrayModifierDependency<DependeeType, DependentType> > 00955 TwoDRowDependencyXMLConverter<DependeeType, DependentType>::getConcreteDependency( 00956 RCP<const ParameterEntry> dependee, 00957 Dependency::ParameterEntryList dependents, 00958 RCP<const SimpleFunctionObject<DependeeType> > function) const 00959 { 00960 return rcp( 00961 new TwoDRowDependency<DependeeType, DependentType>( 00962 dependee, dependents, function)); 00963 } 00964 00981 template<class DependeeType, class DependentType> 00982 class TwoDColDependencyXMLConverter : 00983 public ArrayModifierDependencyXMLConverter<DependeeType, DependentType> 00984 { 00985 00986 protected: 00987 00990 virtual RCP<ArrayModifierDependency<DependeeType, DependentType> > 00991 getConcreteDependency( 00992 RCP<const ParameterEntry> dependee, 00993 Dependency::ParameterEntryList dependents, 00994 RCP<const SimpleFunctionObject<DependeeType> > function) const; 00996 00997 }; 00998 00999 template<class DependeeType, class DependentType> 01000 RCP<ArrayModifierDependency<DependeeType, DependentType> > 01001 TwoDColDependencyXMLConverter<DependeeType, DependentType>::getConcreteDependency( 01002 RCP<const ParameterEntry> dependee, 01003 Dependency::ParameterEntryList dependents, 01004 RCP<const SimpleFunctionObject<DependeeType> > function) const 01005 { 01006 return rcp( 01007 new TwoDColDependency<DependeeType, DependentType>( 01008 dependee, dependents, function)); 01009 } 01010 01011 01012 01013 } // namespace Teuchos 01014 01015 01016 #endif // TEUCHOS_STANDARDDEPENDENCYXMLCONVERTERS_HPP
1.7.6.1