10 #include "Teuchos_Dependency.hpp"
16 Dependency::Dependency(
19 dependees_(dependees), dependents_(dependents)
21 checkDependeesAndDependents();
22 createConstDependents();
25 Dependency::Dependency(
28 dependees_(dependees),
31 checkDependeesAndDependents();
32 createConstDependents();
36 Dependency::Dependency(
40 dependents_(dependents)
42 checkDependeesAndDependents();
43 createConstDependents();
46 Dependency::Dependency(
52 checkDependeesAndDependents();
53 createConstDependents();
57 void Dependency::createConstDependents(){
59 ParameterEntryList::iterator it = dependents_.begin();
60 it != dependents_.end();
63 constDependents_.insert(it->getConst());
69 out <<
"Number of dependees: " << dependees_.size() << std::endl;
70 out <<
"Number of dependents: " << dependents_.size() << std::endl;
74 void Dependency::checkDependeesAndDependents(){
75 ConstParameterEntryList::iterator it1 = dependees_.begin();
76 for(; it1 != dependees_.end(); ++it1){
79 "Cannot have a null dependee!" << std::endl << std::endl);
82 ParameterEntryList::iterator it2 = dependents_.begin();
83 for(; it2 != dependents_.end(); ++it2){
85 InvalidDependencyException,
86 "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...
Smart reference counting pointer class for automatic garbage collection.