CDXVec Overloaded Operators

The functions in this section enable you to perform mathematical operations with CDXVec class objects.

operator [] ( int index ) Accesses a dimension of the structure by index as an integer.
operator [] ( long index ) Accesses a dimension of the structure by index as a long.
operator [] ( USHORT index ) Accesses a dimension of the structure by index as a USHORT.
operator [] ( DWORD index ) Accesses a dimension of the structure by index as a DWORD.
operator = Assigns components of one vector to another vector.
operator != Tests for inequality of two vectors.
operator + Adds two vectors, returning a resultant vector.
operator - Subtracts two vectors, returning a resultant vector.
operator += Increments a vector with another vector.
operator -= Decrements a vector with another vector.
operator == Tests for equality of two vectors.
ZeroVector Sets all components of a vector to zero.

CDXVec::operator [] ( int index )

CDXVec Class

Accesses a dimension of the structure by index.

Syntax

TYPE& operator[]( int index ) const;

Parameters

index
Integer value used to access a dimension of the structure.

Return Value

Returns a TYPE& reference.

CDXVec::operator [] ( long index )

CDXVec Class

Accesses a dimension of the structure by index.

Syntax

TYPE& operator[]( long index ) const;

Parameters

index
Long value used to access a dimension of the structure.

Return Value

Returns a TYPE& reference.

CDXVec::operator [] ( USHORT index )

CDXVec Class

Accesses a dimension of the structure by index.

Syntax

TYPE& operator[]( USHORT index ) const;

Parameters

index
USHORT value used to access a dimension of the structure.

Return Value

Returns a TYPE& reference.

CDXVec::operator [] ( DWORD index )

CDXVec Class

Accesses a dimension of the structure by index.

Syntax

TYPE& operator[]( DWORD index ) const;

Parameters

index
DWORD value used to access a dimension of the structure.

Return Value

Returns a TYPE& reference.

CDXVec::operator =

CDXVec Class

Assigns components of one vector to another vector.

Syntax

void operator=( const CDXV_C &srcVector );

Parameters

srcVector
Source vector.

Return Value

No return value.

CDXVec::operator !=

CDXVec Class

Tests for inequality of two vectors.

Syntax

BOOL operator!=( const CDXV_C &otherVector ) const;

Parameters

otherVector
Vector passed in to be tested.

Return Value

Returns TRUE if the vector objects are not equal. Returns FALSE if the vector objects are equal.

CDXVec::operator +

CDXVec Class

Adds two vectors, returning a resultant vector.

Syntax

CDXV_C operator+( const CDXV_C &v );

Parameters

v
Vector passed in to be added.

Return Value

Returns a CDXV_C result.

CDXVec::operator -

CDXVec Class

Subtracts two vectors, returning a resultant vector.

Syntax

CDXV_C operator-( const CDXV_C &v );

Parameters

v
Vector passed in to be subtracted.

Return Value

Returns a CDXV_C result.

CDXVec::operator +=

CDXVec Class

Increments a vector with another vector.

Syntax

void operator+=( const CDXV_C &vOther );

Parameters

vOther
Vector passed in to be added.

Return Value

No return value.

CDXVec::operator -=

CDXVec Class

Decrements a vector with another vector.

Syntax

void operator-=( const CDXV_C &vOther );

Parameters

vOther
Vector passed in to be subtracted.

Return Value

No return value.

CDXVec::operator ==

CDXVec Class

Tests for equality of two vectors.

Syntax

BOOL operator==( const CDXV_C &otherVector ) const;

Parameters

otherVector
Vector passed in to be tested.

Return Value

Returns TRUE if the vector objects are equal. Returns FALSE if the vector objects are not equal.

CDXVec::ZeroVector

CDXVec Class

Sets all components of a vector to zero.

Syntax

void ZeroVector( void );

Return Value

No return value.


Top of Page Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.