cumbia-qtcontrols 1.x
Qt widgets on top of the cumbia C++ library
|
CuLinkControl stores a small set of objects to help create readers and writers. More...
#include <cucontext.h>
Public Member Functions | |
CuContext (Cumbia *cumbia, const CuControlsReaderFactoryI &r_factory) | |
CuContext (Cumbia *cumbia, const CuControlsWriterFactoryI &w_factory) | |
CuContext (CumbiaPool *cumbia_pool, const CuControlsFactoryPool &fpool) | |
virtual | ~CuContext () |
bool | isAuto () const |
CuControlsReaderA * | replace_reader (const std::string &s, CuDataListener *datal) |
CuControlsWriterA * | replace_writer (const std::string &s, CuDataListener *datal) |
CuControlsReaderA * | add_reader (const std::string &s, CuDataListener *datal) |
CuControlsWriterA * | add_writer (const std::string &s, CuDataListener *datal) |
CuControlsPropertyReaderA * | get_property_reader (const std::string &s, CuDataListener *datal) |
void | disposeReader (const std::string &src=std::string()) |
void | disposeWriter (const std::string &src=std::string()) |
void | setOptions (const CuData &options) |
void | sendData (const CuData &data) |
Send options bundle to the link, if active, and save them locally. More... | |
void | sendData (const QList< CuData > &data) |
void | getData (CuData &d_inout) |
Send to the link a bundle with input arguments (keys) and get back the same bundle with values, if applicable. More... | |
void | getData (QList< CuData > &in_datalist) |
Get data from multiple readers (writers). More... | |
CuData | options () const |
Get the options currently set on the context. More... | |
CuControlsReaderA * | getReader () const |
CuControlsWriterA * | getWriter () const |
CuControlsReaderA * | findReader (const std::string &srcnam) |
CuControlsWriterA * | findWriter (const std::string &targetnam) |
CuControlsReaderFactoryI * | getReaderFactoryI () const |
returns a pointer to the CuControlsReaderFactoryI or NULL if the context is not a reader context More... | |
CuControlsWriterFactoryI * | getWriterFactoryI () const |
returns a pointer to the CuControlsWriterFactoryI or NULL if the context is not a writer context More... | |
CuControlsFactoryPool | getControlsFactoryPool () const |
returns a copy of the CuControlsFactoryPool, which will be valid if the context is configured with a CumbiaPool object. More... | |
CuLinkStats * | getLinkStats () const |
QList< CuControlsReaderA * > | readers () const |
QList< CuControlsWriterA * > | writers () const |
Cumbia * | cumbia () const |
CumbiaPool * | cumbiaPool () const |
CuLinkControl stores a small set of objects to help create readers and writers.
This can be considered a helper class for private management of Cumbia and reader/writer factories within reader or writer classes.
CuContext::CuContext | ( | Cumbia * | cumbia, |
const CuControlsReaderFactoryI & | r_factory | ||
) |
References CuControlsReaderFactoryI::clone(), and cumbia().
CuContext::CuContext | ( | Cumbia * | cumbia, |
const CuControlsWriterFactoryI & | w_factory | ||
) |
References CuControlsWriterFactoryI::clone(), and cumbia().
CuContext::CuContext | ( | CumbiaPool * | cumbia_pool, |
const CuControlsFactoryPool & | fpool | ||
) |
|
virtual |
References disposeReader(), and disposeWriter().
CuControlsReaderA * CuContext::add_reader | ( | const std::string & | s, |
CuDataListener * | datal | ||
) |
References disposeReader().
CuControlsWriterA * CuContext::add_writer | ( | const std::string & | s, |
CuDataListener * | datal | ||
) |
Cumbia * CuContext::cumbia | ( | ) | const |
Referenced by CuContext().
CumbiaPool * CuContext::cumbiaPool | ( | ) | const |
void CuContext::disposeReader | ( | const std::string & | src = std::string() | ) |
References CuControlsReaderA::source(), and CuControlsReaderA::unsetSource().
Referenced by add_reader(), CuEngineHotSwitch::hot_switch(), replace_reader(), and ~CuContext().
void CuContext::disposeWriter | ( | const std::string & | src = std::string() | ) |
References CuControlsWriterA::target().
Referenced by CuEngineHotSwitch::hot_switch(), replace_writer(), and ~CuContext().
CuControlsReaderA * CuContext::findReader | ( | const std::string & | srcnam | ) |
References CuControlsReaderA::source().
Referenced by getData(), and sendData().
CuControlsWriterA * CuContext::findWriter | ( | const std::string & | targetnam | ) |
References CuControlsWriterA::target().
Referenced by getData(), and sendData().
CuControlsPropertyReaderA * CuContext::get_property_reader | ( | const std::string & | s, |
CuDataListener * | datal | ||
) |
CuControlsFactoryPool CuContext::getControlsFactoryPool | ( | ) | const |
returns a copy of the CuControlsFactoryPool, which will be valid if the context is configured with a CumbiaPool object.
void CuContext::getData | ( | CuData & | d_inout | ) |
Send to the link a bundle with input arguments (keys) and get back the same bundle with values, if applicable.
d_inout | a CuData bundle with input arguments for the CuControlsReaderA/CuControlsWriter in use. |
void CuContext::getData | ( | QList< CuData > & | in_datalist | ) |
Get data from multiple readers (writers).
in_datalist | a list of CuData containing the keys you want to be associated to values. Each in_datalist element must contain a "src" key with the name of the source to search for in the readers (writers) list. |
References findReader(), findWriter(), CuControlsReaderA::getData(), and CuControlsWriterA::getData().
CuLinkStats * CuContext::getLinkStats | ( | ) | const |
CuControlsReaderA * CuContext::getReader | ( | ) | const |
Referenced by CuEngineHotSwitch::hot_switch().
CuControlsReaderFactoryI * CuContext::getReaderFactoryI | ( | ) | const |
returns a pointer to the CuControlsReaderFactoryI or NULL if the context is not a reader context
CuControlsWriterA * CuContext::getWriter | ( | ) | const |
Referenced by CuEngineHotSwitch::hot_switch().
CuControlsWriterFactoryI * CuContext::getWriterFactoryI | ( | ) | const |
returns a pointer to the CuControlsWriterFactoryI or NULL if the context is not a writer context
bool CuContext::isAuto | ( | ) | const |
CuData CuContext::options | ( | ) | const |
QList< CuControlsReaderA * > CuContext::readers | ( | ) | const |
CuControlsReaderA * CuContext::replace_reader | ( | const std::string & | s, |
CuDataListener * | datal | ||
) |
References disposeReader().
Referenced by CuEngineHotSwitch::hot_switch().
CuControlsWriterA * CuContext::replace_writer | ( | const std::string & | s, |
CuDataListener * | datal | ||
) |
References disposeWriter().
Referenced by CuEngineHotSwitch::hot_switch().
void CuContext::sendData | ( | const CuData & | data | ) |
Send options bundle to the link, if active, and save them locally.
If the link (reader or writer) is active (either setSource or setTarget has been called) the options are sent to either CuControlsReaderA or CuControlsWriterA (hereafter named "<em>link</em>") through CuControlsReaderA::sendData or CuControlsWriterA::sendData CuData options bundle is also saved locally and can be fetched with the QuContext::options method.
References CuControlsReaderA::sendData(), and CuControlsWriterA::sendData().
void CuContext::sendData | ( | const QList< CuData > & | data | ) |
Multiple link version of sendData(const CuData& data).
data | list of CuData options bundle to send to the links with the names provided. Every element of the list must have a "src" key with the name of the source (target) of the link to which the data must be sent to. |
References findReader(), findWriter(), CuControlsReaderA::sendData(), and CuControlsWriterA::sendData().
void CuContext::setOptions | ( | const CuData & | options | ) |
Set the options bundle on the context.
options | a CuData bundle with key/value pairs of options. |
Saves the options locally. Options are used to configure the readers and writers instantiated by CuContext.
References options().
QList< CuControlsWriterA * > CuContext::writers | ( | ) | const |