LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
staticformat.hpp
Go to the documentation of this file.
1
7#ifndef LOGICALACCESS_STATICFORMAT_HPP
8#define LOGICALACCESS_STATICFORMAT_HPP
9
11
12namespace logicalaccess
13{
17class LLA_CORE_API StaticFormat : public Format
18{
19 public:
26
27 virtual ~StaticFormat() = default;
28
33 std::shared_ptr<DataRepresentation> getDataRepresentation() const;
34
39 void setDataRepresentation(std::shared_ptr<DataRepresentation> &encoding);
40
45 std::shared_ptr<DataType> getDataType() const;
46
51 void setDataType(std::shared_ptr<DataType> &encoding);
52
57 unsigned long long getUid() const;
58
63 void setUid(unsigned long long uid);
64
69 virtual bool needUserConfigurationToBeUse() const;
70
80 static unsigned char calculateParity(const BitsetStream &data, ParityType parityType,
81 size_t start, size_t parityLengthBits);
82
92 virtual void convertField(BitsetStream &data, unsigned long long field,
93 unsigned int fieldlen) const;
94
104 unsigned long long revertField(BitsetStream &data, unsigned int *pos,
105 unsigned int fieldlen) const;
106
112 size_t getSkeletonLinearData(ByteVector &data) const override;
113
119 void setSkeletonLinearData(const ByteVector &data) override;
120
121 protected:
128 virtual size_t getFormatLinearData(ByteVector &data) const = 0;
129
136 virtual size_t getEncodingLinearData(ByteVector &data) const;
137
143 virtual void setFormatLinearData(const ByteVector &data, size_t *indexByte) = 0;
144
150 virtual void setEncodingLinearData(const ByteVector &data, size_t *indexByte);
151
155 std::shared_ptr<DataRepresentation> d_dataRepresentation;
156
160 std::shared_ptr<DataType> d_dataType;
161
165 unsigned long long d_uid;
166};
167}
168
169#endif /* LOGICALACCESS_STATICFORMAT_HPP */
Definition: BitsetStream.hpp:15
A format.
Definition: format.hpp:53
A static format.
Definition: staticformat.hpp:18
unsigned long long d_uid
The UID number.
Definition: staticformat.hpp:165
std::shared_ptr< DataType > d_dataType
The Data Type.
Definition: staticformat.hpp:160
std::shared_ptr< DataRepresentation > d_dataRepresentation
The Data Representation.
Definition: staticformat.hpp:155
virtual ~StaticFormat()=default
virtual size_t getFormatLinearData(ByteVector &data) const =0
Get the format linear data in bytes.
virtual void setFormatLinearData(const ByteVector &data, size_t *indexByte)=0
Set the format linear data in bytes.
Format.
std::vector< uint8_t > ByteVector
Definition: lla_fwd.hpp:80
Definition: asn1.hpp:9
ParityType
Parity type.
Definition: datatype.hpp:19