Robox Library for Cpp: BCC/31 module 1.0.0
RLibCpp BCC/31 protocol implementation
|
Class to handle with lists of DeviceItem pointers. More...
#include <basemonitor.h>
Public Member Functions | |
PtrVector () | |
Default constructor. | |
PtrVector (const PtrVector &src) | |
Copy constructor. | |
virtual | ~PtrVector () |
Virtual destructor. | |
PtrVector & | operator= (const PtrVector &src) |
Assigment operator overload. | |
DeviceItem * | operator[] (size_t n) |
Returns a reference to the element at position n in the vector container. | |
const DeviceItem * | operator[] (size_t n) const |
Returns a reference to the element at position n in the vector container. | |
DeviceItem * | at (size_t n) |
Returns a reference to the element at position n in the vector container. | |
const DeviceItem * | at (size_t n) const |
Returns a reference to the element at position n in the vector container. | |
DeviceItem * | front () const |
Get a reference to the first element in the container. | |
DeviceItem * | back () const |
Get a reference to the last element in the container. | |
void | pushBack (const pDeviceItem &value) |
Appends the given element value to the end of the container. | |
void | popBack () |
Removes the last element of the container. | |
void | resize (size_t count) |
Resizes the container to contain count elements. The new element will be initialized with default values. | |
void | resize (size_t count, const pDeviceItem &value) |
Resizes the container to contain count elements. | |
size_t | size () const |
Get the number of elements in the container. | |
void | clear () |
Erases all elements from the container. After this call, size() returns zero. | |
Class to handle with lists of DeviceItem pointers.
PtrVector | ( | ) |
Default constructor.
Copy constructor.
Stored object copied from src will NOT be deleted upon clear or object deletion even if subsequently added with push commands
|
virtual |
Virtual destructor.
This method will delete the stored object too, unless it was create with copy constructor PtrVector(const PtrVector& src) or assigned from other object operator=(const PtrVector& src)
DeviceItem * at | ( | size_t | n | ) |
Returns a reference to the element at position n in the vector container.
n | Position of an element in the container. |
const DeviceItem * at | ( | size_t | n | ) | const |
Returns a reference to the element at position n in the vector container.
n | Position of an element in the container. |
DeviceItem * back | ( | ) | const |
Get a reference to the last element in the container.
void clear | ( | ) |
Erases all elements from the container. After this call, size() returns zero.
This method will delete the stored object too, unless it was create with copy constructor PtrVector(const PtrVector& src) or assigned from other object operator=(const PtrVector& src)
DeviceItem * front | ( | ) | const |
Get a reference to the first element in the container.
Assigment operator overload.
src | The source object |
Stored object copied from src will NOT be deleted upon clear or object deletion even if subsequently added with push commands
DeviceItem * operator[] | ( | size_t | n | ) |
Returns a reference to the element at position n in the vector container.
n | Position of an element in the container. |
const DeviceItem * operator[] | ( | size_t | n | ) | const |
Returns a reference to the element at position n in the vector container.
n | Position of an element in the container. |
void popBack | ( | ) |
Removes the last element of the container.
void pushBack | ( | const pDeviceItem & | value | ) |
Appends the given element value to the end of the container.
value | The value of the element to append |
Stored object value will be deleted upon clear or object deletion unless this container was create with copy constructor PtrVector(const PtrVector& src) or assigned from other object operator=(const PtrVector& src)
void resize | ( | size_t | count | ) |
Resizes the container to contain count elements. The new element will be initialized with default values.
count | The new size of the container |
void resize | ( | size_t | count, |
const pDeviceItem & | value ) |
Resizes the container to contain count elements.
count | The new size of the container |
value | The value to initialize the new elements with |
size_t size | ( | ) | const |
Get the number of elements in the container.