Removing graph_defines.h
authordeba
Mon, 07 Feb 2005 10:50:05 +0000
changeset 1135cfccb33ecf7b
parent 1134 56b07afdbf8d
child 1136 8d066154b66a
Removing graph_defines.h
src/lemon/graph_wrapper.h
src/lemon/map_defines.h
     1.1 --- a/src/lemon/graph_wrapper.h	Mon Feb 07 10:49:44 2005 +0000
     1.2 +++ b/src/lemon/graph_wrapper.h	Mon Feb 07 10:50:05 2005 +0000
     1.3 @@ -28,7 +28,6 @@
     1.4  #include <lemon/invalid.h>
     1.5  #include <lemon/maps.h>
     1.6  #include <lemon/iterable_graph_extender.h>
     1.7 -#include <lemon/map_defines.h>
     1.8  #include <iostream>
     1.9  
    1.10  namespace lemon {
     2.1 --- a/src/lemon/map_defines.h	Mon Feb 07 10:49:44 2005 +0000
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,227 +0,0 @@
     2.4 -/* -*- C++ -*-
     2.5 - * src/lemon/map_defines.h - Part of LEMON, a generic C++ optimization library
     2.6 - *
     2.7 - * Copyright (C) 2004 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     2.8 - * (Egervary Combinatorial Optimization Research Group, EGRES).
     2.9 - *
    2.10 - * Permission to use, modify and distribute this software is granted
    2.11 - * provided that this copyright notice appears in all copies. For
    2.12 - * precise terms see the accompanying LICENSE file.
    2.13 - *
    2.14 - * This software is provided "AS IS" with no warranty of any kind,
    2.15 - * express or implied, and with no claim as to its suitability for any
    2.16 - * purpose.
    2.17 - *
    2.18 - */
    2.19 -
    2.20 -#ifndef LEMON_MAP_DEFINES_H
    2.21 -#define LEMON_MAP_DEFINES_H
    2.22 -
    2.23 -///\ingroup graphmaps
    2.24 -///\file
    2.25 -///\brief Defines to help creating graph maps.
    2.26 -
    2.27 -/// \addtogroup graphmapfactory
    2.28 -/// @{
    2.29 -
    2.30 -/** Creates the EdgeMapRegistry type an declare a mutable instance 
    2.31 - *  named edge_maps.
    2.32 - */
    2.33 -#define CREATE_EDGE_MAP_REGISTRY \
    2.34 -typedef MapRegistry<Graph, Edge, EdgeIt> EdgeMapRegistry; \
    2.35 -mutable EdgeMapRegistry edge_maps;
    2.36 -
    2.37 -/** Creates the NodeMapRegistry type an declare a mutable instance 
    2.38 - *  named node_maps.
    2.39 - */
    2.40 -#define CREATE_NODE_MAP_REGISTRY \
    2.41 -typedef MapRegistry<Graph, Node, NodeIt> NodeMapRegistry; \
    2.42 -mutable NodeMapRegistry node_maps;
    2.43 -
    2.44 -/** Creates both map registries.
    2.45 - */
    2.46 -#define CREATE_MAP_REGISTRIES \
    2.47 -CREATE_NODE_MAP_REGISTRY \
    2.48 -CREATE_EDGE_MAP_REGISTRY
    2.49 -
    2.50 -/** Creates a map from a template map. The import method is
    2.51 - *  an overloading of the map type.
    2.52 - *  The reason to use these macro is that the c++ does not support
    2.53 - *  the template typedefs. If a future release of the c++ 
    2.54 - *  supports this feature it should be fixed.
    2.55 - */
    2.56 -#define CREATE_NODE_MAP(DynMap) \
    2.57 -template <typename _Value> \
    2.58 -class NodeMap : public DynMap<NodeMapRegistry, _Value> { \
    2.59 -public: \
    2.60 -typedef DynMap<NodeMapRegistry, _Value> Parent; \
    2.61 -NodeMap(const typename Parent::Graph& g) \
    2.62 -  : Parent(g, g.node_maps) {} \
    2.63 -NodeMap(const typename Parent::Graph& g, const _Value& v) \
    2.64 -  : Parent(g, g.node_maps, v) {} \
    2.65 -NodeMap(const NodeMap& copy) : Parent(static_cast<const Parent&>(copy)) {} \
    2.66 -template <typename TT> \
    2.67 -NodeMap(const NodeMap<TT>& copy) \
    2.68 -  : Parent(static_cast<const typename NodeMap<TT>::Parent&>(copy)) {} \
    2.69 -NodeMap& operator=(const NodeMap& copy) { \
    2.70 -  Parent::operator=(static_cast<const Parent&>(copy));\
    2.71 -  return *this; \
    2.72 -} \
    2.73 -template <typename TT> \
    2.74 -NodeMap& operator=(const NodeMap<TT>& copy) { \
    2.75 -  Parent::operator=(static_cast<const typename NodeMap<TT>::Parent&>(copy));\
    2.76 -  return *this; \
    2.77 -} \
    2.78 -};
    2.79 -
    2.80 -/** Creates a map from a template map. The import method is
    2.81 - *  an overloading of the map type.
    2.82 - *  The reason to use these macro is that the c++ does not support
    2.83 - *  the template typedefs. If a future release of the c++ 
    2.84 - *  supports this feature it should be fixed.
    2.85 - */
    2.86 -#define CREATE_EDGE_MAP(DynMap) \
    2.87 -template <typename _Value> \
    2.88 -class EdgeMap : public DynMap<EdgeMapRegistry, _Value> { \
    2.89 -public: \
    2.90 -typedef DynMap<EdgeMapRegistry, _Value> Parent; \
    2.91 -\
    2.92 -EdgeMap(const typename Parent::Graph& g) \
    2.93 -  : Parent(g, g.edge_maps) {} \
    2.94 -EdgeMap(const typename Parent::Graph& g, const _Value& v) \
    2.95 -  : Parent(g, g.edge_maps, v) {} \
    2.96 -EdgeMap(const EdgeMap& copy) : Parent(static_cast<const Parent&>(copy)) {} \
    2.97 -template <typename TT> \
    2.98 -EdgeMap(const EdgeMap<TT>& copy) \
    2.99 -  : Parent(static_cast<const typename EdgeMap<TT>::Parent&>(copy)) {} \
   2.100 -EdgeMap& operator=(const EdgeMap& copy) { \
   2.101 -  Parent::operator=(static_cast<const Parent&>(copy));\
   2.102 -  return *this; \
   2.103 -} \
   2.104 -template <typename TT> \
   2.105 -EdgeMap& operator=(const EdgeMap<TT>& copy) { \
   2.106 -  Parent::operator=(static_cast<const typename EdgeMap<TT>::Parent&>(copy));\
   2.107 -  return *this; \
   2.108 -} \
   2.109 -};
   2.110 -
   2.111 -/** This macro creates both maps.
   2.112 - */
   2.113 -#define CREATE_MAPS(DynMap) \
   2.114 -CREATE_NODE_MAP(DynMap) \
   2.115 -CREATE_EDGE_MAP(DynMap)
   2.116 -
   2.117 -/** This macro creates MapRegistry for Symmetric Edge Maps.
   2.118 - */
   2.119 -#define CREATE_SYM_EDGE_MAP_REGISTRY \
   2.120 -typedef MapRegistry<Graph, SymEdge, SymEdgeIt> SymEdgeMapRegistry; \
   2.121 -mutable SymEdgeMapRegistry sym_edge_maps;
   2.122 -
   2.123 -
   2.124 -/** Creates a map from a template map. The import method is
   2.125 - *  an overloading of the map type.
   2.126 - *  The reason to use these macro is that the c++ does not support
   2.127 - *  the template typedefs. If a future release of the c++ 
   2.128 - *  supports this feature it should be fixed.
   2.129 - */
   2.130 -#define CREATE_SYM_EDGE_MAP(DynMap) \
   2.131 -template <typename _Value> \
   2.132 -class SymEdgeMap : public DynMap<SymEdgeMapRegistry, _Value> { \
   2.133 -public: \
   2.134 -typedef DynMap<SymEdgeMapRegistry, _Value> Parent; \
   2.135 -\
   2.136 -SymEdgeMap(const typename Parent::Graph& g) \
   2.137 -  : Parent(g, g.sym_edge_maps) {} \
   2.138 -SymEdgeMap(const typename Parent::Graph& g, const _Value& v) \
   2.139 -  : Parent(g, g.sym_edge_maps, v) {} \
   2.140 -SymEdgeMap(const SymEdgeMap& copy) \
   2.141 -  : Parent(static_cast<const Parent&>(copy)) {} \
   2.142 -template <typename TT> \
   2.143 -SymEdgeMap(const NodeMap<TT>& copy) \
   2.144 -  : Parent(static_cast<const typename SymEdgeMap<TT>::Parent&>(copy)) {} \
   2.145 -SymEdgeMap& operator=(const SymEdgeMap& copy) { \
   2.146 -  Parent::operator=(static_cast<const Parent&>(copy));\
   2.147 -  return *this; \
   2.148 -} \
   2.149 -template <typename TT> \
   2.150 -SymEdgeMap& operator=(const SymEdgeMap<TT>& copy) { \
   2.151 -  Parent::operator=(static_cast<const typename SymEdgeMap<TT>::Parent&>(copy));\
   2.152 -  return *this; \
   2.153 -} \
   2.154 -};
   2.155 -
   2.156 -/** This is a macro to import an node map into a graph class.
   2.157 - */
   2.158 -#define IMPORT_NODE_MAP(From, from, To, to) \
   2.159 -template <typename _Value> \
   2.160 -class NodeMap : public From::template NodeMap<_Value> { \
   2.161 -\
   2.162 -public: \
   2.163 -typedef typename From::template NodeMap<_Value> Parent; \
   2.164 -\
   2.165 -NodeMap(const To& to) \
   2.166 -  : Parent(static_cast<const From&>(from)) { } \
   2.167 -NodeMap(const To& to, const _Value& value) \
   2.168 -  : Parent(static_cast<const From&>(from), value) { } \
   2.169 -NodeMap(const NodeMap& copy) \
   2.170 -  : Parent(static_cast<const Parent&>(copy)) {} \
   2.171 -template <typename TT> \
   2.172 -NodeMap(const NodeMap<TT>& copy) \
   2.173 -  : Parent(static_cast<const typename NodeMap<TT>::Parent&>(copy)) {} \
   2.174 -NodeMap& operator=(const NodeMap& copy) { \
   2.175 -  Parent::operator=(static_cast<const Parent&>(copy)); \
   2.176 -  return *this; \
   2.177 -} \
   2.178 -template <typename TT> \
   2.179 -NodeMap& operator=(const NodeMap<TT>& copy) { \
   2.180 -  Parent::operator=(static_cast<const typename NodeMap<TT>::Parent&>(copy));\
   2.181 -  return *this; \
   2.182 -} \
   2.183 -};
   2.184 -
   2.185 -/** This is a macro to import an edge map into a graph class.
   2.186 - */
   2.187 -#define IMPORT_EDGE_MAP(From, from, To, to) \
   2.188 -template <typename _Value> \
   2.189 -class EdgeMap : public From::template EdgeMap<_Value> { \
   2.190 -\
   2.191 -public: \
   2.192 -typedef typename From::template EdgeMap<_Value> Parent; \
   2.193 -\
   2.194 -EdgeMap(const To& to) \
   2.195 -  : Parent(static_cast<const From&>(from)) { } \
   2.196 -EdgeMap(const To& to, const _Value& value) \
   2.197 -  : Parent(static_cast<const From&>(from), value) { } \
   2.198 -EdgeMap(const EdgeMap& copy) \
   2.199 -  : Parent(static_cast<const Parent&>(copy)) {} \
   2.200 -template <typename TT> \
   2.201 -EdgeMap(const EdgeMap<TT>& copy) \
   2.202 -  : Parent(static_cast<const typename EdgeMap<TT>::Parent&>(copy)) {} \
   2.203 -EdgeMap& operator=(const EdgeMap& copy) { \
   2.204 -  Parent::operator=(static_cast<const Parent&>(copy)); \
   2.205 -  return *this; \
   2.206 -} \
   2.207 -template <typename TT> \
   2.208 -EdgeMap& operator=(const EdgeMap<TT>& copy) { \
   2.209 -  Parent::operator=(static_cast<const typename EdgeMap<TT>::Parent&>(copy));\
   2.210 -  return *this; \
   2.211 -} \
   2.212 -};
   2.213 -
   2.214 -#define KEEP_EDGE_MAP(From, To) \
   2.215 -IMPORT_EDGE_MAP(From, graph, To, graph)
   2.216 -
   2.217 -
   2.218 -#define KEEP_NODE_MAP(From, To) \
   2.219 -IMPORT_NODE_MAP(From, graph, To, graph)
   2.220 -
   2.221 -/** This is a macro to keep the node and edge maps for a graph class.
   2.222 - */
   2.223 -#define KEEP_MAPS(From, To) \
   2.224 -KEEP_EDGE_MAP(From, To) \
   2.225 -KEEP_NODE_MAP(From, To)
   2.226 -
   2.227 -  
   2.228 -/// @}
   2.229 -  
   2.230 -#endif