LibLogicalAccess
2.5.0
An Open Source RFID Library
|
A format. More...
#include <format.hpp>
Public Member Functions | |
Format () | |
Constructor. | |
Format (const Format &other)=delete | |
Remove copy. | |
Format & | operator= (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< DataField > | getFieldFromName (std::string field) const |
Get the field object from name. | |
bool | isRepeatable () const |
void | setRepeatable (bool v) |
![]() | |
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 std::shared_ptr< Format > | getByFormatType (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 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::list< std::shared_ptr< DataField > > | d_fieldList |
The field list. | |
bool | is_repeatable_ |
Additional Inherited Members | |
![]() | |
static unsigned long long | atoull (const std::string &str) |
A format.
logicalaccess::Format::Format | ( | ) |
Constructor.
Create a Format.
|
delete |
Remove copy.
|
virtualdefault |
|
static |
Calculate parity for a block of data.
data | Data block |
dataLengthBytes | Length of data in bytes |
parityType | Parity type |
positions | List of positions to calculate parity |
nbPositions | Number of parity in the list |
|
pure virtual |
Check the current format skeleton with another format.
format | The format to check. |
Implemented in logicalaccess::ASCIIFormat, logicalaccess::BariumFerritePCSCFormat, logicalaccess::CustomFormat, logicalaccess::DataClockFormat, logicalaccess::FASCN200BitFormat, logicalaccess::Getronik40BitFormat, logicalaccess::HIDHoneywell40BitFormat, logicalaccess::RawFormat, logicalaccess::Wiegand26Format, logicalaccess::Wiegand34Format, logicalaccess::Wiegand34WithFacilityFormat, logicalaccess::Wiegand35Format, logicalaccess::Wiegand37Format, logicalaccess::Wiegand37WithFacilityFormat, and logicalaccess::Wiegand37WithFacilityRightParity2Format.
|
static |
Get a new format instance from a format type.
type | The format type. |
|
pure virtual |
Get data length in bits.
Implemented in logicalaccess::ASCIIFormat, logicalaccess::BariumFerritePCSCFormat, logicalaccess::CustomFormat, logicalaccess::DataClockFormat, logicalaccess::FASCN200BitFormat, logicalaccess::Getronik40BitFormat, logicalaccess::HIDHoneywell40BitFormat, logicalaccess::RawFormat, logicalaccess::Wiegand26Format, logicalaccess::Wiegand34Format, logicalaccess::Wiegand35Format, logicalaccess::Wiegand37Format, and logicalaccess::Wiegand37WithFacilityRightParity2Format.
std::shared_ptr< DataField > logicalaccess::Format::getFieldFromName | ( | std::string | field | ) | const |
Get the field object from name.
|
virtual |
Get the field length.
field | The field. |
Reimplemented in logicalaccess::RawFormat.
|
virtual |
Get the format field list.
|
virtual |
Get the identifier.
|
pure virtual |
Get linear data.
data | Where to put data |
dataLengthBytes | Length in byte of data |
Implemented in logicalaccess::ASCIIFormat, logicalaccess::BariumFerritePCSCFormat, logicalaccess::CustomFormat, logicalaccess::DataClockFormat, logicalaccess::FASCN200BitFormat, logicalaccess::Getronik40BitFormat, logicalaccess::HIDHoneywell40BitFormat, logicalaccess::RawFormat, logicalaccess::Wiegand35Format, logicalaccess::Wiegand37WithFacilityRightParity2Format, and logicalaccess::WiegandFormat.
|
pure virtual |
Get the format name.
Implemented in logicalaccess::ASCIIFormat, logicalaccess::BariumFerritePCSCFormat, logicalaccess::CustomFormat, logicalaccess::DataClockFormat, logicalaccess::FASCN200BitFormat, logicalaccess::Getronik40BitFormat, logicalaccess::HIDHoneywell40BitFormat, logicalaccess::RawFormat, logicalaccess::Wiegand26Format, logicalaccess::Wiegand34Format, logicalaccess::Wiegand34WithFacilityFormat, logicalaccess::Wiegand35Format, logicalaccess::Wiegand37Format, logicalaccess::Wiegand37WithFacilityFormat, and logicalaccess::Wiegand37WithFacilityRightParity2Format.
|
pure virtual |
Get skeleton linear data.
data | Where to put data |
dataLengthBytes | Length in byte of data |
Implemented in logicalaccess::CustomFormat, and logicalaccess::StaticFormat.
|
pure virtual |
Get the format type.
Implemented in logicalaccess::ASCIIFormat, logicalaccess::BariumFerritePCSCFormat, logicalaccess::CustomFormat, logicalaccess::DataClockFormat, logicalaccess::FASCN200BitFormat, logicalaccess::Getronik40BitFormat, logicalaccess::HIDHoneywell40BitFormat, logicalaccess::RawFormat, logicalaccess::Wiegand26Format, logicalaccess::Wiegand34Format, logicalaccess::Wiegand34WithFacilityFormat, logicalaccess::Wiegand35Format, logicalaccess::Wiegand37Format, logicalaccess::Wiegand37WithFacilityFormat, and logicalaccess::Wiegand37WithFacilityRightParity2Format.
|
virtual |
Get values field list.
bool logicalaccess::Format::isRepeatable | ( | ) | const |
|
virtual |
Get the format field list.
fields | The field list. |
|
pure virtual |
Set linear data.
data | Where to get data |
dataLengthBytes | Length of data in bytes |
Implemented in logicalaccess::ASCIIFormat, logicalaccess::BariumFerritePCSCFormat, logicalaccess::CustomFormat, logicalaccess::DataClockFormat, logicalaccess::FASCN200BitFormat, logicalaccess::Getronik40BitFormat, logicalaccess::HIDHoneywell40BitFormat, logicalaccess::RawFormat, logicalaccess::Wiegand35Format, logicalaccess::Wiegand37WithFacilityRightParity2Format, and logicalaccess::WiegandFormat.
void logicalaccess::Format::setRepeatable | ( | bool | v | ) |
|
pure virtual |
Set skeleton linear data.
data | Where to get data |
dataLengthBytes | Length in byte of data |
Implemented in logicalaccess::CustomFormat, and logicalaccess::StaticFormat.
|
protected |
The field list.
|
protected |
If true, we expect the format to be concatenated multiple time in a single Location.