Horizon Official Technical Documentation
Horizon::System::RuntimeContext Class Reference

#include <System.hpp>

+ Inheritance diagram for Horizon::System::RuntimeContext:
+ Collaboration diagram for Horizon::System::RuntimeContext:

Classes

class  ResultContext
 
class  WorkContext
 
class  WorkControlAgent
 
class  WorkQueueManager
 

Public Member Functions

 RuntimeContext (SystemRoutineManager &hsr_manager, runtime_synchronization_method sync_t=RUNTIME_SYNC_NONE)
 
std::shared_ptr< WorkContextpop ()
 
void push (std::shared_ptr< WorkContext > context)
 
virtual bool run ()
 
WorkQueueManagerget_queue_manager ()
 
WorkControlAgentget_control_agent ()
 
SystemRoutineManagerget_routine_manager ()
 
std::string get_uuid_string ()
 
void set_context_result (runtime_context_result pass=RUNTIME_CONTEXT_NO_STATE)
 
runtime_context_result get_context_result ()
 
void set_context_state (runtime_context_state state=RUNTIME_CONTEXT_STATE_INACTIVE)
 
runtime_context_state get_context_state ()
 
void set_synchronization_method (runtime_synchronization_method sync)
 
runtime_synchronization_method get_synchronization_method ()
 
void dispatch ()
 

Protected Attributes

SystemRoutineManager_hsr_manager
 
WorkControlAgent _control_agent
 
WorkQueueManager _queue_manager
 
boost::uuids::uuid _uuid
 
std::atomic< enum runtime_context_result_result {RUNTIME_CONTEXT_NO_STATE}
 
runtime_synchronization_method _synchronization_t {RUNTIME_SYNC_NONE}
 
std::atomic< enum runtime_context_state_context_state_t {RUNTIME_CONTEXT_STATE_INACTIVE}
 

Constructor & Destructor Documentation

◆ RuntimeContext()

Horizon::System::RuntimeContext::RuntimeContext ( SystemRoutineManager hsr_manager,
runtime_synchronization_method  sync_t = RUNTIME_SYNC_NONE 
)
inline
124 : _hsr_manager(hsr_manager), _synchronization_t(sync_t), _uuid(boost::uuids::random_generator()()), _queue_manager(_control_agent)
125 { }
runtime_synchronization_method _synchronization_t
Definition: System.hpp:336
SystemRoutineManager & _hsr_manager
Definition: System.hpp:331
WorkControlAgent _control_agent
Definition: System.hpp:332
WorkQueueManager _queue_manager
Definition: System.hpp:333
boost::uuids::uuid _uuid
Definition: System.hpp:334

Member Function Documentation

◆ dispatch()

void Horizon::System::RuntimeContext::dispatch ( )
48{ _hsr_manager.push(shared_from_this()); }
void push(std::shared_ptr< RuntimeContextChain > chain)
Definition: System.hpp:644

◆ get_context_result()

runtime_context_result Horizon::System::RuntimeContext::get_context_result ( )
inline
317{ return _result.load(); }
std::atomic< enum runtime_context_result > _result
Definition: System.hpp:335

References _result.

◆ get_context_state()

runtime_context_state Horizon::System::RuntimeContext::get_context_state ( )
inline
323{ return _context_state_t.load(); }
std::atomic< enum runtime_context_state > _context_state_t
Definition: System.hpp:337

References _context_state_t.

◆ get_control_agent()

WorkControlAgent & Horizon::System::RuntimeContext::get_control_agent ( )
inline
307{ return _control_agent; }

References _control_agent.

◆ get_queue_manager()

WorkQueueManager & Horizon::System::RuntimeContext::get_queue_manager ( )
inline
306{ return _queue_manager; }

References _queue_manager.

◆ get_routine_manager()

SystemRoutineManager & Horizon::System::RuntimeContext::get_routine_manager ( )
inline
309{ return _hsr_manager; }

References _hsr_manager.

◆ get_synchronization_method()

runtime_synchronization_method Horizon::System::RuntimeContext::get_synchronization_method ( )
inline
326{ return _synchronization_t; }

References _synchronization_t.

◆ get_uuid_string()

