Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

mcExpContainer Class Reference

#include <ExpContainer.h>

Inheritance diagram for mcExpContainer:

Inheritance graph
[legend]
Collaboration diagram for mcExpContainer:

Collaboration graph
[legend]
List of all members.

Detailed Description

Implements the ExpContainers in the program using a mcPolynomial to hold as content any polynomial.

ExpContainer derives from mcExpElement because it can have an exponent. Because of its nature (a mcExpElement and a container for a mcPolynomial class), this class is very simple because it recalls methods of the underlying class. The only problem for this class is the ExpContainer's height: ExpContainers must be adaptable to the height of the contained expression.

Definition at line 350 of file ExpContainer.h.

Public Member Functions

bool data_isValidContainerFor (mcElementType t) const
 Returns TRUE if this element can safely contain the given element type.
mcWRAPPER void data_SetContent (const mcPolynomial &p)
mcWRAPPER void data_AddElements (mcElement *p, int num, int pos=-1, bool bOverwrite=FALSE)
mcWRAPPER mcElement data_AddNewElement (mcElementType t, bool bOverwrite=FALSE, int pos=-1)
mcWRAPPER mcPolynomial & data_GetContent ()
mcWRAPPER const mcPolynomial & data_GetConstContent () const

Private Member Functions

 mcDEFINE_ABSTRACT_CLASS (ExpContainer, mcExpElement)


Member Function Documentation

mcWRAPPER void mcExpContainer::data_AddElements (  mcElement *  p,
int  num,
int  pos = -1,
bool  bOverwrite = FALSE
)  [inline]
 

Definition at line 361 of file ExpContainer.h.

References mcWRAPPER.

Referenced by mcPolynomialHelpers::data_AddNewMonomial().

mcWRAPPER mcElement mcExpContainer::data_AddNewElement (  mcElementType  t,
bool  bOverwrite = FALSE,
int  pos = -1
)  [inline]
 

Definition at line 363 of file ExpContainer.h.

References mcWRAPPER.

mcWRAPPER const mcPolynomial& mcExpContainer::data_GetConstContent (   )  const [inline]
 

Definition at line 367 of file ExpContainer.h.

References mcWRAPPER.

Referenced by mcExpContainerHelpers::math_CanBeDivBy().

mcWRAPPER mcPolynomial& mcExpContainer::data_GetContent (   )  [inline]
 

Definition at line 366 of file ExpContainer.h.

References mcWRAPPER.

Referenced by mcFunctionHelpers::gui_Setup(), mcExpContainerHelpers::math_Add(), mcExpContainerHelpers::math_CanBeAddedWith(), mcExpContainerHelpers::math_CanBeMultWith(), mcPolynomialHelpers::math_DistributeBracket(), mcExpContainerHelpers::math_DivideBaseOnlyBy(), mcPolynomialHelpers::math_FactoreOut(), mcExpContainerHelpers::math_MultiplyBaseOnlyBy(), and mcExpElementHelpers::math_SimplifyExp().

bool mcExpContainer::data_isValidContainerFor (  mcElementType  t  )  const [inline, virtual]
 

Returns TRUE if this element can safely contain the given element type.

Without this function a lot of errors could be undetectable:

        mcPolynomial pol; // creates a new polynomial
        mcElement e(pol); // references it
        [...]    // the programmers forgots what "e" references
        mcFraction f(e);  // mcFraction wraps a mcPolynomialHelpers class !
        f.data_GetNum();  // CRASH

This function must be overridden by mcElement-derived classes in order to provide a list of the mcElementType it can safely contain.

Reimplemented from mcExpElement.

Reimplemented in mcBracket, and mcRadical.

Definition at line 356 of file ExpContainer.h.

References mcET_BRACKET, and mcET_RADICAL.

mcWRAPPER void mcExpContainer::data_SetContent (  const mcPolynomial &  p  )  [inline]
 

Definition at line 359 of file ExpContainer.h.

References mcWRAPPER.

Referenced by mcPolynomialHelpers::data_ReplaceParentheses(), mcPolynomialHelpers::math_EmbedInBracket(), mcElementArrayHelpers::math_EmbedInBracket(), mcElementArrayHelpers::math_EmbedInRadical(), mcFractionHelpers::math_Simplify(), mcBracket::mcBracket(), and mcRadical::mcRadical().

mcExpContainer::mcDEFINE_ABSTRACT_CLASS (  ExpContainer  ,
mcExpElement 
)  [private]
 


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

Documentation generated with Doxygen on Sun Feb 6 17:12:33 2005
Visit MathStudio home page for more info

[ Top ]