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

A custom format. More...

#include <customformat.hpp>

Inheritance diagram for logicalaccess::CustomFormat:
logicalaccess::Format logicalaccess::XmlSerializable

Public Member Functions

 CustomFormat ()
 Constructor.
 
virtual ~CustomFormat ()
 Destructor.
 
unsigned int getDataLength () const override
 Get data length in bits.
 
virtual void setName (const std::string &name)
 Set the format name.
 
std::string getName () const override
 Get the format name.
 
ByteVector getLinearData () const override
 Get linear data.
 
void setLinearData (const ByteVector &data) override
 Set linear data.
 
bool checkSkeleton (std::shared_ptr< Format > format) const override
 Check the current format skeleton with another format.
 
FormatType getType () const override
 Get the format type.
 
size_t getSkeletonLinearData (ByteVector &data) const override
 Get skeleton linear data.
 
void setSkeletonLinearData (const ByteVector &data) override
 Set skeleton linear data.
 
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< DataFieldgetFieldForPosition (unsigned int position) const
 Get the associated field for a specific position.
 
- Public Member Functions inherited from logicalaccess::Format
 Format ()
 Constructor.
 
 Format (const Format &other)=delete
 Remove copy.
 
Formatoperator= (const Format &)=delete
 
virtual ~Format ()=default
 
virtual unsigned int getDataLength () const =0
 Get data length in bits.
 
virtual std::string getName () const =0
 Get the format name.
 
virtual ByteVector getLinearData () const =0
 Get linear data.
 
virtual void setLinearData (const ByteVector &data)=0
 Set linear data.
 
virtual size_t getSkeletonLinearData (ByteVector &data) const =0
 Get skeleton linear data.
 
virtual void setSkeletonLinearData (const ByteVector &data)=0
 Set skeleton linear data.
 
virtual FormatType getType () const =0
 Get the format type.
 
virtual std::vector< std::string > getValuesFieldList () const
 Get values field list.
 
virtual unsigned int getFieldLength (const std::string &field) const
 Get the field length.
 
virtual bool checkSkeleton (std::shared_ptr< Format > format) const =0
 Check the current format skeleton with another format.
 
virtual ByteVector getIdentifier ()
 Get the identifier.
 
virtual std::vector< std::shared_ptr< DataField > > getFieldList ()
 Get the format field list.
 
virtual void setFieldList (std::vector< std::shared_ptr< DataField > > fields)
 Get the format field list.
 
std::shared_ptr< DataFieldgetFieldFromName (std::string field) const
 Get the field object from name.
 
bool isRepeatable () const
 
void setRepeatable (bool v)
 
- 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 custom format name.
 
- Protected Attributes inherited from logicalaccess::Format
std::list< std::shared_ptr< DataField > > d_fieldList
 The field list.
 
bool is_repeatable_
 

Additional Inherited Members

- Static Public Member Functions inherited from logicalaccess::Format
static std::shared_ptr< FormatgetByFormatType (FormatType type)
 Get a new format instance from a format type.
 
static unsigned char calculateParity (const BitsetStream &data, ParityType parityType, std::vector< unsigned int > positions)
 Calculate parity for a block of data.
 
- 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 custom format.

Constructor & Destructor Documentation

◆ CustomFormat()

logicalaccess::CustomFormat::CustomFormat ( )

Constructor.

◆ ~CustomFormat()

logicalaccess::CustomFormat::~CustomFormat ( )
virtual

Destructor.

Member Function Documentation

◆ checkSkeleton()

bool logicalaccess::CustomFormat::checkSkeleton ( std::shared_ptr< Format format) const
overridevirtual

Check the current format skeleton with another format.

Parameters
formatThe format to check.
Returns
True on success, false otherwise.

Implements logicalaccess::Format.

◆ getDataLength()

unsigned int logicalaccess::CustomFormat::getDataLength ( ) const
overridevirtual

Get data length in bits.

Returns
The data length in bits.

Implements logicalaccess::Format.

◆ getDefaultXmlNodeName()

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

Get the default Xml Node name for this object.

Returns
The Xml node name.

Implements logicalaccess::XmlSerializable.

◆ getFieldForPosition()

std::shared_ptr< DataField > logicalaccess::CustomFormat::getFieldForPosition ( unsigned int  position) const

Get the associated field for a specific position.

Parameters
positionThe position.
Returns
The associated field at this position.

◆ getLinearData()

ByteVector logicalaccess::CustomFormat::getLinearData ( ) const
overridevirtual

Get linear data.

Parameters
dataWhere to put data
dataLengthBytesLength in byte of data

Implements logicalaccess::Format.

◆ getName()

std::string logicalaccess::CustomFormat::getName ( ) const
overridevirtual

Get the format name.

Returns
The format name.

Implements logicalaccess::Format.

◆ getSkeletonLinearData()

size_t logicalaccess::CustomFormat::getSkeletonLinearData ( ByteVector data) const
overridevirtual

Get skeleton linear data.

Parameters
dataWhere to put data
dataLengthBytesLength in byte of data

Implements logicalaccess::Format.

◆ getType()

FormatType logicalaccess::CustomFormat::getType ( ) const
overridevirtual

Get the format type.

Returns
The format type.

Implements logicalaccess::Format.

◆ serialize()

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

Serialize the current object to XML.

Parameters
parentNodeThe parent node.

Implements logicalaccess::XmlSerializable.

◆ setLinearData()

void logicalaccess::CustomFormat::setLinearData ( const ByteVector data)
overridevirtual

Set linear data.

Parameters
dataWhere to get data
dataLengthBytesLength of data in bytes

Implements logicalaccess::Format.

◆ setName()

void logicalaccess::CustomFormat::setName ( const std::string &  name)
virtual

Set the format name.

Parameters
nameThe format name.

◆ setSkeletonLinearData()

void logicalaccess::CustomFormat::setSkeletonLinearData ( const ByteVector data)
overridevirtual

Set skeleton linear data.

Parameters
dataWhere to get data
dataLengthBytesLength in byte of data

Implements logicalaccess::Format.

◆ unSerialize()

void logicalaccess::CustomFormat::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_name

std::string logicalaccess::CustomFormat::d_name
protected

The custom format name.


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