std::string Horizon::System::RuntimeContext::get_uuid_string ( )
inline
311{ return boost::uuids::to_string(_uuid); }

References _uuid.

Referenced by Horizon::System::RuntimeRoutineContext::error_message(), Horizon::System::RuntimeRoutineContext::status_message(), and Horizon::System::RuntimeRoutineContext::warning_message().

+ Here is the caller graph for this function:

◆ pop()

std::shared_ptr< WorkContext > Horizon::System::RuntimeContext::pop ( )
inline
290{ return _queue_manager.pop(); }
std::shared_ptr< WorkContext > pop()
Definition: System.hpp:233

References _queue_manager, and Horizon::System::RuntimeContext::WorkQueueManager::pop().

+ Here is the call graph for this function:

◆ push()

void Horizon::System::RuntimeContext::push ( std::shared_ptr< WorkContext context)
inline
291{ _queue_manager.push(context); }
void push(std::shared_ptr< WorkContext > seg)
Definition: System.hpp:232

References _queue_manager, and Horizon::System::RuntimeContext::WorkQueueManager::push().

+ Here is the call graph for this function:

◆ run()

virtual bool Horizon::System::RuntimeContext::run ( )
inlinevirtual
294 {
296
297 if (_queue_manager.process()) {
299 return true;
300 }
301
303 return false;
304 }
bool process()
Definition: System.hpp:243
void set_context_state(runtime_context_state state=RUNTIME_CONTEXT_STATE_INACTIVE)
Definition: System.hpp:319
void set_context_result(runtime_context_result pass=RUNTIME_CONTEXT_NO_STATE)
Definition: System.hpp:313
@ RUNTIME_CONTEXT_FAIL
Definition: System.hpp:108
@ RUNTIME_CONTEXT_PASS
Definition: System.hpp:109
@ RUNTIME_CONTEXT_STATE_ACTIVE
Definition: System.hpp:115

References _queue_manager, Horizon::System::RuntimeContext::WorkQueueManager::process(), Horizon::System::RUNTIME_CONTEXT_FAIL, Horizon::System::RUNTIME_CONTEXT_PASS, Horizon::System::RUNTIME_CONTEXT_STATE_ACTIVE, set_context_result(), and set_context_state().

+ Here is the call graph for this function:

◆ set_context_result()

void Horizon::System::RuntimeContext::set_context_result ( runtime_context_result  pass = RUNTIME_CONTEXT_NO_STATE)
inline
314 {
315 _result = pass;
316 }

References _result.

Referenced by run().

+ Here is the caller graph for this function:

◆ set_context_state()

void Horizon::System::RuntimeContext::set_context_state ( runtime_context_state  state = RUNTIME_CONTEXT_STATE_INACTIVE)
inline
320 {
321 _context_state_t = state;
322 }

References _context_state_t.

Referenced by run().

+ Here is the caller graph for this function:

◆ set_synchronization_method()

void Horizon::System::RuntimeContext::set_synchronization_method ( runtime_synchronization_method  sync)
inline
325{ _synchronization_t = sync; }

References _synchronization_t.

Member Data Documentation

◆ _context_state_t

std::atomic<enum runtime_context_state> Horizon::System::RuntimeContext::_context_state_t {RUNTIME_CONTEXT_STATE_INACTIVE}
protected

◆ _control_agent

WorkControlAgent Horizon::System::RuntimeContext::_control_agent
protected

Referenced by get_control_agent().

◆ _hsr_manager

SystemRoutineManager& Horizon::System::RuntimeContext::_hsr_manager
protected

Referenced by get_routine_manager().

◆ _queue_manager

WorkQueueManager Horizon::System::RuntimeContext::_queue_manager
protected

Referenced by get_queue_manager(), pop(), push(), and run().

◆ _result

std::atomic<enum runtime_context_result> Horizon::System::RuntimeContext::_result {RUNTIME_CONTEXT_NO_STATE}
protected

◆ _synchronization_t

runtime_synchronization_method Horizon::System::RuntimeContext::_synchronization_t {RUNTIME_SYNC_NONE}
protected

◆ _uuid

boost::uuids::uuid Horizon::System::RuntimeContext::_uuid
protected

Referenced by get_uuid_string().


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