00001 /* 00002 * CommonOptions.hpp 00003 * 00004 * Created on: Oct 17, 2011 00005 * Author: mriedel 00006 */ 00007 00008 #ifndef COMMONOPTIONS_HPP_ 00009 #define COMMONOPTIONS_HPP_ 00010 00011 #include <telekyb_defines/telekyb_defines.hpp> 00012 00013 #include <telekyb_base/Options/OptionContainer.hpp> 00014 00015 namespace TELEKYB_NAMESPACE 00016 { 00017 00018 00019 // NOTE: CommonOptions SHOULD NEVER be mandatory! 00020 class CommonOptions : public OptionContainer { 00021 private: 00022 static CommonOptions* instance; 00023 // Singleton overwrites 00024 CommonOptions(); 00025 virtual ~CommonOptions(); 00026 CommonOptions(const CommonOptions &); 00027 CommonOptions& operator=(const CommonOptions &); 00028 00029 protected: 00030 std::string nodeName; 00031 void setNodeName(const std::string& nodeName_); 00032 00033 // nodeName is set from Telekyb::init 00034 friend class TeleKyb; 00035 00036 public: 00037 // Options 00038 Option<std::string>* tConfigFile; 00039 BoundsOption<int>* tDebugLevel; 00040 Option<bool>* tPrintOptions; 00041 00042 00043 std::string getNodeName() const; 00044 00045 void printOptions() const; 00046 00047 // Singleton Stuff 00048 static CommonOptions& Instance(); 00049 static CommonOptions* InstancePtr(); 00050 static bool hasInstance(); 00051 static void ShutDownInstance(); 00052 00053 }; 00054 00055 } /* namespace telekyb */ 00056 #endif /* COMMONOPTIONS_HPP_ */