1.1 --- a/src/work/deba/map_defines.h Sun Apr 17 18:57:22 2005 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,102 +0,0 @@
1.4 -// -*- c++ -*-
1.5 -#ifndef MAP_DEFINES_H
1.6 -#define MAP_DEFINES_H
1.7 -
1.8 -/** Creates the EdgeMapRegistry type an declare a mutable instance
1.9 - * named edge_maps.
1.10 - */
1.11 -#define CREATE_EDGE_MAP_REGISTRY \
1.12 -typedef MapRegistry<Graph, Edge, EdgeIt> EdgeMapRegistry; \
1.13 -mutable EdgeMapRegistry edge_maps;
1.14 -
1.15 -/** Creates the NodeMapRegistry type an declare a mutable instance
1.16 - * named node_maps.
1.17 - */
1.18 -#define CREATE_NODE_MAP_REGISTRY \
1.19 -typedef MapRegistry<Graph, Node, NodeIt> NodeMapRegistry; \
1.20 -mutable NodeMapRegistry node_maps;
1.21 -
1.22 -/** Creates both map registries.
1.23 - */
1.24 -#define CREATE_MAP_REGISTRIES \
1.25 -CREATE_NODE_MAP_REGISTRY \
1.26 -CREATE_EDGE_MAP_REGISTRY
1.27 -
1.28 -/** Creates a map a concrete factory type from a template map
1.29 - * factory to use as node map factory.
1.30 - */
1.31 -#define CREATE_NODE_MAP_FACTORY(TemplateFactory) \
1.32 -typedef TemplateFactory<NodeMapRegistry> NodeMapFactory;
1.33 -
1.34 -/** Creates a map a concrete factory type from a template map
1.35 - * factory to use as edge map factory.
1.36 - */
1.37 -#define CREATE_EDGE_MAP_FACTORY(TemplateFactory) \
1.38 -typedef TemplateFactory<EdgeMapRegistry> EdgeMapFactory;
1.39 -
1.40 -/** Creates both map factories.
1.41 - */
1.42 -#define CREATE_MAP_FACTORIES(TemplateFactory) \
1.43 -CREATE_NODE_MAP_FACTORY(TemplateFactory) \
1.44 -CREATE_EDGE_MAP_FACTORY(TemplateFactory)
1.45 -
1.46 -/** Import a map from a concrete map factory. The import method is
1.47 - * an overloading of the map type.
1.48 - * The reason to use these macro is that the c++ does not support
1.49 - * the template typedefs. If a future release of the c++
1.50 - * supports this feature it should be fixed.
1.51 - */
1.52 -#define IMPORT_NODE_MAP(Factory) \
1.53 -template <typename V> \
1.54 -class NodeMap : public Factory::Map<V> { \
1.55 -public: \
1.56 -NodeMap() {} \
1.57 -NodeMap(const Graph& g) : Factory::Map<V>(&g, &(g.node_maps)) {} \
1.58 -NodeMap(const Graph& g, const V& v) : Factory::Map<V>(g, g.node_maps, v) {} \
1.59 -NodeMap(const NodeMap& copy) \
1.60 - : Factory::Map<V>(static_cast<const Factory::Map<V>&>(copy)) {} \
1.61 -template <typename CMap> NodeMap(const CMap& copy) : Factory::Map<V>(copy) {} \
1.62 -NodeMap& operator=(const NodeMap& copy) { \
1.63 - this->Factory::Map<V>::operator=(static_cast<Factory::Map<V>&>(copy)); \
1.64 - return *this; \
1.65 -} \
1.66 -template <typename CMap>NodeMap& operator=(const CMap& copy) { \
1.67 - this->Factory::Map<V>::operator=<CMap>(static_cast<Factory::Map<V>&>(copy));\
1.68 - return *this; \
1.69 -} \
1.70 -};
1.71 -
1.72 -/** Import a map from a concrete map factory. The import method is
1.73 - * an overloading of the map type.
1.74 - * The reason to use these macro is that the c++ does not support
1.75 - * the template typedefs. If a future release of the c++
1.76 - * supports this feature it should be fixed.
1.77 - */
1.78 -#define IMPORT_EDGE_MAP(Factory) \
1.79 -template <typename V> \
1.80 -class EdgeMap : public Factory::Map<V> { \
1.81 -public: \
1.82 -EdgeMap() {} \
1.83 -EdgeMap(const Graph& g) : Factory::Map<V>(g, g.edge_maps) {} \
1.84 -EdgeMap(const Graph& g, const V& v) : Factory::Map<V>(g, g.node_maps, v) {} \
1.85 -EdgeMap(const EdgeMap& copy) \
1.86 - : Factory::Map<V>(static_cast<Factory::Map<V>&>(copy)) {} \
1.87 -template <typename CMap> EdgeMap(const CMap& copy) : Factory::Map<V>(copy) {} \
1.88 -EdgeMap& operator=(const EdgeMap& copy) { \
1.89 - this->Factory::Map<V>::operator=(static_cast<Factory::Map<V>&>(copy)); \
1.90 - return *this; \
1.91 -} \
1.92 -template <typename CMap>EdgeMap& operator=(const CMap& copy) { \
1.93 - this->Factory::Map<V>::operator=<CMap>(static_cast<Factory::Map<V>&>(copy));\
1.94 - return *this; \
1.95 -} \
1.96 -};
1.97 -
1.98 -/** This macro creates both map factories and imports both maps.
1.99 - */
1.100 -#define CREATE_MAPS(TemplateFactory) \
1.101 -CREATE_MAP_FACTORIES(TemplateFactory) \
1.102 -IMPORT_NODE_MAP(NodeMapFactory) \
1.103 -IMPORT_EDGE_MAP(EdgeMapFactory)
1.104 -
1.105 -#endif