ESA JPIP server
0.1
|
This class has been implemented with the same philosophy that the class STL vector, but specifically designed to store integers with a length in bytes that can be not multiple from 2 (e.g. More...
#include <vint_vector.h>
Public Member Functions | |
vint_vector () | |
Initializes the vector to store 64-bit integers. More... | |
vint_vector (int num_bytes) | |
Initializes the vector to store integers with the number of bytes given as parameter. More... | |
vint_vector (const vint_vector &v) | |
Copy constructor. More... | |
const vint_vector & | operator= (const vint_vector &v) |
Copy assignment. More... | |
void | set_num_bytes (int num_bytes) |
Changes the number of bytes of the integer values. More... | |
int | num_bytes () const |
Returns the number of bytes used. More... | |
int | data_bytes () const |
Returns the current number of bytes stored. More... | |
uint64_t | operator[] (int index) const |
Operator overloading for indexing the integer values. More... | |
void | push_back (uint64_t value) |
Adds a new item to the end of the vector. More... | |
void | clear () |
Clears the content. More... | |
int | size () const |
Returns the size of the vector, in number of items. More... | |
uint64_t & | back () |
Return the reference of the last item of the vector. More... | |
virtual | ~vint_vector () |
Private Attributes | |
uint64_t | mask |
Mask used for accessing the data. More... | |
int8_t | num_bytes_ |
Number of bytes used for the integers. More... | |
vector< uint8_t > | data |
This class has been implemented with the same philosophy that the class STL vector, but specifically designed to store integers with a length in bytes that can be not multiple from 2 (e.g.
integers of 3 bytes). This class internally handles a vector of 1-byte integers.
|
inline |
Initializes the vector to store 64-bit integers.
|
inline |
Initializes the vector to store integers with the number of bytes given as parameter.
num_bytes | Number of bytes of each integer. |
|
inline |
Copy constructor.
|
inlinevirtual |
|
inline |
Return the reference of the last item of the vector.
|
inline |
Clears the content.
|
inline |
Returns the current number of bytes stored.
|
inline |
Returns the number of bytes used.
|
inline |
Copy assignment.
|
inline |
Operator overloading for indexing the integer values.
index | Index of the item to return. |
uint64_t
.
|
inline |
Adds a new item to the end of the vector.
value | Value to add to the vector. |
|
inline |
Changes the number of bytes of the integer values.
All the current content is removed.
num_bytes | New number of bytes to use. |
|
inline |
Returns the size of the vector, in number of items.
|
private |
|
private |
Mask used for accessing the data.
|
private |
Number of bytes used for the integers.