28 bool dofactories =
false;
61 printf(
"Force application exit\n");
76 printf(
"DABC_GLOBAL_SigPipeHandler: no manager, Force application exit\n");
86 printf(
"Signal handler was already installed !!!\n");
93 printf(
"Cannot change handler for SIGINT\n");
98 printf(
"Cannot change handler for SIGPIPE\n");
126 size_t pos = arg.find(
"dabc://");
127 if (pos==std::string::npos)
128 return std::string(
"dabc://") + arg;
129 if (pos == 0)
return arg;
131 return std::string();
138 EOUT(
"Manager was not created");
143 if (fullname.empty()) {
144 EOUT(
"Wrong address format %d", nodeaddr.c_str());
151 cmd.SetReceiver(fullname);
155 EOUT(
"FAIL connection to %s", nodeaddr.c_str());
167 if (fullname.empty()) {
168 EOUT(
"Wrong address format %d", nodeaddr.c_str());
177 EOUT(
"Fail to get hierarchy from node %s", nodeaddr.c_str());
Command to request names list.
static Hierarchy GetResNamesList(dabc::Command &cmd)
Represents command with its arguments.
Command & SetTimeout(double tm)
Set maximum time which can be used for command execution.
Command & SetReceiver(const std::string &itemname)
These methods prepare command so, that one can submit command to the manager like: dabc::mgr....
Full-functional class to reading configuration from xml files.
Represents objects hierarchy of remote (or local) DABC process.
void CloseFile()
Close any file open by logger.
bool CreateControl(bool withserver, int serv_port=0, bool allow_clients=true)
Create command channel Parameter withserver defines if server socket will be created,...
Manager of everything in DABC
static const char * DfltName()
void Destroy()
Release reference and starts destroyment of referenced object.
bool SyncWorker(double tmout=-1.)
Synchronize worker with caller thread.
bool Execute(Command cmd, double tmout=-1.)
bool InstallSignalHandlers()
Method is used to install DABC-specific Ctrl-C handler It allows to correctly stop program execution ...
bool CtrlCPressed()
Returns true when CtrlC was pressed in handler.
Hierarchy GetNodeHierarchy(const std::string &nodeaddr)
Function request hierarchy of objects on remote node.
bool CreateManager(const std::string &name, int cmd_port=-1)
Function should be used to create manager instance.
bool DestroyManager()
Function can be used to destroy manager.
std::string MakeNodeName(const std::string &arg)
Function creates node name, which can be supplied as receiver of dabc commands.
bool ConnectDabcNode(const std::string &nodeaddr)
Function establish connection with specified dabc node.
void DABC_GLOBAL_SigPipeHandler(int number)
void DABC_GLOBAL_CtrlCHandler(int number)
dabc::Thread_t DABC_SigThrd