summaryrefslogtreecommitdiff
path: root/options.h
diff options
context:
space:
mode:
Diffstat (limited to 'options.h')
-rw-r--r--options.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/options.h b/options.h
index e0c1ac3..b533695 100644
--- a/options.h
+++ b/options.h
@@ -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