14 #ifndef DUMMYDRIVER_H_
15 #define DUMMYDRIVER_H_
18 #include "interface.h"
22 XDummyInterface(
const char *name,
bool runtime,
const shared_ptr<XDriver> &driver)
23 :
XInterface(name, runtime, driver), m_bOpened(
false)
35 virtual bool isOpened()
const {
return m_bOpened;}
39 template<
class tDriver>
45 virtual void closeInterface() {interface()->stop();}
46 const shared_ptr<XDummyInterface> &interface()
const {
return m_interface;}
48 shared_ptr<XListener> m_lsnOnOpen, m_lsnOnClose;
51 const shared_ptr<XDummyInterface> m_interface;
54 template<
class tDriver>
56 Transaction &tr_meas,
const shared_ptr<XMeasure> &meas) :
57 tDriver(name, runtime, ref(tr_meas), meas),
59 dynamic_pointer_cast<
XDriver>(this->shared_from_this()))) {
60 meas->interfaces()->insert(tr_meas, m_interface);
62 m_lsnOnOpen = tr[ *interface()].onOpen().connectWeakly(
64 m_lsnOnClose = tr[ *interface()].onClose().connectWeakly(
68 template<
class tDriver>
75 e.print(this->getLabel() + i18n(
": Starting driver failed, because "));
79 template<
class tDriver>
86 e.print(this->getLabel() + i18n(
": Stopping driver failed, because "));