cumbia-qtcontrols 1.x
Qt widgets on top of the cumbia C++ library
|
Helper class to switch context on a controls reader (writer) More...
#include <cuengine_hot_switch.h>
Public Types | |
enum | Engines { NoEngine = 0 , Tango , Epics , Http , Random , Websocket , MaxEngines } |
Public Member Functions | |
CuEngineHotSwitch () | |
~CuEngineHotSwitch () | |
CuContext * | hot_switch (CuDataListener *l, CuContext *ctx, CumbiaPool *p, const CuControlsFactoryPool &fpoo) |
Perform the actual engine switch on either the reader or writer behind the given context. The old context will be deleted. The returned context shall be used by the caller to update its reference to its own context. More... | |
void | switch_engine (int engine, CumbiaPool *p, const CuControlsFactoryPool &fpoo) |
int | detect_engine (CuContext *ctx) const |
const char * | engine_name (int engine) const |
returns the engine name corresponding to the input value from the CuEngineHotSwitch::Engines enum More... | |
bool | error () const |
const QString & | msg () const |
Helper class to switch context on a controls reader (writer)
CuEngineHotSwitch::CuEngineHotSwitch | ( | ) |
CuEngineHotSwitch::~CuEngineHotSwitch | ( | ) |
int CuEngineHotSwitch::detect_engine | ( | CuContext * | ctx | ) | const |
const char * CuEngineHotSwitch::engine_name | ( | int | engine | ) | const |
returns the engine name corresponding to the input value from the CuEngineHotSwitch::Engines enum
engine | one value in the CuEngineHotSwitch::Engines enum |
References MaxEngines.
bool CuEngineHotSwitch::error | ( | ) | const |
CuContext * CuEngineHotSwitch::hot_switch | ( | CuDataListener * | l, |
CuContext * | ctx, | ||
CumbiaPool * | p, | ||
const CuControlsFactoryPool & | fpoo | ||
) |
Perform the actual engine switch on either the reader or writer behind the given context. The old context will be deleted. The returned context shall be used by the caller to update its reference to its own context.
l | the data listener to which the new context with the new engine will be linked |
ctx | the current context of the reader (or writer) to be replaced |
p | a pointer to the CumbiaPool holding the new engine configuration |
fpoo | a const reference to the pool holding the new engine configuration |
This method is mainly used by the library components (or by custom cumbia components) when a context switch (i.e. engine switch) is required by the application.
Example: QuLabel::ctxSwitch(CumbiaPool *cumbia_pool, const CuControlsFactoryPool &fpool)
References CuContext::disposeReader(), CuContext::disposeWriter(), CuContext::getReader(), CuContext::getWriter(), CuContext::replace_reader(), CuContext::replace_writer(), CuControlsReaderA::setSource(), CuControlsWriterA::setTarget(), CuControlsReaderA::source(), and CuControlsWriterA::target().
Referenced by QuButton::ctxSwitch(), and QuLabel::ctxSwitch().
const QString & CuEngineHotSwitch::msg | ( | ) | const |
void CuEngineHotSwitch::switch_engine | ( | int | engine, |
CumbiaPool * | p, | ||
const CuControlsFactoryPool & | fpoo | ||
) |