cxWidgets 1.0
Public Member Functions | List of all members
cx::cxFunction Class Referenceabstract

Base class for cxFunction2 and cxFunction4. This class is pure. More...

#include <cxFunction.h>

Inheritance diagram for cx::cxFunction:
Inheritance graph
Collaboration diagram for cx::cxFunction:
Collaboration graph

Public Member Functions

 cxFunction (bool pUseReturnVal, bool pExitAfterRun, bool pRunOnLeaveFunction)
 Constructor.
 
virtual ~cxFunction ()
 
virtual bool functionIsSet () const =0
 
virtual std::string runFunction () const =0
 Runs the function pointed to by the cxFunction. This is a.
 
virtual void * getFuncPtr () const =0
 
virtual bool getUseReturnVal () const
 Accessor for whether the caller should use the return value.
 
virtual void setUseReturnVal (bool pUseReturnVal)
 Setter for whether or not the caller should make use of the return value.
 
virtual bool getExitAfterRun () const
 Accessor for whether the caller should exit after the function.
 
virtual void setExitAfterRun (bool pExitAfterRun)
 Setter for whether or not the caller should quit what.
 
virtual bool getRunOnLeaveFunction () const
 Accessor for whether the caller should run its onLeave function.
 
virtual void setRunOnLeaveFunction (bool pRunOnLeaveFunction)
 Setter for whether or not the caller should run its.
 
virtual std::string cxTypeStr () const =0
 Returns the name of the class (either "cxFunction2".
 

Detailed Description

Base class for cxFunction2 and cxFunction4. This class is pure.

virtual, and this can be used in collections where a set of

cxFunction2 and/or cxFunction4 objects are needed.

Constructor & Destructor Documentation

◆ cxFunction()

cx::cxFunction::cxFunction ( bool  pUseReturnVal,
bool  pExitAfterRun,
bool  pRunOnLeaveFunction 
)

Constructor.

Parameters
pUseReturnValWhether or not the caller should use the return value of the function
pExitAfterRunWhether or not the caller should exit after the function is run
pRunOnLeaveFunctionWhether or not the caller should run its onLeave function after the function runs (if pExitAfterRun is true)

◆ ~cxFunction()

cx::cxFunction::~cxFunction ( )
virtual

Member Function Documentation

◆ cxTypeStr()

virtual std::string cx::cxFunction::cxTypeStr ( ) const
pure virtual

Returns the name of the class (either "cxFunction2".

or "cxFunction4", depending on the derived implementation).

Returns
The name of the cxWidgets class.

Implemented in cx::cxFunction0, cx::cxFunction2, cx::cxFunction4, cx::cxFunction2Templated< T1, T2 >, cx::cxFunction1RefTemplated< T1 >, cx::cxFunction2RefTemplated< T1, T2 >, cx::cxFunction3RefTemplated< T1, T2, T3 >, cx::cxFunction4Templated< T1, T2, T3, T4 >, and cx::cxFunction4RefTemplated< T1, T2, T3, T4 >.

◆ functionIsSet()

virtual bool cx::cxFunction::functionIsSet ( ) const
pure virtual

Returns whether the internal function pointer is set (non-null).

Returns
Returns true if the internal function pointer is set (not null), or false otherwise.

Implemented in cx::cxFunction0, cx::cxFunction2, cx::cxFunction4, cx::cxFunction2Templated< T1, T2 >, cx::cxFunction1RefTemplated< T1 >, cx::cxFunction2RefTemplated< T1, T2 >, cx::cxFunction3RefTemplated< T1, T2, T3 >, cx::cxFunction4Templated< T1, T2, T3, T4 >, and cx::cxFunction4RefTemplated< T1, T2, T3, T4 >.

◆ getExitAfterRun()

bool cx::cxFunction::getExitAfterRun ( ) const
virtual

Accessor for whether the caller should exit after the function.

is run.

Returns
Whether or not the caller should exit after the function is run

◆ getFuncPtr()

virtual void * cx::cxFunction::getFuncPtr ( ) const
pure virtual

◆ getRunOnLeaveFunction()

bool cx::cxFunction::getRunOnLeaveFunction ( ) const
virtual

Accessor for whether the caller should run its onLeave function.

after the function is run (if exitAfterRun is true).

Returns
Whether or not the caller should run its onLeav function after the function is run (if exitAfterRun is true).

◆ getUseReturnVal()

bool cx::cxFunction::getUseReturnVal ( ) const
virtual

Accessor for whether the caller should use the return value.

of the function.

Returns
Whether or not the caller should use the return value of the function

◆ runFunction()

virtual std::string cx::cxFunction::runFunction ( ) const
pure virtual

Runs the function pointed to by the cxFunction. This is a.

pure virtual method and must be overridden in deriving classes.

Returns
Returns return value of function pointed to if pointer is not null, otherwise returns empty string.

Implemented in cx::cxFunction0, cx::cxFunction2, cx::cxFunction4, cx::cxFunction2Templated< T1, T2 >, cx::cxFunction1RefTemplated< T1 >, cx::cxFunction2RefTemplated< T1, T2 >, cx::cxFunction3RefTemplated< T1, T2, T3 >, cx::cxFunction4Templated< T1, T2, T3, T4 >, and cx::cxFunction4RefTemplated< T1, T2, T3, T4 >.

◆ setExitAfterRun()

void cx::cxFunction::setExitAfterRun ( bool  pExitAfterRun)
virtual

Setter for whether or not the caller should quit what.

it's doing (i.e., input loops, etc.) after the function is run.

Parameters
pExitAfterRunWhether or nto the caller should quit what it's doing after the function is run.

◆ setRunOnLeaveFunction()

void cx::cxFunction::setRunOnLeaveFunction ( bool  pRunOnLeaveFunction)
virtual

Setter for whether or not the caller should run its.

onLeave function when it exits after running the function.

This is useful if mExitAfterRun is true.

Parameters
pRunOnLeaveFunctionWhether or not the caller should run its onLeave function when it exits after running the function.

◆ setUseReturnVal()

void cx::cxFunction::setUseReturnVal ( bool  pUseReturnVal)
virtual

Setter for whether or not the caller should make use of the return value.

Parameters
pUseReturnValWhether or nto the caller should make use of the return value

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