Array< PEGASUS_ARRAY_T > Class Template Reference

#include <ArrayInter.h>

Public Member Functions

 Array ()
 
 Array (const Array< PEGASUS_ARRAY_T > &x)
 
 Array (Uint32 size)
 
 Array (Uint32 size, const PEGASUS_ARRAY_T &x)
 
 Array (const PEGASUS_ARRAY_T *items, Uint32 size)
 
 ~Array ()
 
Array< PEGASUS_ARRAY_T > & operator= (const Array< PEGASUS_ARRAY_T > &x)
 
void clear ()
 
void reserveCapacity (Uint32 capacity)
 
void grow (Uint32 size, const PEGASUS_ARRAY_T &x)
 
void swap (Array< PEGASUS_ARRAY_T > &x)
 
Uint32 size () const
 
Uint32 getCapacity () const
 
const PEGASUS_ARRAY_T * getData () const
 
PEGASUS_ARRAY_T & operator[] (Uint32 index)
 
const PEGASUS_ARRAY_T & operator[] (Uint32 index) const
 
void append (const PEGASUS_ARRAY_T &x)
 
void append (const PEGASUS_ARRAY_T *x, Uint32 size)
 
void appendArray (const Array< PEGASUS_ARRAY_T > &x)
 
void prepend (const PEGASUS_ARRAY_T &x)
 
void prepend (const PEGASUS_ARRAY_T *x, Uint32 size)
 
void insert (Uint32 index, const PEGASUS_ARRAY_T &x)
 
void insert (Uint32 index, const PEGASUS_ARRAY_T *x, Uint32 size)
 
void remove (Uint32 index)
 
void remove (Uint32 index, Uint32 size)
 

Detailed Description

template<class PEGASUS_ARRAY_T>
class Array< PEGASUS_ARRAY_T >

This class is used to represent arrays of intrinsic data types in CIM.

Constructor & Destructor Documentation

◆ Array() [1/5]

template<class PEGASUS_ARRAY_T>
Array< PEGASUS_ARRAY_T >::Array ( )

Constructs an array object with null values (default constructor).

◆ Array() [2/5]

template<class PEGASUS_ARRAY_T>
Array< PEGASUS_ARRAY_T >::Array ( const Array< PEGASUS_ARRAY_T > &  x)

Creates a new Array object using the parameters and values in the Array object.

Parameters
xSpecifies the new Array object name.

◆ Array() [3/5]

template<class PEGASUS_ARRAY_T>
Array< PEGASUS_ARRAY_T >::Array ( Uint32  size)

Constructs an array with size elements. The elements are initialized with their copy constructor.

Parameters
sizeDefines the number of elements.

◆ Array() [4/5]

template<class PEGASUS_ARRAY_T>
Array< PEGASUS_ARRAY_T >::Array ( Uint32  size,
const PEGASUS_ARRAY_T &  x 
)

Constructs an array with size elements. The elements are initialized with array x.

Parameters
sizeDefines the number of elements.
xSpecifies the new array object name.

◆ Array() [5/5]

template<class PEGASUS_ARRAY_T>
Array< PEGASUS_ARRAY_T >::Array ( const PEGASUS_ARRAY_T *  items,
Uint32  size 
)

Constructs an array with size elements. The values come from the items pointer.

Parameters
itemsReferences the values of the specified array.
sizeUint32 representing how many elements are in the array.

◆ ~Array()

template<class PEGASUS_ARRAY_T>
Array< PEGASUS_ARRAY_T >::~Array ( )

Destroys the objects, freeing any resources.

Member Function Documentation

◆ append() [1/2]

template<class PEGASUS_ARRAY_T>
void Array< PEGASUS_ARRAY_T >::append ( const PEGASUS_ARRAY_T &  x)

Appends an element to the end of the array. This increases the size of the array by one.

Parameters
xElement to append.

◆ append() [2/2]

template<class PEGASUS_ARRAY_T>
void Array< PEGASUS_ARRAY_T >::append ( const PEGASUS_ARRAY_T *  x,
Uint32  size 
)

Appends size elements at x to the end of this array.

Parameters
xPointer to a buffer containing the elements to append.
sizeA Uint32 value specifying the number of elements to append.

◆ appendArray()

template<class PEGASUS_ARRAY_T>
void Array< PEGASUS_ARRAY_T >::appendArray ( const Array< PEGASUS_ARRAY_T > &  x)

Appends one array to another. The size of this array grows by the size of the other.

Parameters
xArray to add to the appended array.

◆ clear()

template<class PEGASUS_ARRAY_T>
void Array< PEGASUS_ARRAY_T >::clear ( )

Clears the contents of the array. After calling this, size() returns zero.

◆ getCapacity()

template<class PEGASUS_ARRAY_T>
Uint32 Array< PEGASUS_ARRAY_T >::getCapacity ( ) const

Returns the capacity of the array.

Returns
The capacity of the array.

◆ getData()

template<class PEGASUS_ARRAY_T>
const PEGASUS_ARRAY_T* Array< PEGASUS_ARRAY_T >::getData ( ) const

Returns a pointer to the first element of the array.

Returns
A pointer to the first element of the array.

◆ grow()

template<class PEGASUS_ARRAY_T>
void Array< PEGASUS_ARRAY_T >::grow ( Uint32  size,
const PEGASUS_ARRAY_T &  x 
)

Make the size of the array grow by size elements. The new size will be size() + size. The new elements (there are size of them) are initialized with x.

Parameters
sizeDefines the number of elements by which the array is to grow.
xThe element value with which to initialize the new elements.

◆ insert() [1/2]

template<class PEGASUS_ARRAY_T>
void Array< PEGASUS_ARRAY_T >::insert ( Uint32  index,
const PEGASUS_ARRAY_T &  x 
)

Inserts the element at the given index in the array. Subsequent elements are moved down. The size of the array grows by one.

Parameters
indexThe index at which to insert the element into the array.
xSpecifies the element to add to the array.

◆ insert() [2/2]

template<class PEGASUS_ARRAY_T>
void Array< PEGASUS_ARRAY_T >::insert ( Uint32  index,
const PEGASUS_ARRAY_T *  x,
Uint32  size 
)

Inserts a specified number of elements from a buffer into the array at a given index. Subsequent elements are moved down. The size of the array grows by the specified number of elements.

Parameters
indexThe index at which to insert the elements into the array.
xPointer to a buffer containing the elements to insert.
sizeA Uint32 value specifying the number of elements to insert.

◆ operator=()

template<class PEGASUS_ARRAY_T>
Array<PEGASUS_ARRAY_T>& Array< PEGASUS_ARRAY_T >::operator= ( const Array< PEGASUS_ARRAY_T > &  x)

The values of one array object are assigned to another (assignment operator).

Parameters
xArray object to assign the Array parameters to.

◆ operator[]() [1/2]

template<class PEGASUS_ARRAY_T>
PEGASUS_ARRAY_T& Array< PEGASUS_ARRAY_T >::operator[] ( Uint32  index)

Returns the element indicated by the index argument.

Returns
A reference to the element defined by index so that it may be modified.

◆ operator[]() [2/2]

template<class PEGASUS_ARRAY_T>
const PEGASUS_ARRAY_T& Array< PEGASUS_ARRAY_T >::operator[] ( Uint32  index) const

Returns the element in the const array specified as the index argument. The return value cannot be modified since it is constant.

Returns
A reference to the element defined by index but the reference cannot be modified.

◆ prepend() [1/2]

template<class PEGASUS_ARRAY_T>
void Array< PEGASUS_ARRAY_T >::prepend ( const PEGASUS_ARRAY_T &  x)

Appends one element to the beginning of the array. This increases the size by one.

Parameters
xThe element to prepend.

◆ prepend() [2/2]

template<class PEGASUS_ARRAY_T>
void Array< PEGASUS_ARRAY_T >::prepend ( const PEGASUS_ARRAY_T *  x,
Uint32  size 
)

Prepends a specified number of elements from a buffer to the array.

Parameters
xPointer to a buffer containing the elements to prepend.
sizeA Uint32 value specifying the number of elements to prepend.

◆ remove() [1/2]

template<class PEGASUS_ARRAY_T>
void Array< PEGASUS_ARRAY_T >::remove ( Uint32  index)

Removes the element at the given index from the array. The size of the array shrinks by one.

Parameters
indexSpecifies the array element to remove.

◆ remove() [2/2]

template<class PEGASUS_ARRAY_T>
void Array< PEGASUS_ARRAY_T >::remove ( Uint32  index,
Uint32  size 
)

Removes size elements starting at the given index. The size of the array shrinks by size elements.

Parameters
indexSpecifies where in the array to begin removing elements.
sizeUint32 size that specifies how many elements to remove from the array.

◆ reserveCapacity()

template<class PEGASUS_ARRAY_T>
void Array< PEGASUS_ARRAY_T >::reserveCapacity ( Uint32  capacity)

Reserves memory for capacity elements. Notice that this does not change the size of the array (size() returns what it did before). If the capacity of the array is already greater or equal to the capacity argument, this method has no effect. After calling reserveCapacity(), getCapacity() returns a value which is greater or equal to the capacity argument.

Parameters
capacityDefines the size that is to be reserved

◆ size()

template<class PEGASUS_ARRAY_T>
Uint32 Array< PEGASUS_ARRAY_T >::size ( ) const

Returns the number of elements in the array.

Returns
The number of elements in the array.

◆ swap()

template<class PEGASUS_ARRAY_T>
void Array< PEGASUS_ARRAY_T >::swap ( Array< PEGASUS_ARRAY_T > &  x)

Swaps the contents of two arrays. After the swap, Array x references the original values of this Array object and this Array object references the original values of Array x.

Parameters
xThe Array with which to swap values.

The documentation for this class was generated from the following file:
  • /root/rpmbuild/BUILD/pegasus/src/Pegasus/Common/ArrayInter.h