Browse Source

Test: PityTest - AbstractPityUnit add setExecMode()

LIB-11
heck 11 months ago
parent
commit
1a766e6ece
2 changed files with 11 additions and 5 deletions
  1. +7
    -3
      test/pitytest11/src/AbstractPityUnit.cc
  2. +4
    -2
      test/pitytest11/src/AbstractPityUnit.hh

+ 7
- 3
test/pitytest11/src/AbstractPityUnit.cc View File

@ -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;
}


+ 4
- 2
test/pitytest11/src/AbstractPityUnit.hh View File

@ -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