14 #ifndef CHARDEVICEDRIVER_H_
15 #define CHARDEVICEDRIVER_H_
18 #include "interface.h"
21 template<
class tDriver,
class tInterface = XCharInterface>
25 Transaction &tr_meas,
const shared_ptr<XMeasure> &meas);
28 const shared_ptr<tInterface> &interface()
const {
return m_interface;}
39 shared_ptr<XListener> m_lsnOnOpen, m_lsnOnClose;
41 const shared_ptr<tInterface> m_interface;
44 template<
class tDriver,
class tInterface>
46 Transaction &tr_meas,
const shared_ptr<XMeasure> &meas) :
47 tDriver(name, runtime, ref(tr_meas), meas),
48 m_interface(
XNode::create<tInterface>(
"Interface", false,
49 dynamic_pointer_cast<
XDriver>(this->shared_from_this()))) {
51 meas->interfaces()->insert(tr_meas, m_interface);
53 m_lsnOnOpen = tr[ *interface()].onOpen().connectWeakly(
55 m_lsnOnClose = tr[ *interface()].onClose().connectWeakly(
59 template<
class tDriver,
class tInterface>
66 e.print(this->getLabel() + i18n(
": Opening driver failed, because "));
70 template<
class tDriver,
class tInterface>
77 e.print(this->getLabel() + i18n(
": Stopping driver failed, because "));