Nymph
v1.5.2
Flow-Based Data Processing Framework
|
Manages processors requested by the user at run time. More...
#include <KTProcessorToolbox.hh>
Classes | |
struct | CompareThread |
struct | ProcessorInfo |
struct | Thread |
Public Member Functions | |
KTProcessorToolbox (const std::string &name="processor-toolbox") | |
virtual | ~KTProcessorToolbox () |
bool | Configure (const scarab::param_node &node) |
Configure the toolbox: create the processors; connnect signals and slots; and setup the run queue. More... | |
bool | ConfigureProcessors (const scarab::param_node &node) |
Configure processors (only those specified in the toolbox) More... | |
bool | ConfigureProcessors (const std::string &config) |
Configure processors from a json-encoding of their configurations. More... | |
bool | Run () |
KTProcessor * | GetProcessor (const std::string &procName) |
Get a pointer to a processor in the toolbox. More... | |
const KTProcessor * | GetProcessor (const std::string &procName) const |
Get a pointer to a processor in the toolbox. More... | |
bool | AddProcessor (const std::string &procName, KTProcessor *proc) |
bool | AddProcessor (const std::string &procType, const std::string &procName) |
bool | RemoveProcessor (const std::string &procName) |
Remove a processor from the toolbox. More... | |
KTProcessor * | ReleaseProcessor (const std::string &procName) |
void | ClearProcessors () |
bool | MakeConnection (const std::string &signal, const std::string &slot, int order=std::numeric_limits< int >::min()) |
bool | MakeConnection (const std::string &signalProcName, const std::string &signalName, const std::string &slotProcName, const std::string &slotName, int order=std::numeric_limits< int >::min()) |
bool | PushBackToRunQueue (const std::string &name) |
Push a single processor to the back of the run queue. More... | |
bool | PushBackToRunQueue (std::initializer_list< std::string > names) |
Push a set of processors to be run in parallel to the back of the run queue. More... | |
bool | PushBackToRunQueue (std::vector< std::string > names) |
Push a set of processors to be run in parallel to the back of the run queue. More... | |
void | PopBackOfRunQueue () |
Remove the last item in the run queue, whether it's a single processor or a group of processors. More... | |
void | ClearRunQueue () |
Clear the run queue. More... | |
![]() | |
KTConfigurable (const std::string &name="default-name") | |
virtual | ~KTConfigurable () |
bool | Configure (const std::string &config) |
Implement the option for calling Configure without passing a parameter store node. More... | |
const std::string & | GetConfigName () const |
void | SetConfigName (const std::string &name) |
Private Types | |
typedef std::map< std::string, ProcessorInfo > | ProcessorMap |
typedef ProcessorMap::iterator | ProcMapIt |
typedef ProcessorMap::const_iterator | ProcMapCIt |
typedef ProcessorMap::value_type | ProcMapValue |
typedef std::set< Thread, CompareThread > | ThreadGroup |
typedef std::deque< ThreadGroup > | RunQueue |
Private Member Functions | |
bool | ParseSignalSlotName (const std::string &toParse, std::string &nameOfProc, std::string &nameOfSigSlot) const |
bool | AddProcessorToThreadGroup (const std::string &name, ThreadGroup &group) |
Private Attributes | |
ProcessorMap | fProcMap |
RunQueue | fRunQueue |
Static Private Attributes | |
static const char | fSigSlotNameSep = ':' |
Additional Inherited Members | |
![]() | |
KTCommandLineHandler * | fCLHandler |
std::string | fConfigName |
Manages processors requested by the user at run time.
KTProcessorToolbox allows the user to setup an application at runtime.
The user chooses the processors to be used, how they're linked with signals and slots, and what is used to "run" the program via a configuration file.
While this does result in longer configuration files, it drastically simplifies the space of executables that are needed.
The following order should be used for configuring the processor toolbox:
Available (nested) configuration values:
Definition at line 71 of file KTProcessorToolbox.hh.
|
private |
Definition at line 98 of file KTProcessorToolbox.hh.
|
private |
Definition at line 100 of file KTProcessorToolbox.hh.
|
private |
Definition at line 99 of file KTProcessorToolbox.hh.
|
private |
Definition at line 101 of file KTProcessorToolbox.hh.
|
private |
Definition at line 176 of file KTProcessorToolbox.hh.
|
private |
Definition at line 175 of file KTProcessorToolbox.hh.
KTProcessorToolbox | ( | const std::string & | name = "processor-toolbox" | ) |
Definition at line 31 of file KTProcessorToolbox.cc.
|
virtual |
Definition at line 38 of file KTProcessorToolbox.cc.
bool AddProcessor | ( | const std::string & | procName, |
KTProcessor * | proc | ||
) |
Add a processor to the toolbox Toolbox takes ownership of the processor
Definition at line 321 of file KTProcessorToolbox.cc.
bool AddProcessor | ( | const std::string & | procType, |
const std::string & | procName | ||
) |
Definition at line 336 of file KTProcessorToolbox.cc.
|
private |
Definition at line 513 of file KTProcessorToolbox.cc.
void ClearProcessors | ( | ) |
Remove all processors from the toolbox Also clears the run queue
Definition at line 386 of file KTProcessorToolbox.cc.
|
inline |
Clear the run queue.
Definition at line 189 of file KTProcessorToolbox.hh.
|
virtual |
Configure the toolbox: create the processors; connnect signals and slots; and setup the run queue.
Implements KTConfigurable.
Definition at line 43 of file KTProcessorToolbox.cc.
bool ConfigureProcessors | ( | const scarab::param_node & | node | ) |
Configure processors (only those specified in the toolbox)
Definition at line 212 of file KTProcessorToolbox.cc.
bool ConfigureProcessors | ( | const std::string & | config | ) |
Configure processors from a json-encoding of their configurations.
Definition at line 252 of file KTProcessorToolbox.cc.
KTProcessor * GetProcessor | ( | const std::string & | procName | ) |
Get a pointer to a processor in the toolbox.
Definition at line 299 of file KTProcessorToolbox.cc.
const KTProcessor * GetProcessor | ( | const std::string & | procName | ) | const |
Get a pointer to a processor in the toolbox.
Definition at line 310 of file KTProcessorToolbox.cc.
bool MakeConnection | ( | const std::string & | signal, |
const std::string & | slot, | ||
int | order = std::numeric_limits< int >::min() |
||
) |
Make a connection between the signal from one processor and the slot from another processor Both processors should already have been added to the Toolbox Signal and slot strings should be formatted as: [processor name]:[signal/slot name]
Definition at line 398 of file KTProcessorToolbox.cc.
bool MakeConnection | ( | const std::string & | signalProcName, |
const std::string & | signalName, | ||
const std::string & | slotProcName, | ||
const std::string & | slotName, | ||
int | order = std::numeric_limits< int >::min() |
||
) |
Make a connection between the signal from one processor and the slot from another processor Both processors should already have been added to the Toolbox
Definition at line 417 of file KTProcessorToolbox.cc.
|
private |
Definition at line 456 of file KTProcessorToolbox.cc.
|
inline |
Remove the last item in the run queue, whether it's a single processor or a group of processors.
Definition at line 183 of file KTProcessorToolbox.hh.
bool PushBackToRunQueue | ( | const std::string & | name | ) |
Push a single processor to the back of the run queue.
Definition at line 470 of file KTProcessorToolbox.cc.
bool PushBackToRunQueue | ( | std::initializer_list< std::string > | names | ) |
Push a set of processors to be run in parallel to the back of the run queue.
bool PushBackToRunQueue | ( | std::vector< std::string > | names | ) |
Push a set of processors to be run in parallel to the back of the run queue.
Definition at line 491 of file KTProcessorToolbox.cc.
KTProcessor * ReleaseProcessor | ( | const std::string & | procName | ) |
Remove a processor from the toolbox and return it to the user Ownership is passed to the user
Definition at line 373 of file KTProcessorToolbox.cc.
bool RemoveProcessor | ( | const std::string & | procName | ) |
Remove a processor from the toolbox.
Definition at line 361 of file KTProcessorToolbox.cc.
bool Run | ( | ) |
Process the run queue. This will call Run() on all of the processors in the queue.
Definition at line 260 of file KTProcessorToolbox.cc.
|
private |
Definition at line 126 of file KTProcessorToolbox.hh.
|
private |
Definition at line 179 of file KTProcessorToolbox.hh.
|
staticprivate |
Definition at line 141 of file KTProcessorToolbox.hh.