Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

signal.h

Go to the documentation of this file.
00001 #ifndef SIGNAL_H 00002 #define SIGNAL_H 00003 00004 #include <iostream> 00005 #include <map> 00006 #include <string> 00007 #include <boost/any.hpp> 00008 using namespace std; 00009 using namespace boost; 00010 00015 class Signal 00016 { 00017 public: 00018 /***/ 00019 Signal(const string &d); 00020 /***/ 00021 ~Signal(); 00022 00024 template<typename T> 00025 T Load(const string &key) 00026 { 00027 if(KeyExists(parameters , key)) 00028 if(parameters[key].type() == typeid(T)) 00029 return any_cast<T>(parameters[key]); 00030 00031 throw bad_any_cast(); 00032 } 00033 00041 Signal &operator()(const string &key , any v); 00042 00043 private: 00044 map<string , any> parameters; 00045 const string debug; 00046 00047 friend ostream &operator<<(ostream &os , const Signal &sig); 00048 }; 00049 00051 ostream &operator<<(ostream &os , const Signal &sig); 00052 00053 #endif

Generated on Sun Mar 20 12:22:07 2005 for The Grid by doxygen 1.3.8