top | up | prev | next

ServerConfig Class

Definition at line 43 of ServerConfig.hpp

Constructors

ServerConfig()
ServerConfig(const ServerConfig&) delete

Member Functions

void Add(const std::string& serverName, const std::string& hostName, int port, const std::string& defaultToolChain, bool force, bool read, bool write)
void Done() static
ServerInfo* GetServerInfo(const std::string& serverName, bool failIfNotExist, bool read)
void Init() static
ServerConfig& Instance() static
void Read()
void Remove(const std::string& serverName)
void Show()
void Write()
ServerConfig& operator=(const ServerConfig&) delete

Member Variables

std::map<std::pair<std::string, int>, std::string> hostPortMap
std::unique_ptr<ServerConfig> instance static
std::vector<std::unique_ptr<ServerInfo>> serverInfos
std::map<std::string, ServerInfo*> serverMap

Constructor Details

ServerConfig Constructor

cmajor::build::ServerConfig::ServerConfig()

Definition at line 280 of ServerConfig.cpp :
281 {
282     Read();
283     ServerInfo* local = GetServerInfo("local"falsefalse);
284     if (!local)
285     {
286         Add("local"std::string()GetDefaultLocalPort()GetDefaultToolChainForCurrentPlatform()truefalsetrue);
287     }
288 }


Declaration at line 58 of ServerConfig.hpp


ServerConfig Constructor

cmajor::build::ServerConfig::ServerConfig(const ServerConfig &) delete

Definition at line 51 of ServerConfig.hpp


Member Function Details

Add Member Function

void cmajor::build::ServerConfig::Add(const std::string& serverName, const std::string& hostName, int port, const std::string& defaultToolChain, bool force, bool read, bool write)

Definition at line 161 of ServerConfig.cpp
Declaration at line 53 of ServerConfig.hpp

Calls: cmajor::build::ServerConfig::GetServerInfo , cmajor::build::ServerConfig::Read , cmajor::build::ServerConfig::Write , cmajor::build::ServerInfo::SetDefaultToolChain , cmajor::build::ServerInfo::SetHost , cmajor::build::ServerInfo::SetPort

Called by: cmajor::build::AddServerClientCommand::Execute , cmajor::build::AddServerServerCommand::Execute , cmajor::build::ServerConfig::Read


Done Member Function

void cmajor::build::ServerConfig::Done() static

Definition at line 72 of ServerConfig.cpp :
 73 {
 74     instance.reset();
 75 }


Declaration at line 47 of ServerConfig.hpp


GetServerInfo Member Function

ServerInfo * cmajor::build::ServerConfig::GetServerInfo(const std::string& serverName, bool failIfNotExist, bool read)

Definition at line 290 of ServerConfig.cpp
Declaration at line 56 of ServerConfig.hpp

Calls: cmajor::build::ServerConfig::Read

Called by: cmajor::build::ServerConfig::Add , cmajor::build::SocketClient::Run


Init Member Function

void cmajor::build::ServerConfig::Init() static

Definition at line 67 of ServerConfig.cpp :
 68 {
 69     instance.reset(new ServerConfig());
 70 }


Declaration at line 46 of ServerConfig.hpp


Instance Member Function

ServerConfig & cmajor::build::ServerConfig::Instance() static

Definition at line 48 of ServerConfig.hpp :
48 { return *instance; }

Called by: cmajor::build::AddServerClientCommand::Execute , cmajor::build::AddServerServerCommand::Execute , cmajor::build::RemoveServerClientCommand::Execute , cmajor::build::RemoveServerServerCommand::Execute , cmajor::build::ShowConfigurationClientCommand::Execute , cmajor::build::ShowConfigurationServerCommand::Execute , cmajor::build::SocketClient::Run


Read Member Function

void cmajor::build::ServerConfig::Read()

Definition at line 89 of ServerConfig.cpp
Declaration at line 49 of ServerConfig.hpp

Calls: cmajor::build::ServerConfig::Add , sngxml::dom::Element::GetAttribute , sngxml::dom::Node::GetNodeType , sngxml::xpath::XPathNodeSet::Length

Called by: cmajor::build::ServerConfig::Add , cmajor::build::ServerConfig::GetServerInfo , cmajor::build::ServerConfig::Show


Remove Member Function

void cmajor::build::ServerConfig::Remove(const std::string& serverName)

Definition at line 246 of ServerConfig.cpp
Declaration at line 54 of ServerConfig.hpp

Calls: cmajor::build::ServerConfig::Write

Called by: cmajor::build::RemoveServerClientCommand::Execute , cmajor::build::RemoveServerServerCommand::Execute


Show Member Function

void cmajor::build::ServerConfig::Show()

Definition at line 269 of ServerConfig.cpp :
270 {
271     Read();
272     CodeFormatter formatter(std::cout);
273     for (const auto& p : serverMap)
274     {
275         ServerInfo* serverInfo = p.second;
276         serverInfo->Print(formatter);
277     }
278 }


Declaration at line 55 of ServerConfig.hpp

Calls: cmajor::build::ServerConfig::Read , cmajor::build::ServerInfo::Print

Called by: cmajor::build::ShowConfigurationClientCommand::Execute , cmajor::build::ShowConfigurationServerCommand::Execute


Write Member Function

void cmajor::build::ServerConfig::Write()

Definition at line 131 of ServerConfig.cpp
Declaration at line 50 of ServerConfig.hpp

Calls: sngxml::dom::Document::AppendChild , sngxml::dom::Document::Write , sngxml::dom::Element::SetAttribute , sngxml::dom::ParentNode::AppendChild

Called by: cmajor::build::ServerConfig::Add , cmajor::build::ServerConfig::Remove


operator= Member Function

ServerConfig & cmajor::build::ServerConfig::operator=(const ServerConfig &) delete

Definition at line 52 of ServerConfig.hpp


top | up | prev | next