42 #include "Teuchos_Dependency.hpp" 48 Dependency::Dependency(
51 dependees_(dependees), dependents_(dependents)
53 checkDependeesAndDependents();
54 createConstDependents();
57 Dependency::Dependency(
60 dependees_(dependees),
63 checkDependeesAndDependents();
64 createConstDependents();
68 Dependency::Dependency(
72 dependents_(dependents)
74 checkDependeesAndDependents();
75 createConstDependents();
78 Dependency::Dependency(
84 checkDependeesAndDependents();
85 createConstDependents();
89 void Dependency::createConstDependents(){
91 ParameterEntryList::iterator it = dependents_.begin();
92 it != dependents_.end();
95 constDependents_.insert(it->getConst());
101 out <<
"Number of dependees: " << dependees_.size() << std::endl;
102 out <<
"Number of dependents: " << dependents_.size() << std::endl;
106 void Dependency::checkDependeesAndDependents(){
107 ConstParameterEntryList::iterator it1 = dependees_.begin();
108 for(; it1 != dependees_.end(); ++it1){
111 "Cannot have a null dependee!" << std::endl << std::endl);
114 ParameterEntryList::iterator it2 = dependents_.begin();
115 for(; it2 != dependents_.end(); ++it2){
118 "Cannot have a null dependent!" << std::endl << std::endl);
std::set< RCP< const ParameterEntry >, RCPConstComp > ConstParameterEntryList
A list of dependents.
std::set< RCP< ParameterEntry >, RCPComp > ParameterEntryList
A list of Dependees.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
virtual void print(std::ostream &out) const
prints out information about the dependency.
virtual std::string getTypeAttributeValue() const =0
Returns the string to be used for the value of the type attribute when converting the dependency to X...
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos, as well as a number of utility routines.
Smart reference counting pointer class for automatic garbage collection.