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

A data representation. More...

#include <datarepresentation.hpp>

Inheritance diagram for logicalaccess::DataRepresentation:
logicalaccess::Encoding logicalaccess::BigEndianDataRepresentation logicalaccess::LittleEndianDataRepresentation logicalaccess::NoDataRepresentation

Public Member Functions

virtual ~DataRepresentation ()
 Virtual Destructor.
 
virtual BitsetStream convertNumeric (const BitsetStream &datam)=0
 Convert data to the encoding type.
 
virtual BitsetStream convertBinary (const BitsetStream &data)=0
 Convert binary data to the encoding type.
 
virtual unsigned int convertLength (unsigned int lengthBits)=0
 Get the length after conversation for a given base length in bits.
 
virtual BitsetStream revertNumeric (const BitsetStream &data)=0
 Revert data.
 
virtual BitsetStream revertBinary (const BitsetStream &data)=0
 Revert binary data.
 
- Public Member Functions inherited from logicalaccess::Encoding
virtual ~Encoding ()=default
 
virtual std::string getName () const =0
 Get the encoder name.
 
virtual EncodingType getType () const =0
 Get the encoder type.
 

Static Public Member Functions

static DataRepresentationgetByEncodingType (EncodingType type)
 Create a new Data Representation instance by the encoding type.
 

Detailed Description

A data representation.

Constructor & Destructor Documentation

◆ ~DataRepresentation()

virtual logicalaccess::DataRepresentation::~DataRepresentation ( )
inlinevirtual

Virtual Destructor.

Member Function Documentation

◆ convertBinary()

virtual BitsetStream logicalaccess::DataRepresentation::convertBinary ( const BitsetStream data)
pure virtual

Convert binary data to the encoding type.

Parameters
dataData to convert
dataLengthBytesLength of data to convert in bytes
dataLengthBitsLength of data to convert in bits
convertedDataData after conversion
convertedLengthBytesLength of "convertedData" in bytes
Returns
Length after conversion in bits

Implemented in logicalaccess::BigEndianDataRepresentation, logicalaccess::LittleEndianDataRepresentation, and logicalaccess::NoDataRepresentation.

◆ convertLength()

virtual unsigned int logicalaccess::DataRepresentation::convertLength ( unsigned int  lengthBits)
pure virtual

Get the length after conversation for a given base length in bits.

Parameters
lengthBitsThe unconverted length in bits
Returns
The converted length in bits

Implemented in logicalaccess::BigEndianDataRepresentation, logicalaccess::LittleEndianDataRepresentation, and logicalaccess::NoDataRepresentation.

◆ convertNumeric()

virtual BitsetStream logicalaccess::DataRepresentation::convertNumeric ( const BitsetStream datam)
pure virtual

Convert data to the encoding type.

Parameters
dataData to convert
dataLengthBytesLength of data to convert in bytes
dataLengthBitsLength of data to convert in bits
convertedDataData after conversion
convertedLengthBytesLength of "convertedData" in bytes
Returns
Length after conversion in bits

Implemented in logicalaccess::BigEndianDataRepresentation, logicalaccess::LittleEndianDataRepresentation, and logicalaccess::NoDataRepresentation.

◆ getByEncodingType()

DataRepresentation * logicalaccess::DataRepresentation::getByEncodingType ( EncodingType  type)
static

Create a new Data Representation instance by the encoding type.

Parameters
typeThe encoding type
Returns
The new Data Representation instance, or null if the type is unknown.

◆ revertBinary()

virtual BitsetStream logicalaccess::DataRepresentation::revertBinary ( const BitsetStream data)
pure virtual

Revert binary data.

Parameters
dataData to revert
dataLengthBytesLength of data to convert in bytes
dataLengthBitsLength of data to convert in bits
convertedDataData after reversion
convertedLengthBytesLength of "convertedData"
Returns
Length after reversion in bits

Implemented in logicalaccess::BigEndianDataRepresentation, logicalaccess::LittleEndianDataRepresentation, and logicalaccess::NoDataRepresentation.

◆ revertNumeric()

virtual BitsetStream logicalaccess::DataRepresentation::revertNumeric ( const BitsetStream data)
pure virtual

Revert data.

Parameters
dataData to revert
dataLengthBytesLength of data to convert in bytes
dataLengthBitsLength of data to convert in bits
convertedDataData after reversion
convertedLengthBytesLength of "convertedData"
Returns
Length after reversion in bits

Implemented in logicalaccess::BigEndianDataRepresentation, logicalaccess::LittleEndianDataRepresentation, and logicalaccess::NoDataRepresentation.


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