1#ifndef _DRAMA2_PATH_INC
2#define _DRAMA2_PATH_INC
40#include "DitsInteraction.h"
47#include <initializer_list>
70 std::chrono::steady_clock::time_point
until =
71 std::chrono::steady_clock::now();
82 until += std::chrono::duration_cast<std::chrono::steady_clock::duration>(
myDuration);
133 long int MessageBytes()
const {
return _bufInfo.MessageBytes; }
138 long int MaxMessages()
const {
return _bufInfo.MaxMessages; }
143 long int ReplyBytes()
const {
return _bufInfo.ReplyBytes; }
148 long int MaxReplies()
const {
return _bufInfo.MaxReplies; };
332 const std::string &
task,
353 const std::string &
task,
425 class MonForwardEventHandler :
public MessageEventHandler {
449 class GetPathEventHandler :
public thread::TransEvtProcessor {
471 const TransEvtInfo & eventInfo,
570 std::atomic<EventStatus> _status;
676 typedef std::set<Path *> ObjectListType;
677 static ObjectListType &ObjectList();
681 static bool _DisconnectEnabled;
688 static DVOIDP _OrigDisconnectData;
701 std::weak_ptr<Task> _theTask;
707 enum class PathState { INITIAL, SELFINIT, PATHWAIT, LOADING,
708 ACTIVE, DIED, NOTIFY }
709 _state = PathState::INITIAL;
719 bool _loaded =
false;
721 bool _logLoad =
true;
723 std::string _taskName;
725 std::string _taskLocation;
727 std::string _taskFile;
729 std::string _process;
731 std::string _argument;
735 unsigned _stackSize = 0;
744 void EnableDisconnect();
749 void ConstructorHelper();
757 const char *StateString(PathState
state)
const;
762 const char *StateString()
const {
763 return StateString(_state);
781 thread::TMessHandler *
action,
783 const TransEvtInfo &eventInfo);
788 void GetPathComplete(
789 const TransEvtInfo &eventInfo);
807 thread::TMessHandler *
action,
809 const std::string & name,
845 thread::TMessHandler *
action,
847 const std::string & name,
931 const std::string &name,
932 const std::string &
host =
"",
933 const std::string &
file =
"");
1009 const std::string &
GetHost()
const {
return (_taskLocation); }
1014 const std::string &
GetArgument()
const {
return (_argument); };
1032 virtual void SetName(
const std::string &TaskName);
1079 this->_buffers =
buffs;
1123 bool const Append=
false);
1219 _state = PathState::INITIAL;
1227 virtual bool Active()
const {
1228 return ((_state == PathState::ACTIVE)||
1229 (_state == PathState::SELFINIT));
1235 virtual bool IsDead()
const {
1236 return (_state == PathState::DIED);
1242 virtual bool Initial()
const {
1243 return ((_state == PathState::INITIAL)||
1244 (_state == PathState::DIED));
1253 virtual bool Busy()
const {
1254 return ((_state == PathState::PATHWAIT) ||
1255 (_state == PathState::LOADING) ||
1256 (_state == PathState::NOTIFY));
1263 virtual std::shared_ptr<Task>
GetTask()
const {
1264 return std::shared_ptr<Task>(_theTask);
1289 thread::TransEvtProcessor *
const eventProcessor = &_getPathEventProcessor );
1326 thread::TransEvtProcessor *
const eventProcessor = &_getPathEventProcessor );
1346 const std::string &name,
1352 fprintf(
stderr,
"!!!OBey - sending action %s\n", name.c_str());
1360 action->WaitForTransaction(_theTask,
1377 "Obey of message % to task %, returned but not complete",
1393 return std::chrono::steady_clock::now() + std::chrono::seconds(
secs);
1427 thread::TMessHandler *
action,
1428 const std::string &name,
1431 MessageEventHandler *
const eventProcessor = &_simpleEventProcessor) {
1435 TransEvtInfo eventInfo;
1436 bool ok =
action->WaitForTransactionUntil(
1441 if (!
ok)
return false;
1451 if (eventInfo.complete == 0)
1454 eventInfo.entryStatus,
1455 "Obey of action % to task %, returned but not complete",
1494 const std::string &name,
1499 MessageEventHandler *
const eventProcessor = &_simpleEventProcessor) {
1502 fprintf(
stderr,
"!!!OBeyBulk - sending action %s\n", name.c_str());
1510 TransEvtInfo eventInfo;
1511 action->WaitForTransaction(_theTask,
1524 if (eventInfo.complete == 0)
1527 eventInfo.entryStatus,
1528 "ObeyBulk of message % to task %, returned but not complete",
1561 const std::string &name,
1565 MessageEventHandler *
const eventProcessor = &_simpleEventProcessor) {
1620 thread::TMessHandler *
action,
1621 const std::string &name,
1626 MessageEventHandler *
const eventProcessor = &_simpleEventProcessor) {
1631 TransEvtInfo eventInfo;
1632 bool ok =
action->WaitForTransactionUntil(
1637 if (!
ok)
return false;
1647 if (eventInfo.complete == 0)
1650 eventInfo.entryStatus,
1651 "Obey of action % to task %, returned but not complete",
1700 thread::TMessHandler *
action,
1701 const std::string &name,
1705 MessageEventHandler *
const eventProcessor = &_simpleEventProcessor) {
1731 const std::string &name,
1734 MessageEventHandler *
const eventProcessor = &_simpleEventProcessor) {
1738 TransEvtInfo eventInfo;
1739 action->WaitForTransaction(_theTask,
1750 if (eventInfo.complete == 0)
1753 eventInfo.entryStatus,
1754 "Kick of action % in task %, returned but not complete",
1792 const std::string &name,
1800 bool ok =
action->WaitForTransactionUntil(
1805 if (!
ok)
return false;
1819 "Kick of action % in task %, returned but not complete",
1859 const std::string &name,
1864 MessageEventHandler *
const eventProcessor = &_simpleEventProcessor) {
1869 TransEvtInfo eventInfo;
1870 action->WaitForTransaction(_theTask,
1881 if (eventInfo.complete == 0)
1884 eventInfo.entryStatus,
1885 "Kick of action % in task %, returned but not complete",
1918 const std::string &name,
1922 MessageEventHandler *
const eventProcessor = &_simpleEventProcessor) {
1974 thread::TMessHandler *
action,
1975 const std::string &name,
1980 MessageEventHandler *
const eventProcessor = &_simpleEventProcessor) {
1985 TransEvtInfo eventInfo;
1986 bool ok =
action->WaitForTransactionUntil(
1991 if (!
ok)
return false;
2001 if (eventInfo.complete == 0)
2004 eventInfo.entryStatus,
2005 "Kick of action % in task %, returned but not complete",
2052 thread::TMessHandler *
action,
2053 const std::string &name,
2057 MessageEventHandler *
const eventProcessor = &_simpleEventProcessor) {
2076 const std::string &name,
2077 const sds::Id &
argIn,
2083 action->WaitForTransaction(_theTask,
2097 "Set of parameter % in task %, returned but not complete",
2129 const std::string &name,
2136 bool ok =
action->WaitForTransactionUntil(
2141 if (!
ok)
return false;
2155 "Set of message % in task %, returned but not complete",
2176 const std::string &name,
2178 MessageEventHandler *
const eventProcessor = &_simpleEventProcessor) {
2183 TransEvtInfo eventInfo;
2184 action->WaitForTransaction(_theTask,
2195 if (eventInfo.complete == 0)
2198 eventInfo.entryStatus,
2199 "Get of parameter % from task %, returned but not complete",
2219 const std::initializer_list<std::string>
names,
2228 action->WaitForTransaction(_theTask,
2242 "Get of parameters from task %, returned but not complete",
2278 const std::string &name,
2286 bool ok =
action->WaitForTransactionUntil(
2290 if (!
ok)
return false;
2304 "Get of parameter % from task %, returned but not complete",
2337 thread::TMessHandler *
action,
2338 const std::initializer_list<std::string>
names,
2340 MessageEventHandler *
const eventProcessor = &_simpleEventProcessor) {
2346 TransEvtInfo eventInfo;
2347 bool ok =
action->WaitForTransactionUntil(
2351 if (!
ok)
return false;
2360 if (eventInfo.complete == 0)
2363 eventInfo.entryStatus,
2364 "Get of parameters from task %, returned but not complete",
2391 const std::string &name,
2394 MessageEventHandler *
const eventProcessor = &_simpleEventProcessor) {
2399 TransEvtInfo eventInfo;
2400 action->WaitForTransaction(_theTask,
2411 if (eventInfo.complete == 0)
2414 eventInfo.entryStatus,
2415 "Control message % to task %, returned but not complete",
2452 thread::TMessHandler *
action,
2453 const std::string &name,
2456 MessageEventHandler *
const eventProcessor = &_simpleEventProcessor) {
2461 TransEvtInfo eventInfo;
2462 bool ok =
action->WaitForTransactionUntil(
2467 if (!
ok)
return false;
2477 if (eventInfo.complete == 0)
2480 eventInfo.entryStatus,
2481 "Control message % to task %, returned but not complete",
2505 virtual void Died() {
2507 _state = PathState::DIED;
2559 action->WaitForTransaction(_theTask,
2574 "Monitor START to task %, returned but not complete",
2599 const sds::Id &
argIn,
2600 MessageEventHandler *
const eventProcessor = &_simpleMonEventProcessor) {
2605 TransEvtInfo eventInfo;
2606 action->WaitForTransaction(_theTask,
2616 if (eventInfo.complete == 0)
2619 eventInfo.entryStatus,
2620 "Monitor FORWARD to task %, returned but not complete",
2644 const std::string &
task,
2645 const std::string
action,
2646 std::initializer_list<std::string>
pars,
2680 template <
typename ContainerType>
2682 const std::string &
task,
2683 const std::string
action,
2688 std::is_convertible<typename ContainerType::value_type,std::string>::value,
2689 "The container value type must be convertible to a std::string");
2713 MessageEventHandler *
const eventProcessor = &_simpleEventProcessor) {
2719 TransEvtInfo eventInfo;
2720 action->WaitForTransaction(_theTask,
2730 if (eventInfo.complete == 0)
2733 eventInfo.entryStatus,
2734 "Monitor CANCEL to task %, returned but not complete",
long int MaxMessages() const
Return the Max Messages specification.
Definition path.hh:165
Buffers(const DitsPathInfoType &info)
Construct a drama::Buffers object from a DitsPathInfoType variable.
Definition path.hh:150
long int MaxReplies() const
Return the Max Replies specification.
Definition path.hh:175
long int MessageBytes() const
Return the message bytes specification.
Definition path.hh:160
long int ReplyBytes() const
Return the reply bytes specification.
Definition path.hh:170
Buffers(long int MessageBytes=800, long int MaxMessages=2, long int ReplyBytes=800, long int MaxReplies=10)
Construct a drama::Buffers object from individual specifications.
Definition path.hh:135
A Class which supports setting up DRAMA message buffer structures.
Definition path.hh:120
Defines and optionally creates a shared memory section containing an SDS structure.
Definition bulkdata.hh:434
Defines and optionally creates a shared memory section.
Definition bulkdata.hh:121
virtual bool Process(thread::ProcessInfo messInfo, const TransEvtInfo &eventInfo, const sds::IdPtr &arg) override
This method is invoked for each message received in response to a GetPath operation.
virtual void NewTransaction(DitsMsgType msgType, DitsTransIdType tid) override
This method is invoked each time a messages is initiated.
Default event handler type for GetPath() calls.
Definition path.hh:476
void SetStatus(EventStatus newVal)
If a sub-class overrides one of the methods of MessageEventHandler that this class overrides,...
Definition path.hh:588
void NewTransaction(DitsMsgType msgType, DitsTransIdType tid) override
Invoked when a new transaction is started.
virtual void TaskDied(drama::thread::ProcessInfo messInfo, StatusType status) override
Invoked if the subsidiary task died whilst we were waiting for a reply from it.
std::string GetStr() const
Return a string version of the current event status values.
Definition path.hh:557
bool operator()() const
Indicate if the message is outstanding (running)
Definition path.hh:564
EventStatus
Detailed status of the message is returned using this enum.
Definition path.hh:534
@ Completed
The message has completed successfully.
@ Running
The message has been sent and has not completed.
@ Failed
The message has completed with a failure.
@ NotStarted
The message has not been sent as yet.
IsRunningType()
Constructor.
Definition path.hh:577
EventStatus Get() const
Return the status of the message.
Definition path.hh:544
void MessageRejected(drama::thread::ProcessInfo messInfo, StatusType status) override
Invoked for when a message is rejected.
std::string GetStr(EventStatus val) const
Return a string version of a event status value.
virtual void MessageComplete(drama::thread::ProcessInfo messInfo, StatusType status, const drama::sds::IdPtr &arg) override
Invoked if a message complete message is received.
A message event handling object that maintains a variable indicating if the message is outstanding.
Definition path.hh:529
virtual void BulkTransferred(thread::ProcessInfo messInfo, DitsBulkInfoType bulkInfo)
Invoked if a bulk data transferred message is received.
virtual void UserMessage(thread::ProcessInfo messInfo, const std::string &task, const std::string &message)
Invoked if a message for the user is received.
virtual void SignalReceived(thread::ProcessInfo messInfo, const sds::IdPtr &arg)
Invoked if a signal for the action is received.
virtual void NewTransaction(DitsMsgType msgType, DitsTransIdType tid) override
This method is invoked each time a message is initiated.
virtual void MessageRejected(thread::ProcessInfo messInfo, StatusType status)
Invoked if the message sent was rejected by the target task.
virtual void BulkDone(thread::ProcessInfo messInfo)
Invoked if a bulk data done message is received.
virtual void ThreadWaitAbort(thread::ProcessInfo messInfo, StatusType status)
Invoked if the thread wait is aborted.
virtual bool KickReceived(thread::ProcessInfo messInfo, const sds::IdPtr &arg)
Invoked if an action waiting on a message receives a kick message during the wait.
virtual bool Process(thread::ProcessInfo messInfo, const TransEvtInfo &eventInfo, const sds::IdPtr &arg) override final
Method invoked to process messages.
virtual void TaskDied(thread::ProcessInfo messInfo, StatusType status)
Invoked if the subsidiary task died whilst we were waiting for a reply from it.
virtual void MessageComplete(thread::ProcessInfo messInfo, StatusType status, const sds::IdPtr &arg)
Invoked if a message complete message is received.
virtual void TriggerReceived(thread::ProcessInfo messInfo, StatusType status, const sds::IdPtr &arg)
Invoked if a trigger message is received.
virtual void ErrorReport(thread::ProcessInfo messInfo, const std::string &task, const ErsMessageVector &messages)
Invoked if an error report for the user is received.
Message event handling objects.
Definition path.hh:194
virtual void TriggerReceived(thread::ProcessInfo messInfo, StatusType status, const sds::IdPtr &arg) override
Invoked if a trigger message is received.
Forward monitor message event handling objects.
Definition path.hh:452
void Kick(thread::TMessHandler *action, const std::string &name, const sds::Id &argIn=sds::Id::CreateNullItem(), sds::IdPtr *const argOut=nullptr, MessageEventHandler *const eventProcessor=&_simpleEventProcessor)
Sends a kick message to a task and blocks the current thread until the reply is received.
Definition path.hh:1757
virtual void SetPriority(const int Priority, const bool Absolute=false)
Set the load time priority for a task when loaded.
virtual void Disconnected()
Invoked when the task we are talking to disappears.
virtual ~Path()
Destructor.
void KickBulk(thread::TMessHandler *action, const std::string &name, BulkData *argIn, bool isSds, unsigned notifyBytes=1024 *1024, sds::IdPtr *const argOut=nullptr, MessageEventHandler *const eventProcessor=&_simpleEventProcessor)
Sends a kick message, with bulk data argument, to a task and blocks the current thread until the repl...
Definition path.hh:1885
void MonitorForward(thread::TMessHandler *taction, const std::string &task, const std::string action, const ContainerType &pars, MessageEventHandler *const eventProcessor=&_simpleMonEventProcessor)
Send a Monitor Forward message to a task and block until it is complete.
Definition path.hh:2708
Path(Path &&source)=default
Move copy constructor.
void Report(thread::TMessHandler *action) const
Dump details using <a href="../routines/MsgOut.html">MsgOut()</a>.
void MonitorStart(thread::TMessHandler *action, const sds::Id &argIn, MessageEventHandler *const eventProcessor)
Send a Monitor Start message to a task and block until is it is complete.
Definition path.hh:2576
virtual void SetFlowControl()
Set the FLOW control flag.
Definition path.hh:1113
virtual void LosePath()
Lose the path and then set as if the task has died.
void ObeyBulk(thread::TMessHandler *action, const std::string &name, BulkData *argIn, bool isSds, unsigned notifyBytes=1024 *1024, sds::IdPtr *const argOut=nullptr, MessageEventHandler *const eventProcessor=&_simpleEventProcessor)
Sends an obey message to a task, with bulk data argument, and blocks the current thread until the act...
Definition path.hh:1520
bool GetPathWaitUntil(std::chrono::steady_clock::time_point until, thread::TMessHandler *action, thread::TransEvtProcessor *const eventProcessor=&_getPathEventProcessor)
Get a path to a the task.
bool ObeyBulkWaitUntil(std::chrono::steady_clock::time_point until, thread::TMessHandler *action, const std::string &name, BulkData *argIn, bool isSds, unsigned notifyBytes=1024 *1024, sds::IdPtr *const argOut=nullptr, MessageEventHandler *const eventProcessor=&_simpleEventProcessor)
Sends an obey message to a task, with a bulk data argument, and blocks the current thread until the a...
Definition path.hh:1646
void GetParam(thread::TMessHandler *action, const std::initializer_list< std::string > names, sds::IdPtr *const argOut, MessageEventHandler *const eventProcessor=&_simpleEventProcessor)
Sends a get parameter message to a task and blocks the current thread until it completes.
Definition path.hh:2245
void MonitorForward(thread::TMessHandler *taction, const std::string &task, const std::string action, std::initializer_list< std::string > pars, MessageEventHandler *const eventProcessor=&_simpleMonEventProcessor)
Send a Monitor Forward message to a task and block until it is complete.
Definition path.hh:2670
const std::string & GetArgument() const
Fetch the load argument.
Definition path.hh:1041
const std::string & GetHost() const
Fetch the task host name.
Definition path.hh:1036
virtual void SetBuffers(const Buffers &buffs)
Set the DRAMA path buffers.
Definition path.hh:1105
void SetParam(thread::TMessHandler *action, const std::string &name, const sds::Id &argIn, MessageEventHandler *const eventProcessor=&_simpleEventProcessor)
Sends a set parameter message to a task and blocks the current thread until it completes.
Definition path.hh:2102
bool KickWaitUntil(std::chrono::steady_clock::time_point until, thread::TMessHandler *action, const std::string &name, const sds::Id &argIn=sds::Id::CreateNullItem(), sds::IdPtr *const argOut=nullptr, MessageEventHandler *const eventProcessor=&_simpleEventProcessor)
Sends a kick message to a task and block the current thread until the reply is received or a timeout ...
Definition path.hh:1817
bool GetParamWaitUntil(std::chrono::steady_clock::time_point until, thread::TMessHandler *action, const std::string &name, sds::IdPtr *const argOut, MessageEventHandler *const eventProcessor=&_simpleEventProcessor)
Sends a get parameter message to a task and blocks the current thread until it completes.
Definition path.hh:2303
bool SetParamWaitUntil(std::chrono::steady_clock::time_point until, thread::TMessHandler *action, const std::string &name, const sds::Id &argIn, MessageEventHandler *const eventProcessor=&_simpleEventProcessor)
Sends a set parameter message to a task and blocks the current thread until it completes or a timeout...
Definition path.hh:2154
void GetParam(thread::TMessHandler *action, const std::string &name, sds::IdPtr *const argOut, MessageEventHandler *const eventProcessor=&_simpleEventProcessor)
Sends a get parameter message to a task and blocks the current thread until it completes.
Definition path.hh:2202
virtual bool Active() const
Indicate if a task is active.
Definition path.hh:1254
static void HandleDisconnected(const char *task, DitsPathType path, StatusType *status)
Handle task disconnection.
Path & operator=(Path &&rhs)=default
Move assignment operator.
void ObeyBulk(thread::TMessHandler *action, const std::string &name, BulkDataSds *argIn, unsigned notifyBytes=1024 *1024, sds::IdPtr *const argOut=nullptr, MessageEventHandler *const eventProcessor=&_simpleEventProcessor)
Sends an obey message to a task, with SDS bulk data argument, and blocks the current thread until the...
Definition path.hh:1587
virtual void Died()
Note that a task has died.
Definition path.hh:2532
bool GetPathLoaded() const
Indicate if a the task was loaded.
Definition path.hh:1017
virtual void ClearState()
Clear the task state.
Definition path.hh:1245
virtual void SetSymbols(const bool Flag=true)
Interpert file name as a symbol (VMS Target only)
Definition path.hh:1199
virtual bool Busy() const
Returns true if we can't send a message because path is busy.
Definition path.hh:1280
virtual bool Initial() const
Return true if a GetPath operation is required.
Definition path.hh:1269
virtual DitsPathType GetDitsPath(bool nothrow=false)
Return the underlying DITS path object.
bool KickBulkWaitUntil(std::chrono::steady_clock::time_point until, thread::TMessHandler *action, const std::string &name, BulkDataSds *argIn, unsigned notifyBytes=1024 *1024, sds::IdPtr *const argOut=nullptr, MessageEventHandler *const eventProcessor=&_simpleEventProcessor)
Sends a kick message to a task and block the current thread until the reply is received or a timeout ...
Definition path.hh:2078
virtual void Delete(int force)
Delete the task.
bool KickBulkWaitUntil(std::chrono::steady_clock::time_point until, thread::TMessHandler *action, const std::string &name, BulkData *argIn, bool isSds, unsigned notifyBytes=1024 *1024, sds::IdPtr *const argOut=nullptr, MessageEventHandler *const eventProcessor=&_simpleEventProcessor)
Sends a kick message to a task and block the current thread until the reply is received or a timeout ...
Definition path.hh:2000
bool GetParamWaitUntil(std::chrono::steady_clock::time_point until, thread::TMessHandler *action, const std::initializer_list< std::string > names, sds::IdPtr *const argOut, MessageEventHandler *const eventProcessor=&_simpleEventProcessor)
Sends a get parameter message to a task and blocks the current thread until it completes.
Definition path.hh:2363
bool ControlWaitUntil(std::chrono::steady_clock::time_point until, thread::TMessHandler *action, const std::string &name, const sds::Id &argIn=sds::Id::CreateNullItem(), sds::IdPtr *const argOut=nullptr, MessageEventHandler *const eventProcessor=&_simpleEventProcessor)
Sends a control message to a task and block the current thread until the reply is received or a timeo...
Definition path.hh:2478
static void SpawnKickArgUpdate(drama::sds::Id *arg, DitsTransIdType tid)
update an SDS argument structure for kicking a Spawned transaction
static drama::sds::Id SpawnKickArg(DitsTransIdType tid)
Create an SDS argument structure for kicking a Spawned transaction.
void KickBulk(thread::TMessHandler *action, const std::string &name, BulkDataSds *argIn, unsigned notifyBytes=1024 *1024, sds::IdPtr *const argOut=nullptr, MessageEventHandler *const eventProcessor=&_simpleEventProcessor)
Sends a kick message, with SDS bulk data argument, to a task and blocks the current thread until the ...
Definition path.hh:1944
virtual void SetFile(const std::string &File)
Set the executable file name.
Definition path.hh:1094
virtual std::shared_ptr< Task > GetTask() const
Get a reference to the DRAMA task we are part of.
Definition path.hh:1290
virtual void SetProcess(const std::string &ProcessName)
Set the process names.
virtual void GetPathImmed()
Get a path to a task if DITS already has it.
void Obey(thread::TMessHandler *action, const std::string &name, const sds::Id &argIn=sds::Id::CreateNullItem(), sds::IdPtr *const argOut=nullptr, MessageEventHandler *const eventProcessor=&_simpleEventProcessor)
Sends an obey message to a task and blocks the current thread until the action is complete.
Definition path.hh:1372
bool ObeyBulkWaitUntil(std::chrono::steady_clock::time_point until, thread::TMessHandler *action, const std::string &name, BulkDataSds *argIn, unsigned notifyBytes=1024 *1024, sds::IdPtr *const argOut=nullptr, MessageEventHandler *const eventProcessor=&_simpleEventProcessor)
Sends an obey message to a task, with a SDS bulk data argument, and blocks the current thread until t...
Definition path.hh:1726
Path(std::weak_ptr< Task > theTask, DitsPathType path)
Construct from existing DITS path.
virtual void SetArgument(const std::string &LoadArg, bool const Append=false)
Set the load time argument string.
virtual void SetName(const std::string &TaskName)
Set the task name.
virtual void SetProg(const bool Flag=true)
Interpert file name as a program name.
Definition path.hh:1222
virtual void SetNames(const bool Flag=true)
Insist that symbols known to IMP_Master be known to the task.
Definition path.hh:1181
static std::chrono::steady_clock::time_point DeltaToTimePoint(int secs)
Given a number of seconds, return a time point that number of seconds into the future.
Definition path.hh:1419
virtual bool IsDead() const
Return true if a previously active task has disconnected.
Definition path.hh:1262
void Control(thread::TMessHandler *action, const std::string &name, const sds::Id &argIn=sds::Id::CreateNullItem(), sds::IdPtr *const argOut=nullptr, MessageEventHandler *const eventProcessor=&_simpleEventProcessor)
Sends a control message to a task and blocks the current thread until the reply is received.
Definition path.hh:2417
virtual void LogLoad(const bool Flag=true)
Load use <a href="../routines/MsgOut.html">MsgOut()</a> a lines indicating the load operations.
Definition path.hh:1236
Path(std::weak_ptr< Task > theTask)
Path to self constructor.
void MonitorCancel(thread::TMessHandler *action, int monId, MessageEventHandler *const eventProcessor=&_simpleEventProcessor)
Send a Monitor Cancel message to a task and block until it is complete.
Definition path.hh:2738
void MonitorForward(thread::TMessHandler *action, const sds::Id &argIn, MessageEventHandler *const eventProcessor=&_simpleMonEventProcessor)
Send a Monitor Forward message to a task and block until it is complete.
Definition path.hh:2625
const std::string GetTaskName() const
Fetch the task name.
Path()
Construct a null object.
Definition path.hh:996
virtual void SetStackSize(unsigned bytes)
Set the stack size for the load.
void GetPath(thread::TMessHandler *action, thread::TransEvtProcessor *const eventProcessor=&_getPathEventProcessor)
Get a path to a the task.
bool ObeyWaitUntil(std::chrono::steady_clock::time_point until, thread::TMessHandler *action, const std::string &name, const sds::Id &argIn=sds::Id::CreateNullItem(), sds::IdPtr *const argOut=nullptr, MessageEventHandler *const eventProcessor=&_simpleEventProcessor)
Sends an obey message to a task and blocks the current thread until the action is complete or a timeo...
Definition path.hh:1453
virtual void SetHost(const std::string &Host)
Set the task host name.
Definition path.hh:1067
A Class which provides access to DRAMA's message sending facilities.
Definition path.hh:689
std::lock_guard< mutexType > guardType
Defines the type of a lock guard using our mutex type.
Definition task.hh:460
static Id CreateArgCmdStruct(const ContainerType &values, const std::string &name="ArgStructure")
Factory constructor which creates a new "Arg" style SDS structure in the DRAMA Command style.
Definition sds.hh:2754
static Id CreateArgStruct(const std::string &name="ArgStructure")
Factory constructor which creates a new "Arg" style SDS structure.
static Id CreateNullItem()
Factory constructor method that constructs an null sds::Id item .
A C++ Interface to the handling SDS structures.
Definition sds.hh:428
A class with information used by the TransEvtProcessor methods.
Definition thread.hh:147
This interface class must be implemented by classes which have threads waiting for messages.
Definition thread.hh:308
DRAMA 2 main include file.
#define DramaTHROW_S(status_, format_,...)
Throw a Drama exception with safe string formatting.
Definition exception.hh:110
std::shared_ptr< Id > IdPtr
A shared pointer for sds::Id items.
Definition sds.hh:3318
void CreateRunDramaTask()
Create and run a DRAMA task, with standard exception handling.
Definition task.hh:1322
std::chrono::steady_clock::time_point CreateFutureTimepoint(double secs)
Return a steady_clock time point suitable for use with the Path::...WaitUntil() methods based on an o...
Definition path.hh:94
@ Kick
Action has been kicked.
@ BulkTransferred
bulk data transferred message received
@ BulkDone
message received
@ Obey
Action has been obeyed.
std::vector< ErsMessageType > ErsMessageVector
A type used to return ERS messages.
Definition path.hh:180
The drama namespace contains all the classes, types etc of the DRAMA 2 implementation.
Definition drama.hh:93
StatusType entryStatus
Entry status value.
Definition task.hh:130
bool complete
IS transaction complete.
Definition task.hh:133
Structure is used to store details about a DRAMA reschedule message relating to a transaction,...
Definition task.hh:128
DRAMA 2 include file - Code common to DRAMA 2 features supporting threading.