COPASI API  4.16.103
Public Member Functions | Private Attributes | Friends | List of all members
CDependencyGraphNode Class Reference

#include <CDependencyGraph.h>

Collaboration diagram for CDependencyGraphNode:
Collaboration graph
[legend]

Public Member Functions

void addDependent (const size_t &node_num)
 
 CDependencyGraphNode ()
 
const std::set< size_t > & getDependents () const
 
 ~CDependencyGraphNode ()
 

Private Attributes

std::set< size_t > mDependents
 

Friends

std::ostream & operator<< (std::ostream &os, const CDependencyGraphNode &d)
 

Detailed Description

CDependencyGraphNode describes a node in the dependency graph.

Definition at line 28 of file CDependencyGraph.h.

Constructor & Destructor Documentation

CDependencyGraphNode::CDependencyGraphNode ( )

Constructor

Definition at line 29 of file CDependencyGraph.cpp.

29  :
30  mDependents()
31 {}
std::set< size_t > mDependents
CDependencyGraphNode::~CDependencyGraphNode ( )

The destructor

Definition at line 33 of file CDependencyGraph.cpp.

34 {}

Member Function Documentation

void CDependencyGraphNode::addDependent ( const size_t &  node_num)

Add a dependent to the given node, represented by its node number. This then represents an edge in the graph.

Parameters
constsize_t $ node_num The dependency, the node to which the edge connects.

Definition at line 36 of file CDependencyGraph.cpp.

References mDependents.

37 {
38  // Ensure that the same node is not added twice
39  // if (find(mDependents.begin(), mDependents.end(), node_num) == mDependents.end())
40  // {
41  // mDependents.push_back(node_num);
42  //}
43  mDependents.insert(node_num);
44 }
std::set< size_t > mDependents
const std::set< size_t > & CDependencyGraphNode::getDependents ( ) const

Return a vector of the dependents.

Returns
const std::set <size_t> & A vector of the dependents.

Definition at line 46 of file CDependencyGraph.cpp.

References mDependents.

47 {
48  return mDependents;
49 }
std::set< size_t > mDependents

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const CDependencyGraphNode d 
)
friend

insert operator

Definition at line 89 of file CDependencyGraph.cpp.

91 {
92  std::set <size_t>::const_iterator it;
93 
94  for (it = d.mDependents.begin(); it != d.mDependents.end(); it++)
95  os << *it << " ";
96 
97  os << std::endl;
98 
99  return os;
100 }
std::set< size_t > mDependents

Member Data Documentation

std::set<size_t> CDependencyGraphNode::mDependents
private

A vector containing the edges for this node. An edge is specified by the remote node to which it connects.

Definition at line 67 of file CDependencyGraph.h.

Referenced by addDependent(), getDependents(), and operator<<().


The documentation for this class was generated from the following files: