CASGetCoefficient Class Reference
[SupportClasses]

Gets the coefficient of an operands vector. More...

#include <casfuncobj.h>

List of all members.

Public Member Functions

 CASGetCoefficient (const CASGetCoefficient &o)
 Copy constructor.
 CASGetCoefficient ()
 Constructor.
void operator() (CASObject *o)
 Function operator for retrieving the coefficient.
const CASGetCoefficientoperator= (const CASGetCoefficient &o)
 Assignment operator.
const CASObjectResult () const
 Returns the pointer to the coefficient.

Private Attributes

const CASObjectcoe
 Pointer to the CASObject denoting the coefficient.


Detailed Description

This class is used in conjunction with a std::for_each statement, in order to retrieve the coefficient out of a operands vector. If the search was successful, the address of the operand is returned by calling CASGetCoefficient::Result(). CASGetCoefficient::Result() returns 0 ('zero') if no coefficient was found.

However, this function object returns only the first coefficient found.

Be aware, the coefficient is not cloned, thus the pointer returned points to the same object as the pointer in the vector does. Freeing that object from memory would have severe consequences.

Definition at line 595 of file casfuncobj.h.


Constructor & Destructor Documentation

CASGetCoefficient::CASGetCoefficient (  )  [inline]

Initializes coe to 0 ('zero').

Definition at line 613 of file casfuncobj.h.

CASGetCoefficient::CASGetCoefficient ( const CASGetCoefficient o  )  [inline]

Copy constructor.

Parameters:
o Reference to CASGetCoefficient.

Definition at line 621 of file casfuncobj.h.


Member Function Documentation

void CASGetCoefficient::operator() ( CASObject o  )  [inline]

This function operator checks whether or not o is a coefficient by calling CASMetaInfo::IsCoefficient().

However, only the first pointer to a coefficient is put into coe.

Parameters:
o Pointer to a CASObject which is checked for being a coefficient.
Returns:
void.

Definition at line 646 of file casfuncobj.h.

const CASGetCoefficient& CASGetCoefficient::operator= ( const CASGetCoefficient o  )  [inline]

Assignment operator.

Parameters:
o Reference to CASGetCoefficient.

Definition at line 661 of file casfuncobj.h.

const CASObject* CASGetCoefficient::Result (  )  const [inline]

Returns the pointer to the coefficient, if any, else 0 ('zero').

Returns:
the pointer to the CASObject denoting the coefficient, 0 ('zero') if no coefficient is present.

Definition at line 631 of file casfuncobj.h.


Member Data Documentation

const CASObject* CASGetCoefficient::coe [private]

This holds the pointer to the coefficient CASObject. It is the same pointer as the one in the operands vector, therefore no freeing is done by this class for that pointer. It is assumed that the class the coefficient belongs to takes care of freeing memory.

Definition at line 606 of file casfuncobj.h.


The documentation for this class was generated from the following file:
Generated on Sun Dec 31 01:57:30 2006 for ECAS by  doxygen 1.4.7