Photon C++ Client API
5.0.7.3
|
Public Member Functions | |
virtual | ~SequenceContainer (void)=0 |
SequenceContainer< T, Etype > & | operator= (const SequenceContainer< T, Etype > &toCopy) |
template<template< typename > class FT> | |
SequenceContainer< T, Etype > & | operator= (const SequenceContainer< FT, Etype > &toCopy) |
bool | operator== (const SequenceContainer< T, Etype > &toCompare) const |
bool | operator!= (const SequenceContainer< T, Etype > &toCompare) const |
const Etype & | operator[] (unsigned int index) const |
const Etype & | operator[] (int index) const |
Etype & | operator[] (unsigned int index) |
Etype & | operator[] (int index) |
unsigned int | getCapacity (void) const |
bool | contains (const Etype &elem) const |
const Etype & | getFirstElement (void) const |
int | getIndexOf (const Etype &elem) const |
bool | getIsEmpty (void) const |
const Etype & | getLastElement (void) const |
int | getLastIndexOf (const Etype &elem) const |
unsigned int | getSize (void) const |
const Etype * | getCArray (void) const |
void | copyInto (Etype *array) const |
void | addElement (const Etype &obj) |
void | addElements (const Etype *carray, unsigned int elementCount) |
template<template< typename > class FT> | |
void | addElements (const SequenceContainer< FT, Etype > &container) |
void | ensureCapacity (unsigned int minCapacity) |
void | removeAllElements (void) |
bool | removeElement (const Etype &obj) |
void | trimToSize (void) |
const Etype & | getElementAt (unsigned int index) const |
void | insertElementAt (const Etype &obj, unsigned int index) |
void | removeElementAt (unsigned int index) |
void | setElementAt (const Etype &obj, unsigned int index) |
virtual JString & | toString (JString &retStr, bool withTypes=false) const |
virtual JString & | toString (JString &retStr, bool withTypes=false) const=0 |
JString | toString (bool withTypes=false) const |
Public Member Functions inherited from Base | |
virtual | ~Base (void)=0 |
Public Member Functions inherited from LoggingBase< Base > | |
virtual | ~LoggingBase (void)=0 |
Public Member Functions inherited from ToString | |
virtual | ~ToString (void) |
virtual JString | typeToString (void) const |
JString | toString (bool withTypes=false) const |
Additional Inherited Members | |
Static Public Member Functions inherited from LoggingBase< Base > | |
static void | setListener (const BaseListener *pBaseListener) |
static int | getDebugOutputLevel (void) |
static bool | setDebugOutputLevel (int debugLevel) |
static const LogFormatOptions & | getLogFormatOptions (void) |
static void | setLogFormatOptions (const LogFormatOptions &options) |
|
pure virtual |
Destructor.
SequenceContainer< T, Etype > & operator= | ( | const SequenceContainer< T, Etype > & | toCopy | ) |
operator=.
Makes a deep copy of its right operand into its left operand.
This overwrites old data in the left operand.
SequenceContainer< T, Etype > & operator= | ( | const SequenceContainer< FT, Etype > & | toCopy | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
bool operator== | ( | const SequenceContainer< T, Etype > & | toCompare | ) | const |
operator==.
bool operator!= | ( | const SequenceContainer< T, Etype > & | toCompare | ) | const |
operator!=.
const Etype & operator[] | ( | unsigned int | index | ) | const |
operator[]. Wraps the function getElementAt(), so that you have the same syntax like for c-arrays.
const Etype & operator[] | ( | int | index | ) | const |
operator[]. Wraps the function getElementAt(), so that you have the same syntax like for c-arrays.
Etype & operator[] | ( | unsigned int | index | ) |
operator[]. Enables c-array like write access to elements.
Etype & operator[] | ( | int | index | ) |
operator[]. Enables c-array like write access to elements.
unsigned int getCapacity | ( | void | ) | const |
Returns the current capacity of the instance .
bool contains | ( | const Etype & | elem | ) | const |
Checks, if the instance contains the passed data as an element.
elem | a reference to the data, you want to check. Needs to be either a primitive type or an object of a class with an overloaded == operator. |
const Etype & getFirstElement | ( | void | ) | const |
Returns the first element of the instance. Shows undefined behavior for empty vectors.
int getIndexOf | ( | const Etype & | elem | ) | const |
Searches the instance from the first element in forward direction for the passed element and returns the first index, where it was found.
elem | the element, to search for. |
bool getIsEmpty | ( | void | ) | const |
Checks, if the instance is empty.
const Etype & getLastElement | ( | void | ) | const |
Returns the last element of the instance. Shows undefined behavior for empty vectors.
int getLastIndexOf | ( | const Etype & | elem | ) | const |
Searches the instance from the last element in backward direction for the passed element and returns the first index, where it was found.
elem | the element, to search for. |
unsigned int getSize | ( | void | ) | const |
Returns the number of elements of the instance.
const Etype * getCArray | ( | void | ) | const |
void copyInto | ( | Etype * | array | ) | const |
Copies all elements of the container instance into the passed array. The caller has to make sure, that the array is big enough to take all elements of the vector, otherwise calling this function produces a buffer overflow.
array | an array of variables of the type of the template instantiation. |
void addElement | ( | const Etype & | elem | ) |
Adds an element to the instance. This automatically resizes the instances capacity to it's old size + the capacityIncrement, that you passed, when creating the vector (if you passed no value for capacityIncrement, then it was set to it's default value (see constructor doc)), if the size of the instance has already reached it's capacity. When resizing occurs, then most likely the whole vector has to be copied to new memory. So this can be an expensive operation for huge vectors.
elem | the element to add. |
void addElements | ( | const Etype * | carray, |
unsigned int | elementCount | ||
) |
Adds the first 'elementCount' elements of the provided array to the instance. This automatically resizes the instances capacity to it's old size + 'elementCount', if the new size of the instance is bigger than it's old capacity. When resizing occurs, then most likely the whole vector has to be copied to new memory. So this can be an expensive operation for huge vectors.
carray | the elements to add. |
elementCount | the number of elements to add - must not be greater than the size of carray. |
void addElements | ( | const SequenceContainer< FT, Etype > & | container | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Calls the above function with container.getCArray() and container.getSize() as parameters
container | the container class instance from which to copy the elements |
void ensureCapacity | ( | unsigned int | minCapacity | ) |
Resizes the instance to the passed capacity, if it's old capacity has been smaller. If resizing is needed, then the whole instance has to be copied into new memory, so in that case this is an expensive operation for huge instances. Call this function, before you add a lot of elements to the vector, to avoid multiple expensive resizes through adding.
minCapacity | the new capacity for the instance. |
void removeAllElements | ( | void | ) |
Clears the instance.
bool removeElement | ( | const Etype & | obj | ) |
Removes the first occurrence of the passed value from the instance.
obj | the element, to remove. |
void trimToSize | ( | void | ) |
Trims the capacity of the instance to the size, it currently uses. Call this function for a instance with huge unused capacity, if you do not want to add further elements to it and if you are short on memory. This function copies the whole vector to new memory, so it is expensive for huge vectors. If you only add one element to the instance later, it's copied again.
const Etype & getElementAt | ( | unsigned int | index | ) | const |
Returns the element of the instance at the passed index. This does not check for valid indexes and shows undefined behavior for invalid indexes!
index | the index of the element, that should be returned. Must not be bigger than the current size of the vector! |
void insertElementAt | ( | const Etype & | obj, |
unsigned int | index | ||
) |
Inserts parameter one into the instance at the index, passed as parameter two. Because all elements above or at the passed index have to be moved one position up, it is expensive, to insert an element at an low index into a huge instance.
obj | the element, to insert. |
index | the position in the instance, the element is inserted at. |
void removeElementAt | ( | unsigned int | index | ) |
Removes the element at the passed index from the instance. Shows undefined behavior for invalid indexes.
index | the index of the element to remove. |
void setElementAt | ( | const Etype & | obj, |
unsigned int | index | ||
) |
Sets the element at the passed index of the instance to the passed new value. Shows undefined behavior for invalid indexes.
obj | the new value. |
index | the index of the element, which is set to the new value. |
retStr | reference to a string, to store the return-value in; the information, which is generated by this function, will be attached at the end of any eventually existing previous content of the string |
withTypes | set to true, to include type information in the generated string |
Implements ToString.
toString |
retStr | reference to a string, to store the return-value in; the information, which is generated by this function, will be attached at the end of any eventually existing previous content of the string |
withTypes | set to true, to include type information in the generated string |
JString toString |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
withTypes | set to true, to include type information in the generated string |