#include <casfuncobj.h>
Public Member Functions | |
| CASGetCoefficient (const CASGetCoefficient &o) | |
| Copy constructor. | |
| CASGetCoefficient () | |
| Constructor. | |
| void | operator() (CASObject *o) |
| Function operator for retrieving the coefficient. | |
| const CASGetCoefficient & | operator= (const CASGetCoefficient &o) |
| Assignment operator. | |
| const CASObject * | Result () const |
| Returns the pointer to the coefficient. | |
Private Attributes | |
| const CASObject * | coe |
Pointer to the CASObject denoting the coefficient. | |
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.
| CASGetCoefficient::CASGetCoefficient | ( | ) | [inline] |
Initializes coe to 0 ('zero').
Definition at line 613 of file casfuncobj.h.
| CASGetCoefficient::CASGetCoefficient | ( | const CASGetCoefficient & | o | ) | [inline] |
Copy constructor.
| o | Reference to CASGetCoefficient. |
Definition at line 621 of file casfuncobj.h.
| 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.
| o | Pointer to a CASObject which is checked for being a coefficient. |
Definition at line 646 of file casfuncobj.h.
| const CASGetCoefficient& CASGetCoefficient::operator= | ( | const CASGetCoefficient & | o | ) | [inline] |
Assignment operator.
| 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').
CASObject denoting the coefficient, 0 ('zero') if no coefficient is present. Definition at line 631 of file casfuncobj.h.
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.
1.4.7