diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2008-11-19 16:15:17 +0100 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2008-11-19 16:15:17 +0100 |
commit | 854421e2c144ab6454d67beb6640579ad13f1a1f (patch) | |
tree | 9856477c9a685be6355b9ef4f0c9485befac3192 /src/Client/CommandParser.cpp | |
parent | a3b3e7d83cab57673ba3daf5d71244598cf73f0c (diff) | |
download | mad-854421e2c144ab6454d67beb6640579ad13f1a1f.tar mad-854421e2c144ab6454d67beb6640579ad13f1a1f.zip |
Kurze statische get()-Methoden
Diffstat (limited to 'src/Client/CommandParser.cpp')
-rw-r--r-- | src/Client/CommandParser.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/Client/CommandParser.cpp b/src/Client/CommandParser.cpp index c0c8d7f..efc9c4b 100644 --- a/src/Client/CommandParser.cpp +++ b/src/Client/CommandParser.cpp @@ -74,7 +74,7 @@ void CommandParser::printUsage(const std::string& command) { std::map<std::string, Common::HostInfo> CommandParser::parseHostList(const std::vector<std::string> &args, bool mustBeActive) { - const std::map<std::string, Common::HostInfo>& hosts = InformationManager::getInformationManager()->getDaemons(); + const std::map<std::string, Common::HostInfo>& hosts = InformationManager::get()->getDaemons(); std::map<std::string, Common::HostInfo> ret; for(std::vector<std::string>::const_iterator arg = args.begin(); arg != args.end(); ++arg) { @@ -110,16 +110,16 @@ std::map<std::string, Common::HostInfo> CommandParser::parseHostList(const std:: void CommandParser::fsinfoCommand(const std::vector<std::string> &args) { if(args.size() == 1) - Common::RequestManager::getRequestManager()->sendRequest(connection, std::auto_ptr<Common::RequestBase>(new Common::Requests::FSInfoRequest(sigc::mem_fun(CommandManager::getCommandManager(), &CommandManager::fsInfoRequestFinished)))); + Common::RequestManager::get()->sendRequest(connection, std::auto_ptr<Common::RequestBase>(new Common::Requests::FSInfoRequest(sigc::mem_fun(CommandManager::get(), &CommandManager::fsInfoRequestFinished)))); else if(args.size() == 2) - Common::RequestManager::getRequestManager()->sendRequest(connection, std::auto_ptr<Common::RequestBase>(new Requests::DaemonFSInfoRequest(args[1], sigc::mem_fun(CommandManager::getCommandManager(), &CommandManager::daemonFSInfoRequestFinished)))); + Common::RequestManager::get()->sendRequest(connection, std::auto_ptr<Common::RequestBase>(new Requests::DaemonFSInfoRequest(args[1], sigc::mem_fun(CommandManager::get(), &CommandManager::daemonFSInfoRequestFinished)))); else { Common::Logger::logf(Common::Logger::ERROR, "%s: Too many arguments.", args[0].c_str()); printUsage("fsinfo"); return; } - ++CommandManager::getCommandManager()->activeRequests; + ++CommandManager::get()->activeRequests; } void CommandParser::helpCommand(const std::vector<std::string> &args) { @@ -152,7 +152,7 @@ void CommandParser::helpCommand(const std::vector<std::string> &args) { } void CommandParser::listHostsCommand(const std::vector<std::string> &args) { - const std::map<std::string, Common::HostInfo>& hosts = InformationManager::getInformationManager()->getDaemons(); + const std::map<std::string, Common::HostInfo>& hosts = InformationManager::get()->getDaemons(); if(args.size() == 1) { if(hosts.empty()) { @@ -213,11 +213,11 @@ void CommandParser::rebootCommand(const std::vector<std::string> &args) { std::map<std::string, Common::HostInfo> hosts = parseHostList(std::vector<std::string>(args.begin()+1, args.end()), true); for(std::map<std::string, Common::HostInfo>::iterator host = hosts.begin(); host != hosts.end(); ++host) { - Common::RequestManager::getRequestManager()->sendRequest(connection, std::auto_ptr<Common::RequestBase>( - new Requests::DaemonCommandRequest(host->first, true, sigc::mem_fun(CommandManager::getCommandManager(), &CommandManager::daemonCommandRequestFinished)) + Common::RequestManager::get()->sendRequest(connection, std::auto_ptr<Common::RequestBase>( + new Requests::DaemonCommandRequest(host->first, true, sigc::mem_fun(CommandManager::get(), &CommandManager::daemonCommandRequestFinished)) )); - ++CommandManager::getCommandManager()->activeRequests; + ++CommandManager::get()->activeRequests; } } @@ -231,32 +231,32 @@ void CommandParser::shutdownCommand(const std::vector<std::string> &args) { std::map<std::string, Common::HostInfo> hosts = parseHostList(std::vector<std::string>(args.begin()+1, args.end()), true); for(std::map<std::string, Common::HostInfo>::iterator host = hosts.begin(); host != hosts.end(); ++host) { - Common::RequestManager::getRequestManager()->sendRequest(connection, std::auto_ptr<Common::RequestBase>( - new Requests::DaemonCommandRequest(host->first, false, sigc::mem_fun(CommandManager::getCommandManager(), &CommandManager::daemonCommandRequestFinished)) + Common::RequestManager::get()->sendRequest(connection, std::auto_ptr<Common::RequestBase>( + new Requests::DaemonCommandRequest(host->first, false, sigc::mem_fun(CommandManager::get(), &CommandManager::daemonCommandRequestFinished)) )); - ++CommandManager::getCommandManager()->activeRequests; + ++CommandManager::get()->activeRequests; } } void CommandParser::statusCommand(const std::vector<std::string> &args) { if(args.size() == 1) - Common::RequestManager::getRequestManager()->sendRequest(connection, std::auto_ptr<Common::RequestBase>(new Common::Requests::StatusRequest(sigc::mem_fun(CommandManager::getCommandManager(), &CommandManager::statusRequestFinished)))); + Common::RequestManager::get()->sendRequest(connection, std::auto_ptr<Common::RequestBase>(new Common::Requests::StatusRequest(sigc::mem_fun(CommandManager::get(), &CommandManager::statusRequestFinished)))); else if(args.size() == 2) - Common::RequestManager::getRequestManager()->sendRequest(connection, std::auto_ptr<Common::RequestBase>(new Requests::DaemonStatusRequest(args[1], sigc::mem_fun(CommandManager::getCommandManager(), &CommandManager::daemonStatusRequestFinished)))); + Common::RequestManager::get()->sendRequest(connection, std::auto_ptr<Common::RequestBase>(new Requests::DaemonStatusRequest(args[1], sigc::mem_fun(CommandManager::get(), &CommandManager::daemonStatusRequestFinished)))); else { Common::Logger::logf(Common::Logger::ERROR, "%s: Too many arguments.", args[0].c_str()); printUsage("status"); return; } - ++CommandManager::getCommandManager()->activeRequests; + ++CommandManager::get()->activeRequests; } void CommandParser::exitCommand(const std::vector<std::string>&) { - ++CommandManager::getCommandManager()->activeRequests; + ++CommandManager::get()->activeRequests; - Common::RequestManager::getRequestManager()->sendRequest(connection, std::auto_ptr<Common::RequestBase>(new Common::Requests::DisconnectRequest(sigc::mem_fun(CommandManager::getCommandManager(), &CommandManager::disconnectRequestFinished)))); + Common::RequestManager::get()->sendRequest(connection, std::auto_ptr<Common::RequestBase>(new Common::Requests::DisconnectRequest(sigc::mem_fun(CommandManager::get(), &CommandManager::disconnectRequestFinished)))); } bool CommandParser::split(const std::string &str, std::vector<std::string> &ret) { |