Photon C++ Client API  5.0.7.3
Public Member Functions | List of all members
AssociativeContainerBase< T, OT > Class Template Referenceabstract
Inheritance diagram for AssociativeContainerBase< T, OT >:
Inheritance graph
[legend]
Collaboration diagram for AssociativeContainerBase< T, OT >:
Collaboration graph
[legend]

Public Member Functions

virtual ~AssociativeContainerBase (void)=0
 
AssociativeContainerBase< T, OT > & operator= (const AssociativeContainerBase< T, OT > &toCopy)
 
virtual bool operator== (const AssociativeContainerBase< T, OT > &toCompare) const
 
virtual bool operator!= (const AssociativeContainerBase< T, OT > &toCompare) const
 
virtual const OT & operator[] (unsigned int index) const
 
virtual const OT & operator[] (int index) const
 
virtual OT & operator[] (unsigned int index)
 
virtual OT & operator[] (int index)
 
virtual void put (const T &src)
 
template<typename FKeyType , typename FValueType >
void put (const FKeyType &key, const FValueType &val)
 
template<typename FKeyType , typename FValueType >
void put (const FKeyType &key, const FValueType pVal, int size)
 
template<typename FKeyType , typename FValueType >
void put (const FKeyType &key, const FValueType pVal, const int *sizes)
 
template<typename FKeyType >
const OT * getValue (const FKeyType &key) const
 
template<typename FKeyType >
OT * getValue (const FKeyType &key)
 
virtual unsigned int getSize (void) const
 
virtual const JVector< OT > & getKeys (void) const
 
template<typename FKeyType >
void remove (const FKeyType &key)
 
virtual void removeAt (unsigned int index)
 
template<typename FKeyType >
bool contains (const FKeyType &key) const
 
virtual void removeAllElements (void)
 
virtual JStringtoString (JString &retStr, bool withTypes=false) const
 
virtual JStringtoString (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 LogFormatOptionsgetLogFormatOptions (void)
 
static void setLogFormatOptions (const LogFormatOptions &options)
 

Constructor & Destructor Documentation

◆ ~AssociativeContainerBase()

~AssociativeContainerBase ( void  )
pure virtual

Destructor.

Member Function Documentation

◆ operator=()

AssociativeContainerBase< T, OT > & operator= ( const AssociativeContainerBase< T, OT > &  toCopy)

operator=. Makes a deep copy of its right operand into its left operand. This overwrites old data in the left operand.

◆ operator==()

bool operator== ( const AssociativeContainerBase< T, OT > &  toCompare) const
virtual

operator==.

Returns
true, if both operands are equal, false otherwise.

Two instances are considered equal if they each hold the same number of entries and, for a given key, the corresponding values equal each other.

Two values are considered equal to each other, if instances of class OT, that are holding them as payloads, equal each other.

See also
OT::operator==()

◆ operator!=()

bool operator!= ( const AssociativeContainerBase< T, OT > &  toCompare) const
virtual

operator!=.

Returns
false, if operator==() would return true, true otherwise.

◆ operator[]() [1/4]

const OT & operator[] ( unsigned int  index) const
virtual

operator[].

Accesses the value at the given index like in an array. This does not check for valid indexes and shows undefined behavior for invalid indexes

◆ operator[]() [2/4]

const OT & operator[] ( int  index) const
virtual

operator[].

Accesses the value at the given index like in an array. This does not check for valid indexes and shows undefined behavior for invalid indexes

◆ operator[]() [3/4]

OT & operator[] ( unsigned int  index)
virtual

operator[].

Accesses the value at the given index like in an array. This does not check for valid indexes and shows undefined behavior for invalid indexes

◆ operator[]() [4/4]

OT & operator[] ( int  index)
virtual

operator[].

Accesses the value at the given index like in an array. This does not check for valid indexes and shows undefined behavior for invalid indexes

◆ put() [1/4]

void put ( const T &  src)
virtual

Adds all pairs of a key and a corresponding value from the passed instance to the instance, on which it is called on. If a key is already existing, then its old value will be replaced with the new one.

Parameters
srcinstance, from which to add the content
Returns
nothing.

Reimplemented in Hashtable.

◆ put() [2/4]

void put ( const FKeyType &  key,
const FValueType &  val 
)

Adds a pair of a key and a corresponding value to the instance.

If the key is already existing, then it's old value will be replaced with the new one. Please have a look at the table of datatypes for a list of supported types for keys and values

Parameters
keythe key to add
valthe value to add

◆ put() [3/4]

void put ( const FKeyType &  key,
const FValueType  pVal,
int  size 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

This overload accepts singledimensional arrays and NULL-pointers passed for parameter pVal. NULL pointers are only legal input, if size is 0

Parameters
keythe key to add
pValthe value array to add
sizethe size of the value array

◆ put() [4/4]

void put ( const FKeyType &  key,
const FValueType  pVal,
const int *  sizes 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

This overload accepts multidimensional arrays and NULL-pointers passed for parameter pVal. The array that is passed for parameter pVal has to be a pointer of the correct abstraction level, meaning a normal pointer for a singledimensional array, a doublepointer for a twodimensional array, a triplepointer for a threedimensional array and so on. For pVal NULL pointers are only legal input, if sizes[0] is 0. For sizes NULL is no valid input.

Parameters
keythe key to add
pValthe value array to add
sizesthe sizes for every dimension of the value array - the length of this array has to match the dimensions of pVal

◆ getValue() [1/2]

const OT * getValue ( const FKeyType &  key) const

Returns a pointer to the corresponding value for a specified key.

Parameters
keyReference to the key to return the corresponding value for.
Returns
a pointer to the corresponding value if the Hashtable contains the specified key, NULL otherwise.
See also
put()

◆ getValue() [2/2]

OT * getValue ( const FKeyType &  key)

Returns a pointer to the corresponding value for a specified key.

Parameters
keyReference to the key to return the corresponding value for.
Returns
a pointer to the corresponding value if the Hashtable contains the specified key, NULL otherwise.
See also
put()

◆ getSize()

unsigned int getSize ( void  ) const
virtual
Returns
the number of key/value pairs stored in the Hashtable.

◆ getKeys()

const JVector< OT > & getKeys ( void  ) const
virtual
Returns
a JVector holding all keys contained in the Hashtable.

◆ remove()

void remove ( const FKeyType &  key)

Deletes the specified key and the corresponding value, if found in the Hashtable.

Parameters
keyPointer to the key of the key/value-pair to remove.
See also
removeAt(), removeAllElements()

◆ removeAt()

void removeAt ( unsigned int  index)
virtual

Deletes the key and the value at the specified index, if the specified index is smaller than the return value of getSize().

Parameters
indexthe index at which the key and value should be deleted.
Returns
nothing.
See also
remove(), removeAllElements()

◆ contains()

bool contains ( const FKeyType &  key) const

Checks, whether the Hashtable contains a certain key.

Parameters
keyPointer to the key to look up.
Returns
true if the specified key was found, false otherwise.

◆ removeAllElements()

void removeAllElements ( void  )
virtual

Clears the Hashtable, which means deleting all its content.

Returns
nothing.
See also
remove(), removeAt()

◆ toString() [1/3]

JString & toString ( JString retStr,
bool  withTypes = false 
) const
virtual
Remarks
The cost of this function depends a lot on implementation details of the implementing subclasses, but for container classes this function can become quite expensive, if the instance contains huge amounts of data, as its cost for many container class implementations increases disproportionately high to the size of the payload.
Parameters
retStrreference 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
withTypesset to true, to include type information in the generated string
Returns
a JString representation of the instance and its contents for debugging purposes.

Implements ToString.

◆ toString() [2/3]

toString
Remarks
The cost of this function depends a lot on implementation details of the implementing subclasses, but for container classes this function can become quite expensive, if the instance contains huge amounts of data, as its cost for many container class implementations increases disproportionately high to the size of the payload.
Parameters
retStrreference 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
withTypesset to true, to include type information in the generated string
Returns
a JString representation of the instance and its contents for debugging purposes.

◆ toString() [3/3]

JString toString

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
withTypesset to true, to include type information in the generated string
Returns
a JString representation of the instance and its contents for debugging purposes.
See also
JString