Public Member Functions
CColorArray Class Reference

Detailed Description

The CColorArray is a one-dimensional, zero-based array of CColor objects.

See also:
CColor

#include <xsi_color.h>

List of all members.

Public Member Functions

  CColorArray (LONG in_size=0)
  CColorArray (const CColorArray &in_array)
  ~CColorArray ()
CColorArray operator= (const CColorArray &in_array)
LONG  GetCount () const
CStatus  Add (const CColor &in_item)
CStatus  Clear ()
CStatus  Resize (LONG in_size)
const CColor operator[] (LONG in_index) const
CColor operator[] (LONG in_index)
bool  operator== (const CColorArray &in_array) const
bool  operator!= (const CColorArray &in_array) const

Constructor & Destructor Documentation

CColorArray ( LONG  in_size = 0 )

Constructs a CColorArray and optionally initializes the array to a specified size.

Parameters:
in_size Size of array. The default size is 0.
CColorArray ( const CColorArray in_array )

Constructs a new CColorArray object from an existing CColorArray object.

Parameters:
in_array An existing CColorArray object to copy into this CColorArray object.

Destroys a Group object.


Member Function Documentation

CColorArray& operator= ( const CColorArray in_array )

Assigns a CColorArray object to an existing CColorArray object.

Parameters:
in_array A CColorArray object to be copied into this object.
Returns:
The reinitialized CColorArray object.
LONG GetCount ( ) const

Returns the number of items in this CColorArray.

Returns:
The number of items in the array
CStatus Add ( const CColor in_item )

Adds a CColor to the end of this array.

Parameters:
in_item New CColor to add to the array.
Returns:
CStatus::OK if successful.
CStatus Clear ( )

Removes all elements from the array.

Returns:
CStatus::OK if successful.
CStatus Resize ( LONG  in_size )

Reallocates memory for the array, and preserves the existing contents if the new size is larger than the current size.

Parameters:
in_size New size of the array.
Returns:
CStatus::OK if successful.
CStatus::InvalidArgument if in_size < 0.
const CColor& operator[] ( LONG  in_index ) const

Returns the array element at a given index. This function can only be called by constant objects, and the returned value is read-only.

Parameters:
in_index The index of the element to get. The index must be greater than or equal to zero, and less than the number of elements in the array, otherwise the results are unpredictable.
Returns:
A read-only reference to the indexed item.
CColor& operator[] ( LONG  in_index )

Returns an array element at the specified index.

Parameters:
in_index The index of the element to get. The index must be greater than or equal to zero, and less than the number of elements in the array, otherwise the results are unpredictable.
Returns:
A reference to the indexed item.
bool operator== ( const CColorArray in_array ) const

Tests if two CColorArray objects are equal.

Parameters:
in_array CColorArray to compare with this array.
Returns:
True if in_array has the same size as this array and the elements of in_array are equal to the corresponding elements in this array.
bool operator!= ( const CColorArray in_array ) const

Tests if two CColorArray objects are different.

Parameters:
in_array CColorArray to compare with this array.
Returns:
True if at least one element is different, or if the arrays have different sizes.

The documentation for this class was generated from the following file: