diff options
Diffstat (limited to 'options.h')
-rw-r--r-- | options.h | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -46,7 +46,8 @@ typedef std::list<OptionConnectTo> ConnectToList; class Options { public: - Options(); + static Options& instance(); + bool parse(int argc, char* argv[]); void printUsage(); void printOptions(); @@ -91,6 +92,21 @@ public: ConnectToList getConnectTo(); private: + Options(); + ~Options(); + Options(const Options &l); + void operator=(const Options &l); + + static Options* inst; + static Mutex instMutex; + class instanceCleaner { + public: ~instanceCleaner() { + if(Options::inst != 0) + delete Options::inst; + } + }; + friend class instanceCleaner; + Mutex mutex; ConnectToList connect_to_; @@ -114,4 +130,6 @@ private: std::string auth_algo_; }; +extern Options& gOpt; + #endif |