18 #include "xlistnode.h"
19 #include "xitemnode.h"
27 XInterface(
const char *name,
bool runtime,
const shared_ptr<XDriver> &driver);
32 virtual ~XInterfaceError()
throw() {}
36 virtual ~XConvError()
throw() {}
40 virtual ~XCommError()
throw() {}
44 virtual ~XOpenInterfaceError()
throw() {}
47 void setLabel(
const XString& str) {m_label = str;}
50 shared_ptr<XDriver> driver()
const {
return m_driver.lock();}
52 const shared_ptr<XComboNode> &
device()
const {
return m_device;}
54 const shared_ptr<XStringNode> &
port()
const {
return m_port;}
56 const shared_ptr<XUIntNode> &
address()
const {
return m_address;}
58 const shared_ptr<XBoolNode> &
control()
const {
return m_control;}
60 void lock() {m_mutex.lock();}
61 void unlock() {m_mutex.unlock();}
62 bool isLocked()
const {
return m_mutex.isLockedByCurrentThread();}
66 virtual bool isOpened()
const = 0;
83 virtual
void close() throw (XInterfaceError &) = 0;
87 const weak_ptr<
XDriver> m_driver;
93 shared_ptr<
XListener> lsnOnControlChanged;