Test: PityTest - AbstractPityUnit add setExecMode()

LIB-11
heck 2 years ago
parent 45b783c724
commit 1a766e6ece

@ -42,8 +42,8 @@ namespace pEp {
{
_procUnitNr = rhs._procUnitNr;
_exec_mode = rhs._exec_mode;
_transport = rhs._transport;
_transport_endpoints = rhs._transport_endpoints;
_transport = rhs._transport; // Will re-initialized in run()
_transport_endpoints = rhs._transport_endpoints; // Will re-initialized in run()
_init();
}
@ -75,6 +75,10 @@ namespace pEp {
return AbstractPityUnit::_global_root_dir;
}
void AbstractPityUnit::setExecMode(AbstractPityUnit::ExecutionMode execMode)
{
_exec_mode = execMode;
}
// For:
// RootUnit - "<name>"
@ -412,7 +416,7 @@ namespace pEp {
std::string AbstractPityUnit::_status_string(const std::string &msg) const
{
std::string ret;
ret = "[ " + to_string(_exec_mode) + ":" + std::to_string(getpid()) + " ] [ " +
ret = "[ " + to_string(_exec_mode) + ": " + std::to_string(getpid()) + " ] [ " +
getPathShort() + " ] [ " + msg + " ]";
return ret;
}

@ -53,6 +53,7 @@ namespace pEp {
// Read-Write
static void setGlobalRootDir(const std::string& dir);
static std::string getGlobalRootDir();
void setExecMode(ExecutionMode execMode);
// Read-Only
std::string getPathShort() const;
@ -113,13 +114,14 @@ namespace pEp {
// Fields
// ------
static std::string _global_root_dir;
int _procUnitNr;
ExecutionMode _exec_mode;
int _procUnitNr;
static int _procUnitsCount; // will be increased in every constructor
// transport
std::shared_ptr<PityTransport> _transport; //only ever read via transport()
// TODO move endpoints into PityTransport
Endpoints _transport_endpoints; // only ever access via transportEndpoints()
Endpoints _transport_endpoints; // only ever access via transportEndpoints()
// fs-mutex to sync across processes
std::shared_ptr<fs_mutex> _log_mutex = nullptr;

Loading…
Cancel
Save