diff options
author | Christian Pointner <equinox@anytun.org> | 2008-02-25 00:05:37 +0000 |
---|---|---|
committer | Christian Pointner <equinox@anytun.org> | 2008-02-25 00:05:37 +0000 |
commit | 2205b2fbf6f29d9d7fec8d245d51c0ccd75d2a7f (patch) | |
tree | e32ab0b36d848f4454a9e22871ba0b446fc6cc7f /options.h | |
parent | sorry forgot to add keyDerivatioFactory (diff) |
options is global now
kd_prf_ is set to null if cipher_ is null as well
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 |