Horizon Official Technical Documentation
Horizon::System::RuntimeRoutineContext::Work Class Reference

#include <System.hpp>

+ Inheritance diagram for Horizon::System::RuntimeRoutineContext::Work:
+ Collaboration diagram for Horizon::System::RuntimeRoutineContext::Work:

Classes

class  MessageAgent
 

Public Member Functions

 Work (std::shared_ptr< RuntimeRoutineContext > runtime_context)
 
 ~Work ()
 
virtual bool execute ()
 
std::shared_ptr< RuntimeRoutineContextget_runtime_context ()
 
void set_runtime_context (std::shared_ptr< RuntimeRoutineContext > runtime_context)
 
MessageAgentget_message_agent ()
 
- Public Member Functions inherited from Horizon::System::RuntimeContext::WorkContext
 WorkContext ()
 
virtual bool execute ()
 
std::string get_uuid_string ()
 

Protected Attributes

std::weak_ptr< RuntimeRoutineContext_runtime_context
 
MessageAgent _message_agent
 

Additional Inherited Members

- Public Attributes inherited from Horizon::System::RuntimeContext::WorkContext
boost::uuids::uuid _uuid
 

Constructor & Destructor Documentation

◆ Work()

Horizon::System::RuntimeRoutineContext::Work::Work ( std::shared_ptr< RuntimeRoutineContext runtime_context)
inline
403 : _runtime_context(runtime_context), _message_agent(runtime_context, this) { }
MessageAgent _message_agent
Definition: System.hpp:458
std::weak_ptr< RuntimeRoutineContext > _runtime_context
Definition: System.hpp:457

◆ ~Work()

Horizon::System::RuntimeRoutineContext::Work::~Work ( )
inline
404{ }

Member Function Documentation

◆ execute()

virtual bool Horizon::System::RuntimeRoutineContext::Work::execute ( )
inlinevirtual

Reimplemented from Horizon::System::RuntimeContext::WorkContext.

Reimplemented in TestWork, and TestWorkWithUseResult.

407 {
408 std::cerr << "Nothing to execute." << std::endl;
409 return true;
410 }

◆ get_message_agent()

MessageAgent & Horizon::System::RuntimeRoutineContext::Work::get_message_agent ( )
inline
455{ return _message_agent; }

References _message_agent.

◆ get_runtime_context()

std::shared_ptr< RuntimeRoutineContext > Horizon::System::RuntimeRoutineContext::Work::get_runtime_context ( )
inline
412{ return !_runtime_context.expired() ? _runtime_context.lock() : nullptr; }

References _runtime_context.

Referenced by TestWork::execute(), TestWorkWithUseResult::execute(), TestWork::has_result(), and TestWorkWithUseResult::has_result().

+ Here is the caller graph for this function:

◆ set_runtime_context()

void Horizon::System::RuntimeRoutineContext::Work::set_runtime_context ( std::shared_ptr< RuntimeRoutineContext runtime_context)
inline
413{ _runtime_context = runtime_context; }

References _runtime_context.

Member Data Documentation

◆ _message_agent

MessageAgent Horizon::System::RuntimeRoutineContext::Work::_message_agent
protected

Referenced by get_message_agent().

◆ _runtime_context

std::weak_ptr<RuntimeRoutineContext> Horizon::System::RuntimeRoutineContext::Work::_runtime_context
protected

The documentation for this class was generated from the following file: