Photon C++ Client API  5.0.7.3
Public Member Functions | List of all members
JArray< Etype > Class Template Reference
Inheritance diagram for JArray< Etype >:
Inheritance graph
[legend]
Collaboration diagram for JArray< Etype >:
Collaboration graph
[legend]

Public Member Functions

 JArray (unsigned int initialCapacity=0, unsigned int capacityIncrement=1)
 
 JArray (const Etype *carray, unsigned int elementCount, unsigned int initialCapacity=0, unsigned int capacityIncrement=1)
 
virtual ~JArray (void)
 
 JArray (const JArray< Etype > &toCopy)
 
template<template< typename > class FT>
 JArray (const SequenceContainer< FT, Etype > &toCopy)
 
virtual JArray< Etype > & operator= (const SequenceContainer< Common::JArray, Etype > &toCopy)
 
template<template< typename > class FT>
JArray< Etype > & operator= (const SequenceContainer< FT, Etype > &toCopy)
 
virtual JArray< Etype > & operator= (const JArray< Etype > &rhv)
 
- Public Member Functions inherited from SequenceContainer< JArray, Etype >
virtual ~SequenceContainer (void)=0
 
SequenceContainer< JArray, Etype > & operator= (const SequenceContainer< JArray, Etype > &toCopy)
 
SequenceContainer< JArray, Etype > & operator= (const SequenceContainer< FT, Etype > &toCopy)
 
bool operator== (const SequenceContainer< JArray, Etype > &toCompare) const
 
bool operator!= (const SequenceContainer< JArray, 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)
 
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 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

◆ JArray() [1/4]

JArray ( unsigned int  initialCapacity = 0,
unsigned int  capacityIncrement = 1 
)

Constructor.

Creates an empty container instance of elements of the type of the template parameter.

Parameters
initialCapacitythe amount of elements, the container instance can take without need for resize. If you choose this too small, the container instance needs expensive resizes later (it's most likely, that the complete memory has to be copied to a new location on resize), if you choose it too big, you will waste much memory. The default is 0.
capacityIncrementEvery time, when one adds an element to the Vector and it has no capacity left anymore, it's capacity will grow with this amount of elements on automatic resize. If you pass a too small value here, expensive resizes will be needed more often, if you choose a too big one, possibly memory is wasted. The default is 1.

◆ JArray() [2/4]

JArray ( const Etype *  carray,
unsigned int  elementCount,
unsigned int  initialCapacity = 0,
unsigned int  capacityIncrement = 1 
)

Constructor.

Creates a container instance, initialized with the passed carray of elements of the type of the template parameter.

Parameters
carrayall elements of this array up to elementCount will get copied into the constructed instance
elementCountshall not be greater than the actual element count of carray or undefined behavior will occur
initialCapacitythe amount of elements, the container instance can take without need for resize. Defaults to the value that gets passed for elementCount. If you choose this too small, the container instance needs expensive resizes later (it's most likely, that the complete memory has to be copied to a new location on resize), if you choose it too big, you will waste much memory.
capacityIncrementEvery time, when one adds an element to the container and it has no capacity left anymore, it's capacity will grow with this amount of elements on automatic resize. If you pass a too small value here, expensive resizes will be needed more often, if you choose a too big one, possibly memory is wasted. The default is 1.

◆ ~JArray()

~JArray ( void  )
virtual

Destructor.

◆ JArray() [3/4]

JArray ( const JArray< Etype > &  toCopy)

Copy-Constructor.

Creates an object out of a deep copy of its parameter.

Parameters
toCopyThe object to copy.

◆ JArray() [4/4]

JArray ( 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.

Member Function Documentation

◆ operator=() [1/3]

JArray< Etype > & operator= ( const SequenceContainer< Common::JArray< Etype >, Etype > &  toCopy)
virtual

operator=.

Makes a deep copy of its right operand into its left operand.

This overwrites old data in the left operand.

◆ operator=() [2/3]

JArray< 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.

◆ operator=() [3/3]

JArray< Etype > & operator= ( const JArray< Etype > &  toCopy)
virtual

operator=.

Makes a deep copy of its right operand into its left operand.

This overwrites old data in the left operand.