GraphTypes.h

Go to the documentation of this file.
00001 // $Id: GraphTypes.h 165 2006-05-29 16:39:53Z bingmann $
00002 
00003 #ifndef VGS_GraphTypes_H
00004 #define VGS_GraphTypes_H
00005 
00006 #include <limits.h>
00007 #include <vector>
00008 #include <string>
00009 
00011 namespace VGServer {
00012 
00018 
00019 typedef int coord_t;
00020 
00022 const coord_t COORD_INVALID = INT_MAX;
00023 
00025 typedef unsigned int vertexid_t;
00026 
00028 const vertexid_t VERTEX_INVALID = UINT_MAX;
00029 
00032 enum vertex_or_edge_t { VE_VERTEX=0, VE_EDGE=1 };
00033 
00035 enum attrtype_t
00036 { ATTRTYPE_INVALID = 0x0,
00037   ATTRTYPE_BOOL = 0x1,
00038   ATTRTYPE_CHAR = 0x10,   ATTRTYPE_SHORT = 0x11, ATTRTYPE_INTEGER = 0x12, ATTRTYPE_LONG = 0x13,
00039   ATTRTYPE_BYTE = 0x20,   ATTRTYPE_WORD = 0x21,  ATTRTYPE_DWORD = 0x22, ATTRTYPE_QWORD = 0x23,
00040   ATTRTYPE_FLOAT = 0x30,  ATTRTYPE_DOUBLE = 0x31,
00041   ATTRTYPE_STRING = 0x40, ATTRTYPE_LONGSTRING = 0x41
00042 };
00043 
00046 #define CASE_FIXED_LENGTH       \
00047 case ATTRTYPE_BOOL: \
00048 case ATTRTYPE_CHAR: case ATTRTYPE_SHORT: case ATTRTYPE_INTEGER: case ATTRTYPE_LONG: \
00049 case ATTRTYPE_BYTE: case ATTRTYPE_WORD: case ATTRTYPE_DWORD: case ATTRTYPE_QWORD: \
00050 case ATTRTYPE_FLOAT: case ATTRTYPE_DOUBLE
00051 
00054 struct QueryLimits
00055 {
00056     unsigned int vertexmaxlimit;
00057     unsigned int vertexminlimit;
00058     unsigned int edgemaxlimit;
00059     unsigned int edgeminlimit;
00060 
00061     inline QueryLimits() {
00062         vertexmaxlimit = vertexminlimit = UINT_MAX;
00063         edgemaxlimit = edgeminlimit = UINT_MAX;
00064     }
00065 
00066     inline QueryLimits(unsigned int vxl, unsigned int vnl,
00067                        unsigned int exl, unsigned int enl)
00068         : vertexmaxlimit(vxl), vertexminlimit(vnl),
00069           edgemaxlimit(exl), edgeminlimit(enl)
00070     {
00071     }
00072 };
00073 
00077 class GraphException : public std::exception
00078 {
00079 private:
00080     std::string msg;
00081 
00082 public:
00083     inline GraphException(const std::string &s) throw()
00084         : std::exception(), msg(s)
00085     { }
00086 
00087     virtual ~GraphException() throw()
00088     { }
00089 
00090     virtual const char* what() throw()
00091     { return msg.c_str(); }
00092 
00093     inline const std::string& what_str() throw()
00094     { return msg; }
00095 };
00096 
00097 } // namespace VGServer
00098 
00099 #endif // VGS_GraphTypes_H

Generated on Wed Sep 27 14:34:00 2006 for VGServer by  doxygen 1.4.7