COPASI API  4.16.103
CMathDependencyGraph.h
Go to the documentation of this file.
1 // Copyright (C) 2011 - 2013 by Pedro Mendes, Virginia Tech Intellectual
2 // Properties, Inc., University of Heidelberg, and The University
3 // of Manchester.
4 // All rights reserved.
5 
6 #ifndef COPASI_CMathDependencyGraph
7 #define COPASI_CMathDependencyGraph
8 
9 #include <map>
10 #include <set>
11 #include <vector>
12 
14 #include "copasi/math/CMathEnum.h"
15 
17 
19 {
20 public:
21  typedef std::map< const CObjectInterface *, CMathDependencyNode * > NodeMap;
22  typedef NodeMap::iterator iterator;
23  typedef NodeMap::const_iterator const_iterator;
24 
25  // Operations
26  /**
27  * Constructor
28  */
30 
31  /**
32  * Destructor
33  */
35 
36  /**
37  * Clear the whole dependency tree
38  */
39  void clear();
40 
41  /**
42  * Add an object and all its prerequisites to the tree
43  * @param const CObjectInterface * pObject
44  * @return std::map< const CObjectInterface *, CMathDependencyNode * >::iterator itObject
45  */
46  iterator addObject(const CObjectInterface * pObject);
47 
48  /**
49  * Construct a update sequence for the given context
50  * @param const CMath::SimulationContextFlag & context
51  * @param const CObjectInterface::ObjectSet & changedObjects
52  * @param const CObjectInterface::ObjectSet & requestedObjects
53  * @param CObjectInterface::UpdateSequence & updateSequence)
54  * @return bool success
55  */
57  const CObjectInterface::ObjectSet & changedObjects,
58  const CObjectInterface::ObjectSet & requestedObjects,
59  CObjectInterface::UpdateSequence & updateSequence);
60 
61  void exportDOTFormat(std::ostream & os, const std::string & name) const;
62 
63 private:
64  std::string getDOTNodeId(const CObjectInterface * pObject) const;
65 
66  // Attributes
68 
69  mutable std::map< const CObjectInterface *, size_t > mObject2Index;
70 };
71 
72 #endif // COPASI_CMathDependencyGraph
NodeMap::iterator iterator
std::map< const CObjectInterface *, CMathDependencyNode * > NodeMap
NodeMap::const_iterator const_iterator
bool getUpdateSequence(const CMath::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects, const CObjectInterface::ObjectSet &requestedObjects, CObjectInterface::UpdateSequence &updateSequence)
void exportDOTFormat(std::ostream &os, const std::string &name) const
std::set< const CObjectInterface * > ObjectSet
iterator addObject(const CObjectInterface *pObject)
std::string getDOTNodeId(const CObjectInterface *pObject) const
std::vector< CObjectInterface * > UpdateSequence
std::map< const CObjectInterface *, size_t > mObject2Index