From bada6666c70977a058755ccf232e7d67b24adeed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 23 Jul 2014 15:21:29 +0200 Subject: New upstream release --- libcult/cult/containers/graph.hxx | 193 -------------------------------------- 1 file changed, 193 deletions(-) delete mode 100644 libcult/cult/containers/graph.hxx (limited to 'libcult/cult/containers/graph.hxx') diff --git a/libcult/cult/containers/graph.hxx b/libcult/cult/containers/graph.hxx deleted file mode 100644 index d61cd53..0000000 --- a/libcult/cult/containers/graph.hxx +++ /dev/null @@ -1,193 +0,0 @@ -// file : cult/containers/graph.hxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2005-2010 Boris Kolpackov -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef CULT_CONTAINERS_GRAPH_HXX -#define CULT_CONTAINERS_GRAPH_HXX - -#include -#include -#include - -namespace Cult -{ - namespace Containers - { - template - class Graph - { - public: - typedef N Node; - typedef E Edge; - - struct NoEdge: virtual EH::Exception {}; - struct NoNode: virtual EH::Exception {}; - - public: - template - T& - new_node (); - - template - T& - new_node (A0 const&); - - template - T& - new_node (A0 const&, A1 const&); - - template - T& - new_node (A0 const&, A1 const&, A2 const&); - - template - T& - new_node (A0 const&, A1 const&, A2 const&, A3 const&); - - template - T& - new_node (A0 const&, A1 const&, A2 const&, A3 const&, A4 const&); - - template - T& - new_node (A0 const&, A1 const&, A2 const&, A3 const&, A4 const&, - A5 const&); - - template - T& - new_node (A0 const&, A1 const&, A2 const&, A3 const&, A4 const&, - A5 const&, A6 const&); - - template - T& - new_node (A0 const&, A1 const&, A2 const&, A3 const&, A4 const&, - A5 const&, A6 const&, A7 const&); - - template - T& - new_node (A0 const&, A1 const&, A2 const&, A3 const&, A4 const&, - A5 const&, A6 const&, A7 const&, A8 const&); - - template - T& - new_node (A0 const&, A1 const&, A2 const&, A3 const&, A4 const&, - A5 const&, A6 const&, A7 const&, A8 const&, A9 const&); - - public: - template - T& - new_edge (Left&, Right&); - - template - T& - new_edge (Left&, Right&, A0 const&); - - template - T& - new_edge (Left&, Right&, A0 const&, A1 const&); - - template - T& - new_edge (Left&, Right&, A0 const&, A1 const&, A2 const&); - - template - T& - new_edge (Left&, Right&, A0 const&, A1 const&, A2 const&, A3 const&); - - template - T& - new_edge (Left&, Right&, A0 const&, A1 const&, A2 const&, A3 const&, - A4 const&); - - template - T& - new_edge (Left&, Right&, A0 const&, A1 const&, A2 const&, A3 const&, - A4 const&, A5 const&); - - // Functions to reset edge's nodes. - // - public: - template - Void - reset_left_node (TE& edge, TN& node) - { - edge.set_left_node (node); - } - - template - Void - reset_right_node (TE& edge, TN& node) - { - edge.set_right_node (node); - } - - // Functions to add edges to a node. - // - public: - template - Void - add_edge_left (TN& node, TE& edge) - { - node.add_edge_left (edge); - } - - template - Void - add_edge_right (TN& node, TE& edge) - { - node.add_edge_right (edge); - } - - // Functions to delete edges and nodes. In order to delete a - // a node without leaving any dangling edges you need to make - // sure that each edge pointing to it is either deleted or reset - // to some other node. - // - public: - template - Void - delete_edge (Left& left_node, Right& right_node, T& edge); - - Void - delete_node (Node& node) - { - if (nodes_.erase (&node) == 0) - throw NoNode (); - } - - protected: - typedef Shptr NodePtr; - typedef Shptr EdgePtr; - - typedef Map Nodes; - typedef Map Edges; - - Nodes nodes_; - Edges edges_; - }; - } -} - - -#include - -#endif // CULT_CONTAINERS_GRAPH_HXX -- cgit v1.2.3