Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

config.h

Go to the documentation of this file.
00001 #ifndef DEV_W3_ORG__2001_BLINDFOLD_CONFIG_H
00002 #define DEV_W3_ORG__2001_BLINDFOLD_CONFIG_H
00003 
00014 #include <stddef.h>
00015 #include <stdlib.h>
00016 
00017 #ifdef __cplusplus
00018 
00019 #include <iostream>
00020 #include <string>
00021 #include <hash_map>      // we need to get struct hash { } from somewhere
00022 
00023 #ifdef NDEBUG
00024 #undef _STLP_DEBUG
00025 #else
00026 // wont even pass pre-processor!   #define _STLP_DEBUG 1
00027 #endif
00028 
00029 #ifndef _STLP_BEGIN_NAMESPACE
00030 // we're not using STL Port...
00031 #define _STLP_BEGIN_NAMESPACE namespace std {
00032 #define _STLP_END_NAMESPACE }
00033 #define _STLP_TEMPLATE_NULL template<>
00034 
00035 namespace std {
00036     template<> struct hash<string> { 
00037     size_t operator()(const string& me) const 
00038         { 
00039         const char* __s = me.c_str();
00040         unsigned long __h = 0; 
00041         for ( ; *__s; ++__s)
00042             __h = 5*__h + *__s;
00043         return size_t(__h);
00044         } 
00045     };
00046 }
00047 
00048 #endif
00049 
00050 #define STANDARD_EXTERNAL(classname)                                \
00051                                                 \
00052 _STLP_BEGIN_NAMESPACE                                       \
00053 _STLP_TEMPLATE_NULL struct hash<class ::classname> {                            \
00054   size_t operator()(const ::classname& me) const   { return me.hash(); }                \
00055 };                                                  \
00056 _STLP_TEMPLATE_NULL struct hash<class classname*> {                         \
00057   size_t operator()(const ::classname* const me) const   { return me->hash(); }         \
00058 };                                                  \
00059 _STLP_END_NAMESPACE                                     \
00060                                                     \
00061 inline std::ostream& operator<<(std::ostream& stream, const classname& me)                  \
00062 {  return me.print_to(stream);  }
00063 
00064 
00065 
00066 
00073 #define NOT_IMPLEMENTED  { std::cerr << "Feature Not Implemented (yet) " << __FILE__ << ":" << __LINE__ << " in " << __PRETTY_FUNCTION__ << "\n"; abort(); }
00074 
00079 #define die(x)  { std::cerr << "******" << endl << "Error Detected Internal to Blindfold, in " << __FILE__ << ":" << __LINE__ << " in " << __PRETTY_FUNCTION__ << endl << x << endl << "*******" << endl ; abort(); }
00080 
00081 using std::endl;
00082 
00083 #ifndef NDEBUG
00084 #define DO_TRACE 1
00085 #endif
00086 
00087 #if DO_TRACE
00088 #define TRACEOUT std::cout
00089 #define TRACING (Trace::get(TRACE_NAME))
00090 #define TRACE if (TRACING) TRACEOUT <<
00091 #else
00092 #define TRACE if (0) std::cout <<
00093 #endif
00094 
00095 #include "Trace.h"
00096 
00097 #else
00098 
00099 #include <stdio.h>
00100 
00101 #define NOT_IMPLEMENTED  { fprintf(stderr, "Feature Not Implemented (yet) %s:%d in %s\n", __FILE__, __LINE__, __PRETTY_FUNCTION__); abort(); }
00102 
00103 #define die(x) { fprintf(stderr, "Internal Error Detected (%s): %s:%d in %s\n",x, __FILE__, __LINE__, __PRETTY_FUNCTION__); abort(); }
00104 
00105 #endif
00106 
00107 
00108 #endif /* DEV_W3_ORG__2001_BLINDFOLD_CONFIG_H */   // -*-C++-*-
00109 

Home to blindfold. This page generated via doxygen 1.2.11.1 Wed Oct 10 16:40:33 2001.