00001 #ifndef _DUMMY_SERVICE_MAPPER_H 00002 #define _DUMMY_SERVICE_MAPPER_H 00003 00004 #include "m_map.h" 00005 #include "BinaryLogObject.h" 00006 #include "ScopedLogReader.h" 00007 #include "ScopedStackExecution.h" 00008 #include "Accumulator.h" 00009 #include "StringLogReader.h" 00010 #include "ParamReader.h" 00011 00018 namespace mace { 00023 typedef BinaryLogObject* (*BinaryLogFactory)(); 00024 00025 class DummyServiceMapper{ 00026 private: 00027 bool doInit() { 00028 ScopedLogReader_namespace::init(); 00029 SSEReader::init(); 00030 AccumulatorLogObject::init(); 00031 StringLogReader_namespace::init(); 00032 ParamReader_namespace::init(); 00033 return true; 00034 } 00035 00036 public: 00037 static map<std::string, BinaryLogFactory, SoftState> mapper; 00038 void addFactory(const std::string& type, BinaryLogFactory fac) { mapper[type] = fac; } 00039 00040 BinaryLogFactory getFactory(const std::string& key) { 00041 static bool inited __attribute__((unused)) = doInit(); 00042 return mapper[key]; 00043 } 00044 }; 00045 } 00046 00047 #endif // _DUMMY_SERVICE_MAPPER_H