mt4cpp
Public Member Functions | List of all members
mt4cpp::Scheduler Class Reference

#include <Scheduler.hpp>

Inheritance diagram for mt4cpp::Scheduler:
Inheritance graph
Collaboration diagram for mt4cpp::Scheduler:
Collaboration graph

Public Member Functions

 Scheduler (int)
 
CommandID executeAsynchronously (PCommand cmd)
 
CommandID executeSynchronously (PCommand cmd)
 
void join ()
 
void finishAndJoin ()
 

Detailed Description

Sheduler, the execution queue with and thread pool. it executes commands (synchronically or asynchronically)

Member Function Documentation

CommandID mt4cpp::Scheduler::executeAsynchronously ( PCommand  cmd)
inline

Executes the command in one of threads from threads pool. Do not break execution of the calling thread.

Returns
CommandId of command

asynchronically executes the command. Do not break execution of the calling thread.

References mt4cpp::CommandQueue::write().

Referenced by executeSynchronously().

CommandID mt4cpp::Scheduler::executeSynchronously ( PCommand  cmd)
inline

Executes the command in one of threads from threads pool. Command is inserted into command queue, it waits till free working thread is found, then it is executed. The calling thread waits (on condition variable) till the command is finished.

Returns
CommandId of command.

asynchronically executes the command. Command is inserted into command queue, it waits till free working thread is found, then it is executed. The calling thread waits (on condition variable) untill the command is not finished.

References executeAsynchronously().

void mt4cpp::Scheduler::join ( )
inline

wait for ending threads in pool

Referenced by finishAndJoin().

void mt4cpp::Scheduler::finishAndJoin ( )
inline

signal to finish all threads after current command and wait for ending threads in pool

signal to finish all threads after current command, and wait for endint the threads in pool

References join(), and mt4cpp::CommandQueue::setQuitFlag().


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