Class CommandHandler

Class Documentation

class CommandHandler

Public Functions

inline CommandHandler(GlobalContext &context)
inline void addSource(CommandSource &source)

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

Parameters

source – class defining the source of commands derived from CommandSource

bool 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

  • reply – buffer for the answer from the graph socket

Returns

if falcon should be safely (closing all threads) terminated

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

Send commands to the graph thread via it graph socket

Parameters
  • command – keyword send to the graph thread

  • reply – buffer for the answer from the graph socket

Returns

always false - no command to the graph can terminate the main thread

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

Manage sub-command for the resources command

Parameters
  • sub-command – keyword

  • reply – buffer for the answer from the graph socket

Returns

always false - no resources command can terminate the main thread

void start()

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