PcapPlusPlus
|
#include <PointerVector.h>
Public Types | |
typedef std::vector< T * >::iterator | VectorIterator |
typedef std::vector< T * >::const_iterator | ConstVectorIterator |
Public Member Functions | |
PointerVector () | |
~PointerVector () | |
PointerVector (const PointerVector &other) | |
void | clear () |
void | pushBack (T *element) |
VectorIterator | begin () |
ConstVectorIterator | begin () const |
VectorIterator | end () |
ConstVectorIterator | end () const |
size_t | size () const |
T * | front () |
VectorIterator | erase (VectorIterator position) |
T * | getAndRemoveFromVector (VectorIterator &position) |
T * | at (int index) |
A template class for representing a std::vector of pointers. Once (a pointer to) an element is added to this vector, the element responsibility moves to the vector, meaning the PointerVector will free the object once it's removed from the vector This class wraps std::vector and adds the capability of freeing objects once they're removed from it
typedef std::vector<T*>::const_iterator pcpp::PointerVector< T >::ConstVectorIterator |
Const iterator object that is used for iterating all elements in a constant vector
typedef std::vector<T*>::iterator pcpp::PointerVector< T >::VectorIterator |
Iterator object that is used for iterating all elements in the vector
|
inline |
A constructor that create an empty instance of this object
|
inline |
A destructor for this class. The destructor frees all elements that are binded to the vector
|
inline |
Copy constructor. Once a vector is copied from another vector, all elements inside it are copied, meaning the new vector will contain pointers to copied elements, not pointers to the elements of the original vector
|
inline |
Return a pointer to the element in a certain index
[in] | index | The index to retrieve the element from |
|
inline |
Get the first element of the vector
|
inline |
Get the first element of a constant vector
|
inline |
Clears all elements of the vector while freeing them
|
inline |
Get the last element of the vector
|
inline |
Get the last element of a constant vector
|
inline |
Removes from the vector a single element (position). Once the element is erased, it's also freed
[in] | position | The position of the element to erase |
|
inline |
Returns a pointer of the first element in the vector
|
inline |
Remove an element from the vector without freeing it param[in] position The position of the element to remove from the vector
|
inline |
Add a new (pointer to an) element to the vector
|
inline |
Get number of elements in the vector