diff options
Diffstat (limited to 'TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Graph.hpp')
-rw-r--r-- | TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Graph.hpp | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Graph.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Graph.hpp new file mode 100644 index 00000000000..18a29fb3c2f --- /dev/null +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Graph.hpp @@ -0,0 +1,79 @@ +// file : CCF/IDL2/SemanticGraph/Graph.hpp +// author : Boris Kolpackov <boris@dre.vanderbilt.edu> +// cvs-id : $Id$ + +#ifndef ELEMENT_GRAPH_HPP +#define ELEMENT_GRAPH_HPP + +#include <map> +#include <set> +#include <vector> +#include <string> +#include <memory> + +#include <iostream> + +namespace CCF +{ + namespace IDL2 + { + namespace SemanticGraph + { + template <typename N, typename E> + class Graph + { + public: + ~Graph (); + + public: + template <typename T> + T& + new_node (); + + template <typename T, typename A0> + T& + new_node (A0 const& a0); + + template <typename T, typename A0, typename A1> + T& + new_node (A0 const& a0, A1 const& a1); + + void + delete_node (N const& n); + + public: + template <typename T, typename X, typename Y> + T& + new_edge (X& left, Y& right); + + template <typename T, typename X, typename Y, + typename A0> + T& + new_edge (X& left, Y& right, A0 const& a0); + + template <typename T, typename X, typename Y, + typename A0, + typename A1> + T& + new_edge (X& left, Y& right, A0 const& a0, A1 const& a1); + + void + delete_edge (E const& e); + + protected: + typedef N* NodePtr; + typedef E* EdgePtr; + + typedef std::set<NodePtr> Nodes_; + typedef std::set<EdgePtr> Edges_; + + Nodes_ nodes_; + Edges_ edges_; + }; + } + } +} + +#include "Graph.tpp" + +#endif // ELEMENT_GRAPH_HPP |