#include <uaunistringlist.h>
List of all members.
Detailed Description
OPC UA string list class. This class encapsulates a list of UaUniStringPrivate This list behaves like a vector and allows fast index lookup. Inserting and deleting elements can be very slow.
Constructor & Destructor Documentation
UaUniStringList::UaUniStringList |
( |
unsigned int |
capacity = DEFAULT_ALLOC_CHUNK_SIZE ) |
|
Default constructor. Creates an empty UaUniStringList. Preallocates space for capacity strings
UaUniStringList::~UaUniStringList |
( |
) |
|
Destroyes the stringlist.
Member Function Documentation
void UaUniStringList::append |
( |
const UaUniString & |
newString ) |
|
Inserts newString at the end of the list. The list will automatically expand and allocate memory if necessary. AllocChunkSize defines how much space is beeing allocated when expanding the list. Do not call resize() or reserve() in a loop.
- See also:
- prepend()
-
insert()
unsigned int UaUniStringList::capacity |
( |
) |
const |
Returns the number UaUniString this list can hold before allocating memory. Note that this is not actual number of UaUniStrings in this list.
- See also:
- size()
void UaUniStringList::clear |
( |
) |
|
Releases all elements in the list, releases all memory, sets size and capacity to 0 and AllocChunkSize to DEFAULT_ALLOC_CHUNK_SIZE
void UaUniStringList::insert |
( |
unsigned int |
index, |
|
|
const UaUniString & |
newString |
|
) |
| |
Inserts value at index position into the list. If index is 0, this function does the same as prepend. If index is size(), this function does the same as append. Do not use this function if you care about performance.
- See also:
- append()
-
prepend()
bool UaUniStringList::isEmpty |
( |
) |
const |
Returns true if the string is empty.
Returns true if other is not equal to this.
- See also:
- operator==
Assigns other to this stringlist and returns a reference to this stringlist. This will be an exact copy of other i.e. content of the list , capacity, size, AllocChunkSize will be the same.
Returns true if other is equal to this.
- See also:
- operator!=
const UaUniString & UaUniStringList::operator[] |
( |
unsigned int |
index ) |
const |
Returns the UaUniString at index position index as a constant reference. i must be a valid index position in the list (i.e., 0 <= i < size()).
UaUniString & UaUniStringList::operator[] |
( |
unsigned int |
index ) |
|
Returns the UaUniString at index position index as a modifiable reference. i must be a valid index position in the list (i.e., 0 <= i < size()).
void UaUniStringList::prepend |
( |
const UaUniString & |
newString ) |
|
Inserts newString at the beginning of the list. Do not use this function if you care about performance.
- See also:
- append()
-
insert()
void UaUniStringList::removeAt |
( |
unsigned int |
index ) |
|
Removes the string at index position. Index must be a valid index position in the list (i.e., 0 <= i < size()). This will delete the element and cause all element behind to move up in the list by one Do not use this function if you care about performance.
- See also:
- clear()
void UaUniStringList::reserve |
( |
unsigned int |
capacity ) |
|
Allocates memory for at least capacity elements. If newSize is smaller than the current capacity this function does nothing. Only use this function if you know how large the list will be. Otherwise you'll probably not gain any performance. AllocChunkSize has no effect on how this function allocates memory.
- See also:
- capacity()
-
squeeze()
-
allocChunkSize()
void UaUniStringList::resize |
( |
unsigned int |
size ) |
|
Sets the size of the list to size elements. If size is greater than the current size, the list is extended to make it size elements long with the extra strings added to the end. The new string are empty. If size is less than the current size, UaUniStrings are removed from the end.
- See also:
- reserve()
-
size()
unsigned int UaUniStringList::size |
( |
) |
const |
Returns the number of UaUniStrings in this list.
- See also:
- capacity()
void UaUniStringList::sort |
( |
bool |
bAscending = true , |
|
|
bool |
bCaseSensitive = false |
|
) |
| |
Sorts the list in alphabetical order. The list is sorted using the combsort algorithm.
- Parameters:
-
bAscending | Flag indicating if the sort order is acending or descending. |
bCaseSensitive | Flag indicating if the sort order is case sensitive or not. |
void UaUniStringList::squeeze |
( |
) |
|
Releases any memory not required to store the strings in a list. This function will not change the size. After execution of this function capacity will be size. AllocChunkSize has no effect on how this function allocates memory.
- See also:
- capacity()
-
reserve()
-
allocChunkSize()
void UaUniStringList::swap |
( |
unsigned int |
indexA, |
|
|
unsigned int |
indexB |
|
) |
| |
Swaps 2 elements in the list
- Parameters:
-
indexA | index of first element to swap. |
indexB | index of other element to swap. |
The documentation for this class was generated from the following files:
- /home/buildbot/work/uasdkcpp/src/uabase/uabasecpp/uaunistringlist.h
- /home/buildbot/work/uasdkcpp/src/uabase/uabasecpp/uaunistringlist.cpp