#include <MathHelpers.h>
Inheritance diagram for mcAbstractArray:
This class should be used as parent class for specialized arrays.
Definition at line 75 of file MathHelpers.h.
Public Member Functions | |
mcAbstractArray () | |
The constructor; does nothing. | |
virtual | ~mcAbstractArray () |
The destructor. | |
void | data_Check () const |
Checks the array integrity. | |
Insert/Remove functions | |
Core array-management functions. | |
void | data_Add (mcAbstractItem *pointer) |
math_Adds a pointer to the array. | |
void | data_Insert (mcAbstractItem *pointer, int n) |
Inserts a pointer immediately before the n-th entry. | |
void | data_SetItem (mcAbstractItem *pointer, int n) |
Removes the n-th object of the array (using data_Delete) and replaces it with the given pointer. | |
void | data_RemoveAt (int idx, int count=1) |
Removes count elements starting from the idx-th entry of the array. | |
void | data_Remove (const mcAbstractItem *p) |
Removes the given element if the data_Find() function returns a valid index. | |
mcAbstractItem * | data_Detach (int idx) |
Detaches the i-th pointer and then returns it to the caller. | |
void | data_Clear () |
Removes all the elements of the array and free the memory occupied. | |
void | data_DeepCopy (const mcAbstractArray &arr) |
Copies all the pointers in the given array; uses the data_GetCopyOf function to populate this array. | |
mcAbstractItem * | data_GetItem (int idx) |
Returns a non-CONST pointer to the idx-th element of the array. | |
const mcAbstractItem * | data_GetItem (int idx) const |
Returns a CONST pointer to the idx-th element of the array. | |
Query function | |
Miscellaneous aray-access functions. | |
bool | data_isEmpty () const |
Returns TRUE if the array does not contain pointers. | |
int | data_GetCount () const |
Returns the number of objects contained. | |
int | data_Find (const mcAbstractItem *pointer) const |
Returns the index of the given pointer in this array or -1 if the given pointer is not stored in the array. | |
Protected Member Functions | |
virtual void | data_Delete (int n)=0 |
Deletes the n-th entry of the array. | |
virtual mcAbstractItem * | data_GetCopyOf (int) const |
Copies the n-th object of the array and returns a pointer to it. | |
virtual void | data_OnArrayChange () |
This is a callback-like function called each time the array is modified (this does not mean *each* time a non-CONST function is called: RemoveAt(0, 0) would not trigger this function). | |
Private Attributes | |
wxArrayPtrVoid | m_arr |
The array containing the pointers to the abstract items. |
|
The constructor; does nothing.
Definition at line 98 of file MathHelpers.h. |
|
The destructor.
Definition at line 104 of file MathHelpers.h. |
|
math_Adds a pointer to the array. The caller should never delete that pointer (it's owned from the array). Definition at line 76 of file MathHelpers.cpp. References data_OnArrayChange(), and m_arr. Referenced by mcExtRange::data_Add(), mcSystemStepArray::data_AddFinalSys(), mcSystemStepArray::data_AddKeyLine(), mcSystemStepArray::data_AddLine(), mcMathAndSystemHelpers::data_AddLine(), mcSymbolArray::data_AddSymbol(), mcSystemStepArray::data_AddSys(), mcMathOrSystemHelpers::data_AddSys(), mcSystemStepArray::data_AddSysOnlyIfComplexEnough(), data_DeepCopy(), mcMathOrSystemHelpers::io_ImportToken(), mcSolverArray::math_Add(), mcMathOrSystemHelpers::math_AndMerge(), mcSystemStepArray::math_AppendCombinationOf(), mcMathAndSystemHelpers::math_Merge(), and mcMathOrSystemHelpers::math_OrMerge(). |
|
Checks the array integrity.
Reimplemented in mcMathSystemHelpers, mcSolverArray, and mcSystemStepArray. Definition at line 110 of file MathHelpers.h. Referenced by mcSystemStepArray::data_Check(), and mcSolverArray::data_Check(). |
|
Removes all the elements of the array and free the memory occupied.
Definition at line 132 of file MathHelpers.cpp. References data_GetCount(), data_RemoveAt(), and m_arr. Referenced by mcMathCore::CleanupMath(), mcSymbol::CleanupSymbols(), mcExtRange::data_DeepCopy(), data_DeepCopy(), mcMathSystemHelpers::io_ImportInlinedExpr(), mcMathSystemHelpers::io_ImportPresentationMathML(), mcMathOrSystemHelpers::math_AndMerge(), mcMathAndSystemHelpers::math_Merge(), mcMathOrSystemHelpers::math_OrMerge(), mcExtRange::~mcExtRange(), mcMathAndSystemHelpers::~mcMathAndSystemHelpers(), mcMathOrSystemHelpers::~mcMathOrSystemHelpers(), mcSolverArray::~mcSolverArray(), mcSymbolArray::~mcSymbolArray(), and mcSystemStepArray::~mcSystemStepArray(). |
|
Copies all the pointers in the given array; uses the data_GetCopyOf function to populate this array.
Definition at line 148 of file MathHelpers.cpp. References data_Add(), and data_Clear(). Referenced by mcMathSystemHelpers::data_DeepCopy(). |
|
Deletes the n-th entry of the array.
Implemented in mcMathAndSystemHelpers, mcSymbolArray, mcMathOrSystemHelpers, mcExtRange, mcSolverArray, and mcSystemStepArray. Referenced by data_RemoveAt(). |
|
Detaches the i-th pointer and then returns it to the caller.
Definition at line 121 of file MathHelpers.cpp. References data_GetItem(), m_arr, and mcAbstractItem. |
|
Returns the index of the given pointer in this array or -1 if the given pointer is not stored in the array.
Definition at line 140 of file MathHelpers.cpp. References data_GetCount(), and data_GetItem(). Referenced by data_Remove(). |
|
Copies the n-th object of the array and returns a pointer to it. Those arrays which do not need to use #DeepCopy can safely ignore function; a default implementation which returns NULL is provided. Reimplemented in mcMathAndSystemHelpers, mcSymbolArray, and mcMathOrSystemHelpers. Definition at line 88 of file MathHelpers.h. References mcAbstractItem. |
|
Returns the number of objects contained.
Reimplemented in mcMathSystemHelpers. Definition at line 168 of file MathHelpers.h. References m_arr. Referenced by mcSymbolArray::data_AddSymbol(), mcSystemStepArray::data_AddSysOnlyIfComplexEnough(), mcSystemStepArray::data_Check(), mcSolverArray::data_Check(), data_Clear(), data_Find(), mcSymbolArray::data_FindSymbol(), mcMathSystemHelpers::data_GetChildrenCount(), mcSystemStepArray::data_GetLast(), data_RemoveAt(), mcSolverArray::io_GetDescArray(), mcSystemStepArray::io_GetInlinedExpr(), mcSolverArray::math_Contains(), mcExtRange::math_isFinite(), mcSystemStepArray::math_RemoveIdenticSteps(), and mcSystemStepArray::math_RemoveSimpleSteps(). |
|
Returns a CONST pointer to the idx-th element of the array.
Definition at line 154 of file MathHelpers.h. References m_arr, and mcAbstractItem. |
|
Returns a non-CONST pointer to the idx-th element of the array.
Definition at line 151 of file MathHelpers.h. References m_arr, and mcAbstractItem. Referenced by mcMathOrSystemHelpers::data_Delete(), mcMathAndSystemHelpers::data_Delete(), data_Detach(), data_Find(), mcSystemStepArray::data_Get(), mcSolverArray::data_Get(), mcMathSystemHelpers::data_GetConstChild(), mcExtRange::data_GetRange(), and mcSymbolArray::data_GetSymbol(). |
|
Inserts a pointer immediately before the n-th entry.
Definition at line 82 of file MathHelpers.cpp. References data_OnArrayChange(), and m_arr. Referenced by data_SetItem(). |
|
Returns TRUE if the array does not contain pointers.
Definition at line 165 of file MathHelpers.h. References m_arr. |
|
This is a callback-like function called each time the array is modified (this does not mean *each* time a non-CONST function is called: RemoveAt(0, 0) would not trigger this function).
Definition at line 93 of file MathHelpers.h. Referenced by data_Add(), data_Insert(), and data_RemoveAt(). |
|
Removes the given element if the data_Find() function returns a valid index.
Definition at line 113 of file MathHelpers.cpp. References data_Find(), and data_RemoveAt(). Referenced by mcSymbolHelpers::data_Update(). |
|
Removes Unlike wxArray does, this function also deletes, using the data_Delete() function the memory associated with the pointers removed. Definition at line 96 of file MathHelpers.cpp. References data_Delete(), data_GetCount(), data_OnArrayChange(), and m_arr. Referenced by mcSymbol::CheckArray(), mcSymbolArray::data_AddSymbol(), data_Clear(), data_Remove(), data_SetItem(), mcSystemStepArray::math_RemoveIdenticSteps(), and mcSystemStepArray::math_RemoveSimpleSteps(). |
|
Removes the n-th object of the array (using data_Delete) and replaces it with the given pointer. This function is a sort of #Insert which overwrites destination entry. Definition at line 90 of file MathHelpers.cpp. References data_Insert(), and data_RemoveAt(). |
|
The array containing the pointers to the abstract items.
Definition at line 78 of file MathHelpers.h. Referenced by data_Add(), data_Clear(), data_Detach(), data_GetCount(), data_GetItem(), data_Insert(), data_isEmpty(), and data_RemoveAt(). |
[ Top ] |