Falcon
Loading...
Searching...
No Matches
commands::CommandHandler Class Reference

Public Member Functions

 CommandHandler (GlobalContext &context)
void addSource (CommandSource &source)
bool HandleCommand (std::deque< std::string > &command, std::deque< std::string > &reply)
bool DelegateGraphCommand (std::deque< std::string > &command, std::deque< std::string > &reply)
bool DelegateResourcesCommand (std::deque< std::string > &command, std::deque< std::string > &reply)
void start ()

Member Function Documentation

◆ addSource()

void commands::CommandHandler::addSource ( CommandSource & source)
inline

Add a source to receive commands from it (example: cloud/zmq, command line, keyboard)

Parameters
sourceclass defining the source of commands derived from CommandSource

◆ DelegateGraphCommand()

bool CommandHandler::DelegateGraphCommand ( std::deque< std::string > & command,
std::deque< std::string > & reply )

Send commands to the graph thread via it graph socket

Parameters
commandkeyword send to the graph thread
replybuffer for the answer from the graph socket
Returns
always false - no command to the graph can terminate the main thread

◆ DelegateResourcesCommand()

bool CommandHandler::DelegateResourcesCommand ( std::deque< std::string > & command,
std::deque< std::string > & reply )

Manage sub-command for the resources command

Parameters
sub-commandkeyword
replybuffer for the answer from the graph socket
Returns
always false - no resources command can terminate the main thread

◆ HandleCommand()

bool CommandHandler::HandleCommand ( std::deque< std::string > & command,
std::deque< std::string > & reply )

Receive commands and delegate to the graph thread in case of a graph command or handle it directly

Parameters
command
replybuffer for the answer from the graph socket
Returns
if falcon should be safely (closing all threads) terminated

◆ start()

void CommandHandler::start ( )

Once start is launched the main thread is busy only listening, processing and replying to messages coming from listed sources


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