LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
logicalaccess::SerialPortXml Class Reference

#include <serialportxml.hpp>

Inheritance diagram for logicalaccess::SerialPortXml:
logicalaccess::XmlSerializable

Public Member Functions

virtual ~SerialPortXml ()=default
 
 SerialPortXml ()
 Constructor.
 
 SerialPortXml (const std::string &dev)
 Constructor.
 
void serialize (boost::property_tree::ptree &parentNode) override
 Serialize the current object to XML.
 
void unSerialize (boost::property_tree::ptree &node) override
 UnSerialize a XML node to the current object.
 
std::string getDefaultXmlNodeName () const override
 Get the default Xml Node name for this object.
 
std::shared_ptr< SerialPortgetSerialPort () const
 Get the serial port object.
 
- Public Member Functions inherited from logicalaccess::XmlSerializable
virtual ~XmlSerializable ()=default
 
virtual std::string serialize ()
 Serialize object to Xml Node string.
 
virtual std::string serializeWithHeaders ()
 Serialize object to Xml Node string, with xml headers.
 
virtual void serialize (boost::property_tree::ptree &parentNode)=0
 Serialize object to Xml Node.
 
virtual void serializeToFile (const std::string &filename)
 Serialize object to a Xml file.
 
virtual void unSerialize (boost::property_tree::ptree &node)=0
 UnSerialize object from a Xml Node.
 
virtual void unSerialize (const std::string &xmlstring, const std::string &rootNode)
 UnSerialize object from a Xml Node string.
 
virtual void unSerialize (std::istream &is, const std::string &rootNode)
 UnSerialize object from a Xml node.
 
virtual void unSerialize (boost::property_tree::ptree &node, const std::string &rootNode)
 UnSerialize object from a Xml node.
 
virtual void unSerializeFromFile (const std::string &filename)
 UnSerialize object from a Xml file.
 
virtual std::string getDefaultXmlNodeName () const =0
 Get the default Xml Node name for this object.
 

Static Public Member Functions

static bool EnumerateUsingCreateFile (std::vector< std::shared_ptr< SerialPortXml > > &ports)
 Enumate available COM port using CreateFile function.
 
- Static Public Member Functions inherited from logicalaccess::XmlSerializable
static std::string removeXmlDeclaration (const std::string &xmlstring)
 Remove Xml declaration from a xml string.
 
static ByteVector formatHexString (std::string hexstr)
 Format hex string to hex string with space.
 

Protected Attributes

std::shared_ptr< SerialPortd_serialport
 

Additional Inherited Members

- Static Protected Member Functions inherited from logicalaccess::XmlSerializable
static unsigned long long atoull (const std::string &str)
 

Constructor & Destructor Documentation

◆ ~SerialPortXml()

virtual logicalaccess::SerialPortXml::~SerialPortXml ( )
virtualdefault

◆ SerialPortXml() [1/2]

logicalaccess::SerialPortXml::SerialPortXml ( )

Constructor.

◆ SerialPortXml() [2/2]

logicalaccess::SerialPortXml::SerialPortXml ( const std::string &  dev)
explicit

Constructor.

Parameters
devThe device name. (Example: "/dev/tty0")

Member Function Documentation

◆ EnumerateUsingCreateFile()

bool logicalaccess::SerialPortXml::EnumerateUsingCreateFile ( std::vector< std::shared_ptr< SerialPortXml > > &  ports)
static

Enumate available COM port using CreateFile function.

Parameters
portsThe list which will contains the available COM port.
Returns
True on success, false otherwise.

◆ getDefaultXmlNodeName()

std::string logicalaccess::SerialPortXml::getDefaultXmlNodeName ( ) const
overridevirtual

Get the default Xml Node name for this object.

Returns
The Xml node name.

Implements logicalaccess::XmlSerializable.

◆ getSerialPort()

std::shared_ptr< SerialPort > logicalaccess::SerialPortXml::getSerialPort ( ) const

Get the serial port object.

Returns
The serial port.

◆ serialize()

void logicalaccess::SerialPortXml::serialize ( boost::property_tree::ptree &  parentNode)
overridevirtual

Serialize the current object to XML.

Parameters
parentNodeThe parent node.

Implements logicalaccess::XmlSerializable.

◆ unSerialize()

void logicalaccess::SerialPortXml::unSerialize ( boost::property_tree::ptree &  node)
overridevirtual

UnSerialize a XML node to the current object.

Parameters
nodeThe XML node.

Implements logicalaccess::XmlSerializable.

Member Data Documentation

◆ d_serialport

std::shared_ptr<SerialPort> logicalaccess::SerialPortXml::d_serialport
protected

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