src/test/path_test.cc
author hegyi
Sun, 12 Sep 2004 21:46:26 +0000
changeset 831 b6ae3446098a
parent 823 afba7fbbb239
child 832 fbee94295d75
permissions -rw-r--r--
The first version of new path test program. The old became old_path_test.
     1 #include <string>
     2 #include <iostream>
     3 #include <hugo/skeletons/path.h>
     4 #include <hugo/path.h>
     5 #include <hugo/list_graph.h>
     6 
     7 using namespace std;
     8 using namespace hugo;
     9 using namespace skeleton;
    10 
    11 template<class Path> void checkCompilePath(Path &P) 
    12 {
    13   typedef typename Path::EdgeIt EdgeIt;
    14   typedef typename Path::NodeIt NodeIt;
    15   typedef typename Path::GraphNode GraphNode;
    16   typedef typename Path::GraphEdge GraphEdge;
    17   //typedef typename Path::Builder Builder;
    18   //??? ha csinalok ilyet es siman Builderrel peldanyositok, akkor warningol. Talan friend miatt? De ki az?
    19 
    20   EdgeIt ei;
    21   NodeIt ni;
    22   GraphNode gn;
    23   GraphEdge ge;
    24 
    25   size_t st;
    26   bool b;
    27 
    28   //Path(const Graph &_G) {}      //the constructor has been already called
    29 
    30   st=P.length();                  //size_t length() const {return 0;}
    31   b=P.empty();                    //bool empty() const {}
    32   P.clear();                      //void clear() {}
    33 
    34   gn=P.head();                    //GraphNode/*It*/ head() const {return INVALID;}
    35   gn=P.tail();                    //GraphNode/*It*/ tail() const {return INVALID;}
    36 
    37   ei=P.first(ei);                 //It& first(It &i) const { return i=It(*this); }
    38 
    39   ni=P.head(ei);                  //NodeIt head(const EdgeIt& e) const {}
    40   ni=P.tail(ei);                  //NodeIt tail(const EdgeIt& e) const {}
    41 
    42 
    43   ListGraph lg;
    44   Path p(lg);
    45 
    46   EdgeIt i;	                  //EdgeIt() {}
    47   EdgeIt j(INVALID);	          //EdgeIt(Invalid) {}
    48   EdgeIt k(p);	                  //EdgeIt(const Path &_p) {}
    49 
    50   //??? operator GraphEdge () const {}
    51 
    52   //INVALIDra megy a ++????
    53   i=++j;	                  //EdgeIt& operator++() {}
    54   b=(i==j);	                  //bool operator==(const EdgeIt& e) const {return true;}
    55   b=(i!=j);	                  //bool operator!=(const EdgeIt& e) const {return true;}
    56 
    57 
    58   NodeIt l;                       //NodeIt() {}
    59   NodeIt m(INVALID);	          //NodeIt(Invalid) {}
    60   NodeIt n(p);	                  //NodeIt(const Path &_p) {}
    61 
    62   //operator const GraphNode& () const {}
    63 
    64   l=++m;                          //NodeIt& operator++() {}
    65   b=(m==n);                       //bool operator==(const NodeIt& e) const {}
    66   b=(m!=n);                   	  //bool operator!=(const NodeIt& e) const {}
    67 
    68   typename Path::Builder builder(p);     //Builder(Path &_P) : P(_P) {}
    69   builder.setStartNode(gn);     	 //void setStartNode(const GraphNode &) {}
    70   builder.pushFront(ge);	         //void pushFront(const GraphEdge& e) {}
    71   builder.pushBack(ge);	                 //void pushBack(const GraphEdge& e) {}
    72   builder.commit();	                 //void commit() {}
    73   builder.reserveFront(st);	         //void reserveFront(size_t r) {}
    74   builder.reserveBack(st);	         //void reserveBack(size_t r) {}
    75 
    76 }
    77 
    78 template void checkCompilePath< skeleton::Path<ListGraph> >(skeleton::Path<ListGraph> &);
    79 template void checkCompilePath< DirPath<ListGraph> >(DirPath<ListGraph> &);
    80 template void checkCompilePath< UndirPath<ListGraph> >(UndirPath<ListGraph> &);
    81 
    82 int main() 
    83 {
    84 }