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

A data field base class. More...

#include <datafield.hpp>

Inheritance diagram for logicalaccess::DataField:
logicalaccess::XmlSerializable logicalaccess::ChecksumDataField logicalaccess::ParityDataField logicalaccess::ValueDataField logicalaccess::BinaryDataField logicalaccess::NumberDataField logicalaccess::StringDataField logicalaccess::TLVDataField

Public Member Functions

 DataField ()
 Constructor.
 
virtual ~DataField ()
 Destructor.
 
virtual unsigned int getDataLength () const
 Get data length in bits.
 
virtual void setPosition (unsigned int position)
 Set the field position in bits.
 
unsigned int getPosition () const
 Get the field position in bits.
 
virtual DataFieldType getDFType () const =0
 Get the field type.
 
void setName (const std::string &name)
 Set the field name.
 
std::string getName () const
 Get the field name.
 
virtual BitsetStream getLinearData (const BitsetStream &data) const =0
 Get linear data.
 
virtual void setLinearData (const ByteVector &data)=0
 Set linear data.
 
virtual bool checkSkeleton (std::shared_ptr< DataField > field) const =0
 Check the current field skeleton with another field.
 
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.
 
- 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.
 

Protected Attributes

std::string d_name
 The field name.
 
unsigned int d_length
 The field length in bits.
 
unsigned int d_position
 The field position in bits.
 

Additional Inherited Members

- 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.
 
- Static Protected Member Functions inherited from logicalaccess::XmlSerializable
static unsigned long long atoull (const std::string &str)
 

Detailed Description

A data field base class.

Constructor & Destructor Documentation

◆ DataField()

logicalaccess::DataField::DataField ( )

Constructor.

◆ ~DataField()

logicalaccess::DataField::~DataField ( )
virtual

Destructor.

Member Function Documentation

◆ checkSkeleton()

virtual bool logicalaccess::DataField::checkSkeleton ( std::shared_ptr< DataField field) const
pure virtual

Check the current field skeleton with another field.

Parameters
fieldThe field to check.
Returns
True on success, false otherwise.

Implemented in logicalaccess::BinaryDataField, logicalaccess::NumberDataField, logicalaccess::ParityDataField, logicalaccess::StringDataField, and logicalaccess::TLVDataField.

◆ getDataLength()

unsigned int logicalaccess::DataField::getDataLength ( ) const
virtual

Get data length in bits.

Returns
The data length in bits.

◆ getDFType()

virtual DataFieldType logicalaccess::DataField::getDFType ( ) const
pure virtual

◆ getLinearData()

virtual BitsetStream logicalaccess::DataField::getLinearData ( const BitsetStream data) const
pure virtual

◆ getName()

std::string logicalaccess::DataField::getName ( ) const

Get the field name.

Returns
The field name.

◆ getPosition()

unsigned int logicalaccess::DataField::getPosition ( ) const

Get the field position in bits.

Returns
The field position in bits.

◆ serialize()

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

Serialize the current object to XML.

Parameters
parentNodeThe parent node.

Implements logicalaccess::XmlSerializable.

Reimplemented in logicalaccess::NumberDataField, logicalaccess::ParityDataField, logicalaccess::StringDataField, logicalaccess::TLVDataField, and logicalaccess::ValueDataField.

◆ setLinearData()

virtual void logicalaccess::DataField::setLinearData ( const ByteVector data)
pure virtual

◆ setName()

void logicalaccess::DataField::setName ( const std::string &  name)

Set the field name.

Parameters
nameThe field name.

◆ setPosition()

void logicalaccess::DataField::setPosition ( unsigned int  position)
virtual

Set the field position in bits.

Parameters
positionThe field position in bits.

Reimplemented in logicalaccess::ParityDataField, and logicalaccess::TLVDataField.

◆ unSerialize()

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

UnSerialize a XML node to the current object.

Parameters
nodeThe XML node.

Implements logicalaccess::XmlSerializable.

Reimplemented in logicalaccess::NumberDataField, logicalaccess::ParityDataField, logicalaccess::StringDataField, logicalaccess::TLVDataField, and logicalaccess::ValueDataField.

Member Data Documentation

◆ d_length

unsigned int logicalaccess::DataField::d_length
protected

The field length in bits.

◆ d_name

std::string logicalaccess::DataField::d_name
protected

The field name.

◆ d_position

unsigned int logicalaccess::DataField::d_position
protected

The field position in bits.


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