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 =
"");
974 const std::string &name,
975 const std::string &
host =
"",
976 const std::string &
file =
"");
1053 const std::string &
GetHost()
const {
return (_taskLocation); }
1058 const std::string &
GetArgument()
const {
return (_argument); };
1076 virtual void SetName(
const std::string &TaskName);
1123 this->_buffers =
buffs;
1167 bool const Append=
false);
1263 _state = PathState::INITIAL;
1271 virtual bool Active()
const {
1272 return ((_state == PathState::ACTIVE)||
1273 (_state == PathState::SELFINIT));
1279 virtual bool IsDead()
const {
1280 return (_state == PathState::DIED);
1286 virtual bool Initial()
const {
1287 return ((_state == PathState::INITIAL)||
1288 (_state == PathState::DIED));
1297 virtual bool Busy()
const {
1298 return ((_state == PathState::PATHWAIT) ||
1299 (_state == PathState::LOADING) ||
1300 (_state == PathState::NOTIFY));
1307 virtual std::shared_ptr<Task>
GetTask()
const {
1308 return std::shared_ptr<Task>(_theTask);
1333 thread::TransEvtProcessor *
const eventProcessor = &_getPathEventProcessor );
1370 thread::TransEvtProcessor *
const eventProcessor = &_getPathEventProcessor );
1390 const std::string &name,
1396 fprintf(
stderr,
"!!!OBey - sending action %s\n", name.c_str());
1404 action->WaitForTransaction(_theTask,
1421 "Obey of message {0} to task {1}, returned but not complete",
1437 return std::chrono::steady_clock::now() + std::chrono::seconds(
secs);
1471 thread::TMessHandler *
action,
1472 const std::string &name,
1475 MessageEventHandler *
const eventProcessor = &_simpleEventProcessor) {
1479 TransEvtInfo eventInfo;
1480 bool ok =
action->WaitForTransactionUntil(
1485 if (!
ok)
return false;
1495 if (eventInfo.complete == 0)
1498 eventInfo.entryStatus,
1499 "Obey of action {0} to task {1}, returned but not complete",
1538 const std::string &name,
1543 MessageEventHandler *
const eventProcessor = &_simpleEventProcessor) {
1546 fprintf(
stderr,
"!!!OBeyBulk - sending action %s\n", name.c_str());
1554 TransEvtInfo eventInfo;
1555 action->WaitForTransaction(_theTask,
1568 if (eventInfo.complete == 0)
1571 eventInfo.entryStatus,
1572 "ObeyBulk of message {0} to task {1}, returned but not complete",
1605 const std::string &name,
1609 MessageEventHandler *
const eventProcessor = &_simpleEventProcessor) {
1664 thread::TMessHandler *
action,
1665 const std::string &name,
1670 MessageEventHandler *
const eventProcessor = &_simpleEventProcessor) {
1675 TransEvtInfo eventInfo;
1676 bool ok =
action->WaitForTransactionUntil(
1681 if (!
ok)
return false;
1691 if (eventInfo.complete == 0)
1694 eventInfo.entryStatus,
1695 "Obey of action {0} to task {1}, returned but not complete",
1744 thread::TMessHandler *
action,
1745 const std::string &name,
1749 MessageEventHandler *
const eventProcessor = &_simpleEventProcessor) {
1775 const std::string &name,
1778 MessageEventHandler *
const eventProcessor = &_simpleEventProcessor) {
1782 TransEvtInfo eventInfo;
1783 action->WaitForTransaction(_theTask,
1794 if (eventInfo.complete == 0)
1797 eventInfo.entryStatus,
1798 "Kick of action {0} in task {1}, returned but not complete",
1836 const std::string &name,
1844 bool ok =
action->WaitForTransactionUntil(
1849 if (!
ok)
return false;
1863 "Kick of action {0} in task {1}, returned but not complete",
1903 const std::string &name,
1908 MessageEventHandler *
const eventProcessor = &_simpleEventProcessor) {
1913 TransEvtInfo eventInfo;
1914 action->WaitForTransaction(_theTask,
1925 if (eventInfo.complete == 0)
1928 eventInfo.entryStatus,
1929 "Kick of action {0} in task {1}, returned but not complete",
1962 const std::string &name,
1966 MessageEventHandler *
const eventProcessor = &_simpleEventProcessor) {
2018 thread::TMessHandler *
action,
2019 const std::string &name,
2024 MessageEventHandler *
const eventProcessor = &_simpleEventProcessor) {
2029 TransEvtInfo eventInfo;
2030 bool ok =
action->WaitForTransactionUntil(
2035 if (!
ok)
return false;
2045 if (eventInfo.complete == 0)
2048 eventInfo.entryStatus,
2049 "Kick of action {0} in task {1}, returned but not complete",
2096 thread::TMessHandler *
action,
2097 const std::string &name,
2101 MessageEventHandler *
const eventProcessor = &_simpleEventProcessor) {
2120 const std::string &name,
2121 const sds::Id &
argIn,
2127 action->WaitForTransaction(_theTask,
2141 "Set of parameter {0} in task {1}, returned but not complete",
2173 const std::string &name,
2180 bool ok =
action->WaitForTransactionUntil(
2185 if (!
ok)
return false;
2199 "Set of parameter {0} in task {1}, returned but did not complete",
2220 const std::string &name,
2222 MessageEventHandler *
const eventProcessor = &_simpleEventProcessor) {
2227 TransEvtInfo eventInfo;
2228 action->WaitForTransaction(_theTask,
2239 if (eventInfo.complete == 0)
2242 eventInfo.entryStatus,
2243 "Get of parameter {0} from task {1}, returned but not complete",
2263 const std::initializer_list<std::string>
names,
2272 action->WaitForTransaction(_theTask,
2286 "Get of parameters from task {0}, returned but not complete",
2322 const std::string &name,
2330 bool ok =
action->WaitForTransactionUntil(
2334 if (!
ok)
return false;
2348 "Get of parameter {0} from task {1}, returned but not complete",
2381 thread::TMessHandler *
action,
2382 const std::initializer_list<std::string>
names,
2384 MessageEventHandler *
const eventProcessor = &_simpleEventProcessor) {
2390 TransEvtInfo eventInfo;
2391 bool ok =
action->WaitForTransactionUntil(
2395 if (!
ok)
return false;
2405 if (eventInfo.complete == 0)
2408 eventInfo.entryStatus,
2409 "Get of parameters from task {0}, returned but not complete",
2436 const std::string &name,
2439 MessageEventHandler *
const eventProcessor = &_simpleEventProcessor) {
2444 TransEvtInfo eventInfo;
2445 action->WaitForTransaction(_theTask,
2456 if (eventInfo.complete == 0)
2459 eventInfo.entryStatus,
2460 "Control message {0} to task {1}, returned but did not complete",
2497 thread::TMessHandler *
action,
2498 const std::string &name,
2501 MessageEventHandler *
const eventProcessor = &_simpleEventProcessor) {
2506 TransEvtInfo eventInfo;
2507 bool ok =
action->WaitForTransactionUntil(
2512 if (!
ok)
return false;
2522 if (eventInfo.complete == 0)
2525 eventInfo.entryStatus,
2526 "Control message {0} to task {1}, returned but not complete",
2550 virtual void Died() {
2552 _state = PathState::DIED;
2604 action->WaitForTransaction(_theTask,
2619 "Monitor START to task {0}, returned but did not complete",
2644 const sds::Id &
argIn,
2645 MessageEventHandler *
const eventProcessor = &_simpleMonEventProcessor) {
2650 TransEvtInfo eventInfo;
2651 action->WaitForTransaction(_theTask,
2661 if (eventInfo.complete == 0)
2664 eventInfo.entryStatus,
2665 "Monitor FORWARD to task {0}, returned but not complete",
2689 const std::string &
task,
2690 const std::string
action,
2691 std::initializer_list<std::string>
pars,
2725 template <
typename ContainerType>
2727 const std::string &
task,
2728 const std::string
action,
2733 std::is_convertible<typename ContainerType::value_type,std::string>::value,
2734 "The container value type must be convertible to a std::string");
2758 MessageEventHandler *
const eventProcessor = &_simpleEventProcessor) {
2764 TransEvtInfo eventInfo;
2765 action->WaitForTransaction(_theTask,
2775 if (eventInfo.complete == 0)
2778 eventInfo.entryStatus,
2779 "Monitor CANCEL to task {0}, 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:1801
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:1929
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:2753
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:2621
virtual void SetFlowControl()
Set the FLOW control flag.
Definition path.hh:1157
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:1564
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:1690
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:2289
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:2715
const std::string & GetArgument() const
Fetch the load argument.
Definition path.hh:1085
const std::string & GetHost() const
Fetch the task host name.
Definition path.hh:1080
virtual void SetBuffers(const Buffers &buffs)
Set the DRAMA path buffers.
Definition path.hh:1149
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:2146
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:1861
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:2347
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:2198
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:2246
virtual bool Active() const
Indicate if a task is active.
Definition path.hh:1298
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:1631
virtual void Died()
Note that a task has died.
Definition path.hh:2577
bool GetPathLoaded() const
Indicate if a the task was loaded.
Definition path.hh:1061
virtual void ClearState()
Clear the task state.
Definition path.hh:1289
virtual void SetSymbols(const bool Flag=true)
Interpert file name as a symbol (VMS Target only)
Definition path.hh:1243
virtual bool Busy() const
Returns true if we can't send a message because path is busy.
Definition path.hh:1324
virtual bool Initial() const
Return true if a GetPath operation is required.
Definition path.hh:1313
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:2122
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:2044
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:2407
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:2523
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:1988
virtual void SetFile(const std::string &File)
Set the executable file name.
Definition path.hh:1138
virtual std::shared_ptr< Task > GetTask() const
Get a reference to the DRAMA task we are part of.
Definition path.hh:1334
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:1416
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:1770
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:1266
virtual void SetNames(const bool Flag=true)
Insist that symbols known to IMP_Master be known to the task.
Definition path.hh:1225
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:1463
virtual bool IsDead() const
Return true if a previously active task has disconnected.
Definition path.hh:1306
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:2462
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:1280
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:2783
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:2670
const std::string GetTaskName() const
Fetch the task name.
Path()
Construct a null object.
Definition path.hh:1040
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:1497
virtual void SetHost(const std::string &Host)
Set the task host name.
Definition path.hh:1111
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:471
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:3049
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_F(status_, format_,...)
Throw a Drama exception with fmt::format string formatting.
Definition exception.hh:129
std::shared_ptr< Id > IdPtr
A shared pointer for sds::Id items.
Definition sds.hh:3613
void CreateRunDramaTask()
Create and run a DRAMA task, with standard exception handling.
Definition task.hh:1339
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:99
StatusType entryStatus
Entry status value.
Definition task.hh:136
bool complete
IS transaction complete.
Definition task.hh:139
Structure is used to store details about a DRAMA reschedule message relating to a transaction,...
Definition task.hh:134
DRAMA 2 include file - Code common to DRAMA 2 features supporting threading.