Runs a set of operaions with dependency relationships. More...
#include <OperationProcessor.h>
Classes | |
struct | busy_t |
struct | execution_time_t |
struct | label_t |
struct | ltvertexinfo |
struct | not_permanent |
struct | operation_t |
class | OperationVertex |
struct | permanent_t |
class | ThreadContext |
struct | vertex_info |
class | Worker |
Public Member Functions | |
OperationProcessor (ContextPtr &context, size_t thread_count) | |
~OperationProcessor () | |
void | add_operation (OperationPtr operation) |
void | add_operations (std::vector< OperationPtr > &operations) |
OperationPtr | remove_operation (int64_t hash_code) |
void | shutdown () |
void | join () |
void | wait_for_empty () |
void | wait_for_idle () |
bool | wait_for_idle (std::chrono::milliseconds max_wait) |
void | graphviz_output (String &output) |
size_t | size () |
bool | empty () |
void | wake_up () |
void | unblock (const String &name) |
void | activate (const String &name) |
void | state_description (String &output) |
Private Types | |
typedef boost::adjacency_list < boost::listS, boost::listS, boost::bidirectionalS, boost::property < boost::vertex_index_t, std::size_t, boost::property < operation_t, OperationPtr, boost::property < execution_time_t, int, boost::property< label_t, String, boost::property < busy_t, bool > > > > >, boost::property < permanent_t, bool > > | OperationGraph |
typedef boost::graph_traits < OperationGraph > | GraphTraits |
typedef GraphTraits::vertex_descriptor | Vertex |
typedef GraphTraits::edge_descriptor | Edge |
typedef std::set< Vertex > | VertexSet |
typedef std::list< vertex_info > | ExecutionList |
typedef std::multimap< const String, Vertex > | DependencyIndex |
typedef std::set< OperationPtr > | PerpetualSet |
Private Member Functions | |
void | add_operation_internal (OperationPtr &operation) |
void | add_dependencies (Vertex v, OperationPtr &operation) |
void | add_exclusivity (Vertex v, const String &name) |
void | add_dependency (Vertex v, const String &name) |
void | add_obstruction (Vertex v, const String &name) |
void | purge_from_dependency_index (Vertex v) |
void | purge_from_exclusivity_index (Vertex v) |
void | purge_from_obstruction_index (Vertex v) |
void | add_edge (Vertex v, Vertex u) |
void | add_edge_permanent (Vertex v, Vertex u) |
void | retire_operation (Vertex v, OperationPtr &operation) |
Retires (remove) an operation. More... | |
void | update_operation (Vertex v, OperationPtr &operation) |
Updates dependency relationship of an operation. More... | |
void | recompute_order () |
Recomputes operation execution order. More... | |
bool | load_current () |
Loads m_context.current list with operations to be executed. More... | |
Private Attributes | |
ThreadContext | m_context |
ThreadGroup | m_threads |
std::unique_ptr< std::ofstream > | m_graphviz_out |
Runs a set of operaions with dependency relationships.
Definition at line 61 of file OperationProcessor.h.
|
private |
Definition at line 130 of file OperationProcessor.h.
|
private |
Definition at line 118 of file OperationProcessor.h.
|
private |
Definition at line 128 of file OperationProcessor.h.
|
private |
Definition at line 115 of file OperationProcessor.h.
|
private |
Definition at line 113 of file OperationProcessor.h.
|
private |
Definition at line 169 of file OperationProcessor.h.
|
private |
Definition at line 117 of file OperationProcessor.h.
|
private |
Definition at line 120 of file OperationProcessor.h.
OperationProcessor::OperationProcessor | ( | ContextPtr & | context, |
size_t | thread_count | ||
) |
Definition at line 61 of file OperationProcessor.cc.
OperationProcessor::~OperationProcessor | ( | ) |
Definition at line 78 of file OperationProcessor.cc.
void OperationProcessor::activate | ( | const String & | name | ) |
Definition at line 244 of file OperationProcessor.cc.
|
private |
Definition at line 376 of file OperationProcessor.cc.
Definition at line 439 of file OperationProcessor.cc.
Definition at line 554 of file OperationProcessor.cc.
Definition at line 560 of file OperationProcessor.cc.
Definition at line 396 of file OperationProcessor.cc.
Definition at line 482 of file OperationProcessor.cc.
void OperationProcessor::add_operation | ( | OperationPtr | operation | ) |
Definition at line 84 of file OperationProcessor.cc.
|
private |
Definition at line 131 of file OperationProcessor.cc.
void OperationProcessor::add_operations | ( | std::vector< OperationPtr > & | operations | ) |
Definition at line 104 of file OperationProcessor.cc.
bool OperationProcessor::empty | ( | ) |
Definition at line 211 of file OperationProcessor.cc.
void OperationProcessor::graphviz_output | ( | String & | output | ) |
Definition at line 566 of file OperationProcessor.cc.
void OperationProcessor::join | ( | ) |
Definition at line 178 of file OperationProcessor.cc.
|
private |
Loads m_context.current
list with operations to be executed.
m_context.mutex
must be locked when calling this method Definition at line 793 of file OperationProcessor.cc.
|
private |
Definition at line 506 of file OperationProcessor.cc.
|
private |
Definition at line 522 of file OperationProcessor.cc.
|
private |
Definition at line 538 of file OperationProcessor.cc.
|
private |
Recomputes operation execution order.
m_context.mutex
must be locked when calling this method Definition at line 725 of file OperationProcessor.cc.
OperationPtr OperationProcessor::remove_operation | ( | int64_t | hash_code | ) |
Definition at line 152 of file OperationProcessor.cc.
|
private |
Retires (remove) an operation.
v | Vertex of operation |
operation | Reference to operation smart pointer |
m_context.mutex
must be locked when calling this method Definition at line 671 of file OperationProcessor.cc.
void OperationProcessor::shutdown | ( | ) |
Definition at line 172 of file OperationProcessor.cc.
size_t OperationProcessor::size | ( | ) |
Definition at line 207 of file OperationProcessor.cc.
void OperationProcessor::state_description | ( | String & | output | ) |
Definition at line 573 of file OperationProcessor.cc.
void OperationProcessor::unblock | ( | const String & | name | ) |
Definition at line 221 of file OperationProcessor.cc.
|
private |
Updates dependency relationship of an operation.
m_context.mutex
must be locked when calling this method Definition at line 699 of file OperationProcessor.cc.
void OperationProcessor::wait_for_empty | ( | ) |
Definition at line 182 of file OperationProcessor.cc.
void OperationProcessor::wait_for_idle | ( | ) |
Definition at line 188 of file OperationProcessor.cc.
bool OperationProcessor::wait_for_idle | ( | std::chrono::milliseconds | max_wait | ) |
Definition at line 196 of file OperationProcessor.cc.
void OperationProcessor::wake_up | ( | ) |
Definition at line 215 of file OperationProcessor.cc.
|
private |
Definition at line 242 of file OperationProcessor.h.
|
private |
Definition at line 244 of file OperationProcessor.h.
|
private |
Definition at line 243 of file OperationProcessor.h.