API Guides > ConceptRT 3.x
PackedStrings Class Referenceabstract

Base class for Strings collection. More...

Detailed Description

Base class for Strings collection.

+ Inheritance diagram for PackedStrings:

Public Member Methods

 PackedStrings (Int32 *count, Int32 *index, PChar8 data, Int32 CharCapacity, Int32 StringCapacity)
 Constructor. More...
 
Int32 GetCount () const
 Gets the count. More...
 
PCChar8 GetString (Int32 index) const
 Gets a string. More...
 
void CompleteString (PCChar8 string)
 Add a string or complete the current string added by AppendString to the list. More...
 
void AppendString (PCChar8 string)
 Append a string to the current string of the list. More...
 
void Clear ()
 Clears the content of the collection. More...
 
bool HasAvailableCharCapacity (Int32 charCapacity)
 Query if it has available character capacity. More...
 
void SetMinCharCapacity (Int32 charCapacity)
 Sets a minimum character capacity. More...
 
PChar8 _RawDataBuffer ()
 Gets the raw data buffer. More...
 
Int32 _RawDataBufferCapacity ()
 Gets the raw data buffer capacity. More...
 
Int32 _RawDataBufferUsedSize ()
 Gets the raw data buffer used size. More...
 
void _RawDataBufferUpdated (Int32 usedSize)
 Raw data buffer updated. More...
 
- Public Member Methods inherited from Strings
virtual ~Strings ()
 Destructor. More...
 
PCChar8 operator[] (Int32 index) const
 Array indexer operator. More...
 
void CheckCount (Int32 expectedValue) const
 Check count. Raise an exception whenever the count mismatch. More...
 
bool Contains (const PCChar8 text) const
 Query if this string collection contains the given text. More...
 

Protected Member Functions

virtual void UpdateCharCapacity (Int32 expectedSize, Int32 &newCapacity, PChar8 &newBuffer)=0
 Update the character capacity. More...
 
virtual void UpdateStringCapacity (Int32 expectedSize, Int32 &newCapacity, Int32 *&newBuffer)=0
 Update the mumber of strings capacity. More...
 

Constructor & Destructor Documentation

PackedStrings ( Int32 count,
Int32 index,
PChar8  data,
Int32  CharCapacity,
Int32  StringCapacity 
)

Constructor.

Parameters
count[in,out] number of strings.
index[in,out] Current index.
dataThe data.
CharCapacityThe total character capacity.
StringCapacityThe number of strings that can be added.

Methods Documentation

PChar8 _RawDataBuffer ( )

Gets the raw data buffer.

Returns
The raw buffer.
Int32 _RawDataBufferCapacity ( )

Gets the raw data buffer capacity.

Returns
the raw buffer capacity.
void _RawDataBufferUpdated ( Int32  usedSize)

Raw data buffer updated.

Parameters
usedSizeSize of the used.

Must be called after a direct change has been applied to RawData

RT Exceptions:
RT_ERROR_BAD_PARAMETER
Int32 _RawDataBufferUsedSize ( )

Gets the raw data buffer used size.

Returns
the raw buffer used size.
void AppendString ( PCChar8  string)

Append a string to the current string of the list.

Parameters
stringString to add.
void Clear ( )

Clears the content of the collection.

void CompleteString ( PCChar8  string)

Add a string or complete the current string added by AppendString to the list.

Parameters
stringString to add.
Int32 GetCount ( ) const
virtual

Gets the count.

Returns
The count.

Implements Strings.

PCChar8 GetString ( Int32  index) const
virtual

Gets a string.

Parameters
indexZero-based index of the.
Returns
The string.
RT Exceptions:
RT_ERROR_OUT_OF_BOUND_INDEX

Implements Strings.

bool HasAvailableCharCapacity ( Int32  charCapacity)

Query if it has available character capacity.

Parameters
charCapacityThe character capacity expected.
Returns
true if available character capacity, false if not.
void SetMinCharCapacity ( Int32  charCapacity)

Sets a minimum character capacity.

Parameters
charCapacityThe character capacity expected.
virtual void UpdateCharCapacity ( Int32  expectedSize,
Int32 newCapacity,
PChar8 newBuffer 
)
protectedpure virtual

Update the character capacity.

Parameters
expectedSizeThe expected character capacity.
newCapacity[in, out] The new character capacity.
newBuffer[in, out] The new memory buffer.

New capacity is not always the same than expectedSize in order to optimize the memory managememt.

Implemented in PackedStringListDynamic, PackedStringListDynamicTcp, PackedStringList< CharCapacity, StringCapacity >, PackedStringList< DataSize, DynamicInvocationClientChannelMemoryDataIndex >, PackedStringList< MaxPersistentDiagnosticTextLength, MaxPersistentDiagnostic >, PackedStringList< 1024, 16 >, PackedStringList< 65536, 1024 >, PackedStringList< 1024, 10 >, and DynamicInvocationSharedMemoryStrings.

virtual void UpdateStringCapacity ( Int32  expectedSize,
Int32 newCapacity,
Int32 *&  newBuffer 
)
protectedpure virtual

Update the mumber of strings capacity.

Parameters
expectedSizeThe expected strings capacity.
newCapacity[in, out] The new strings capacity.
newBuffer[in, out] The new memory buffer.

New capacity is not always the same than expectedSize in order to optimize the memory managememt.

Implemented in PackedStringListDynamic, PackedStringList< CharCapacity, StringCapacity >, PackedStringList< DataSize, DynamicInvocationClientChannelMemoryDataIndex >, PackedStringList< MaxPersistentDiagnosticTextLength, MaxPersistentDiagnostic >, PackedStringList< 1024, 16 >, PackedStringList< 65536, 1024 >, PackedStringList< 1024, 10 >, and DynamicInvocationSharedMemoryStrings.