Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Teuchos_Dependency.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Teuchos: Common Tools Package
4 //
5 // Copyright 2004 NTESS and the Teuchos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef TEUCHOS_DEPENDENCY_HPP_
11 #define TEUCHOS_DEPENDENCY_HPP_
12 #include "Teuchos_RCP.hpp"
15 #include <set>
22 namespace Teuchos{
23 
24 
32 
33 public:
34 
37 
41  typedef std::set<RCP<ParameterEntry>, RCPComp > ParameterEntryList;
42 
46  typedef std::set<RCP<const ParameterEntry>, RCPConstComp > ConstParameterEntryList;
47 
49 
52 
59  Dependency(
60  ConstParameterEntryList dependees,
61  ParameterEntryList dependents);
62 
69  Dependency(
70  ConstParameterEntryList dependees,
71  RCP<ParameterEntry> dependent);
72 
79  Dependency(
81  ParameterEntryList dependents);
82 
89  Dependency(
91  RCP<ParameterEntry> dependent);
92 
94 
96 
97 
103  inline const ConstParameterEntryList& getDependees() const{
104  return dependees_;
105  }
106 
113  return dependents_;
114  }
115 
121  inline const ConstParameterEntryList& getDependents() const{
122  return constDependents_;
123  }
124 
125 
130  return *(dependees_.begin());
131  }
132 
139  template<class S>
140  inline S getFirstDependeeValue() const{
141  return getValue<S>(*(*(dependees_.begin())));
142  }
143 
148  virtual std::string getTypeAttributeValue() const = 0;
149 
150 
154  static const std::string& getXMLTagName(){
155  static const std::string xmlTagName = "Dependency";
156  return xmlTagName;
157  }
158 
160 
163 
168  virtual void evaluate() = 0;
169 
171 
174 
176  virtual void print(std::ostream& out) const;
177 
179 
180 protected:
181 
184 
190  virtual void validateDep() const = 0;
191 
193 
194  private:
195 
198 
203 
208 
213 
218 
222  void createConstDependents();
223 
227  void checkDependeesAndDependents();
228 
230 
231 };
232 
233 
234 } //namespace Teuchos
235 #endif //TEUCHOS_DEPENDENCY_HPP_
std::set< RCP< const ParameterEntry >, RCPConstComp > ConstParameterEntryList
A list of dependents.
ParameterEntryList & getDependents()
Gets the dependents of the dependency.
std::set< RCP< ParameterEntry >, RCPComp > ParameterEntryList
A list of Dependees.
This class represents a depndency between elements in a Parameter List.
const ConstParameterEntryList & getDependents() const
Gets the dependents of the dependency.
Struct for comparing two RCPs. Simply compares the raw pointers contained within the RCPs...
S getFirstDependeeValue() const
Convienence function. Returns the first dependee in the list of dependees.
Struct for comparing two RCPs. Simply compares the raw pointers contained within the RCPs...
Dependency()
Declaring and defining the default constructor as private.
const ConstParameterEntryList & getDependees() const
Gets the dependees of the dependency.
Templated Parameter List class.
ConstParameterEntryList dependees_
The parameters being depended upon.
ParameterEntryList dependents_
The dependent paramters.
static const std::string & getXMLTagName()
Returns the XML tag to use when serializing Dependencies.
RCP< const ParameterEntry > getFirstDependee() const
Gets the first dependee in the dependees list. This is a convience function.
#define TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT
ConstParameterEntryList constDependents_
A const version dependent paramters.
Base class for all objects that can describe themselves.
Smart reference counting pointer class for automatic garbage collection.
Reference-counted pointer class and non-member templated function implementations.