class: etk::Buffer
Description:
This is an access on raw data that contain an internal gap.
the gap size has an offset to increase an an offset to decrease.
Constructor and Destructor:
+ Buffer (int32_t _count);
+ Buffer (const etk::Buffer & _obj);
+ ~Buffer ();
Synopsis:
+ bool dumpIn (const std::string & _file);
+ bool dumpFrom (const std::string & _file);
+ etk::Buffer & operator = (const etk::Buffer & _obj);
+ int8_t operator [ ] (int32_t _pos) const;
+ int8_t & get (int32_t _pos) const;
+ std::vector<int8_t> get (int32_t _pos,
int32_t _nbElement);
+ void push_back (const int8_t & _item);
+ void insert (int32_t _pos,
const int8_t & _item);
+ void insert (int32_t _pos,
const std::vector<int8_t> & _items);
+ void insert (int32_t _pos,
const int8_t* _items,
int32_t _nbElement);
+ void replace (int32_t _pos,
const int8_t & _item);
+ void replace (int32_t _pos,
int32_t _nbRemoveElement,
const std::vector<int8_t> & _items);
+ void replace (int32_t _pos,
int32_t _nbRemoveElement,
const int8_t* _items,
int32_t _nbElement);
+ void remove (int32_t _pos,
int32_t _nbRemoveElement);
+ void pop_back ();
+ void clear ();
# int8_t & getDirect (int32_t _realElementPosition);
+ int32_t size () const;
Detail:
Buffer
+ Buffer (int32_t _count);
Create an empty vector
Buffer
+ Buffer (const etk::Buffer & _obj);
Re-copy constructor (copy all needed data)
~Buffer
+ ~Buffer ();
Destructor of the current Class
dumpIn
+ bool dumpIn (const std::string & _file);
Store the selected data in the requested file.
dumpFrom
+ bool dumpFrom (const std::string & _file);
Load data fron a selected file name.
operator =
+ etk::Buffer & operator = (const etk::Buffer & _obj);
Re-copy operator
operator [ ]
+ int8_t operator [ ] (int32_t _pos) const;
Get the data at the requested position (gap abstraction done).
Parameter [input]: | _pos | Position in the buffer. |
Return: | | Element at the request pos. |
get
+ int8_t & get (int32_t _pos) const;
Get a current element in the vector
Parameter [input]: | _pos | Desired position read |
Return: | | Reference on the Element |
get
+ std::vector<int8_t> get (int32_t _pos,
int32_t _nbElement);
Get elements from a specific position.
push_back
+ void push_back (const int8_t & _item);
Add at the Last position of the Buffer.
Parameter [input]: | _item | Element to add. |
insert
+ void insert (int32_t _pos,
const int8_t & _item);
Insert One item at the specify position.
insert
+ void insert (int32_t _pos,
const std::vector<int8_t> & _items);
Insert data in the Buffer.
insert
+ void insert (int32_t _pos,
const int8_t* _items,
int32_t _nbElement);
Insert data in the buffer
Parameter [input]: | _pos | Position where data might be inserted |
Parameter [input]: | _items | Data that might be inserted. (no need of '\0') |
Parameter [input]: | _nbElement | number of element to insert |
replace
+ void replace (int32_t _pos,
const int8_t & _item);
Replace one element in the buffer with an other.
replace
+ void replace (int32_t _pos,
int32_t _nbRemoveElement,
const std::vector<int8_t> & _items);
Replace a part of the buffer with the specified data.
Parameter [input]: | _pos | The first element to remove. |
Parameter [input]: | _nbRemoveElement | number of element to remove. |
Parameter [input]: | _items | Data that will be inserted. |
replace
+ void replace (int32_t _pos,
int32_t _nbRemoveElement,
const int8_t* _items,
int32_t _nbElement);
Replace a part of the buffer with the specified data.
Parameter [input]: | _pos | The first element to remove. |
Parameter [input]: | _nbRemoveElement | number of element to remove. |
Parameter [input]: | _items | Data that might be inserted. |
Parameter [input]: | _nbElement | Number of element that might be added. |
remove
+ void remove (int32_t _pos,
int32_t _nbRemoveElement);
Remove specific data in the buffer.
pop_back
+ void pop_back ();
Remove the last element of the Buffer.
clear
+ void clear ();
Remove all the data in the buffer.
getDirect
# int8_t & getDirect (int32_t _realElementPosition);
Get a current element in the Buffer (iterator system)
size
+ int32_t size () const;
Get the number of element in the vector. This does not contain the gap size.
Return: | | The size of the set data. |