Classes | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
XInterface Class Referenceabstract

#include <interface.h>

Inheritance diagram for XInterface:
Inheritance graph
[legend]

Classes

struct  Payload
 
struct  XCommError
 
struct  XConvError
 
struct  XInterfaceError
 
struct  XOpenInterfaceError
 

Public Member Functions

 XInterface (const char *name, bool runtime, const shared_ptr< XDriver > &driver)
 
void setLabel (const XString &str)
 
virtual XString getLabel () const
 
shared_ptr< XDriverdriver () const
 
const shared_ptr< XComboNode > & device () const
 type of interface or driver.
 
const shared_ptr< XStringNode > & port () const
 port number or device name.
 
const shared_ptr< XUIntNode > & address () const
 e.g. GPIB address.
 
const shared_ptr< XBoolNode > & control () const
 True if interface is opened. Start/stop interface.
 
void lock ()
 
void unlock ()
 
bool isLocked () const
 
XRecursiveMutexmutex ()
 
virtual bool isOpened () const =0
 
void start ()
 
void stop ()
 
- Public Member Functions inherited from XNode
 XNode (const char *name, bool runtime=false)
 
template<class T >
shared_ptr< T > create (const char *name)
 
template<class T , typename... Args>
shared_ptr< T > create (const char *name, bool runtime, Args &&...args)
 
template<class T >
shared_ptr< T > create (Transaction &tr, const char *name)
 
template<class T , typename... Args>
shared_ptr< T > create (Transaction &tr, const char *name, bool runtime, Args &&...args)
 
XString getName () const
 
XString getTypename () const
 
shared_ptr< XNodegetChild (const XString &var) const
 
shared_ptr< XNodegetParent () const
 
void setUIEnabled (bool v)
 Enables/disables controls over scripting/GUI.
 
void disable ()
 Disables all scripting/GUI operations on this node hereafter.
 
- Public Member Functions inherited from Transactional::Node< XNode >
bool insert (Transaction< XNode > &tr, const shared_ptr< XNode > &var, bool online_after_insertion=false)
 
void insert (const shared_ptr< XNode > &var)
 
bool release (Transaction< XNode > &tr, const shared_ptr< XNode > &var)
 
void release (const shared_ptr< XNode > &var)
 
void releaseAll ()
 
bool swap (Transaction< XNode > &tr, const shared_ptr< XNode > &x, const shared_ptr< XNode > &y)
 
void swap (const shared_ptr< XNode > &x, const shared_ptr< XNode > &y)
 
XNodeupperNode (Snapshot< XNode > &shot)
 Finds the parent node in shot.
 
Snapshot< XNodeiterate_commit (Closure)
 
Snapshot< XNodeiterate_commit_if (Closure)
 
void iterate_commit_while (Closure)
 
void print_ () const
 
 Node (const Node &)=delete
 
Nodeoperator= (const Node &)=delete
 

Protected Member Functions

virtual void open ()=0 throw (XInterfaceError &)
 
virtual void close ()=0 throw (XInterfaceError &)
 This can be called even if has already closed.
 

Private Member Functions

void onControlChanged (const Snapshot &shot, XValueNodeBase *)
 

Private Attributes

const weak_ptr< XDriverm_driver
 
const shared_ptr< XComboNodem_device
 
const shared_ptr< XStringNodem_port
 
const shared_ptr< XUIntNodem_address
 
const shared_ptr< XBoolNodem_control
 
shared_ptr< XListenerlsnOnControlChanged
 
XRecursiveMutex m_mutex
 
XString m_label
 

Additional Inherited Members

- Public Types inherited from Transactional::Node< XNode >
using NodeNotFoundError = std::domain_error
 
using NodeList = fast_vector< shared_ptr< XNode >, 2 >
 
using iterator = typename NodeList::iterator
 
using const_iterator = typename NodeList::const_iterator
 
- Static Public Member Functions inherited from XNode
template<class T__ >
static shared_ptr< T__ > createOrphan (const char *name)
 
template<class T__ , typename... Args_>
static shared_ptr< T__ > createOrphan (const char *name, bool runtime, Args_ &&...args)
 

Detailed Description

virtual class for communication devices.

See Also
XCharInterface

Definition at line 25 of file interface.h.

Member Function Documentation

XString XInterface::getLabel ( ) const
virtual
Returns
i18n name for UI.

Reimplemented from XNode.

Definition at line 48 of file interface.cpp.

Referenced by XOxfordInterface::close().


The documentation for this class was generated from the following files:

Generated for KAME4 by  doxygen 1.8.3