cxWidgets 1.0
Public Member Functions | List of all members
cx::cxFunction4 Class Reference

This class is just like cxFunction2, but for functions. More...

#include <cxFunction.h>

Inheritance diagram for cx::cxFunction4:
Inheritance graph
Collaboration diagram for cx::cxFunction4:
Collaboration graph

Public Member Functions

 cxFunction4 (funcPtr4 pFuncPtr=nullptr, void *pParam1=nullptr, void *pParam2=nullptr, void *pParam3=nullptr, void *pParam4=nullptr, bool pUseReturnVal=false, bool pExitAfterRun=false, bool pRunOnLeaveFunction=true)
 Default constructor. All parameters have default values.
 
virtual ~cxFunction4 ()
 
virtual bool functionIsSet () const override
 
void setFunction (funcPtr4 pFuncPtr)
 
funcPtr4 getFunction () const
 Accessor for the internal function pointer.
 
void setParams (void *pParam1, void *pParam2, void *pParam3, void *pParam4)
 
void setParam1 (void *pParam)
 
void setParam2 (void *pParam)
 
void setParam3 (void *pParam)
 
void setParam4 (void *pParam)
 
void * getParam1 () const
 
void * getParam2 () const
 
void * getParam3 () const
 
void * getParam4 () const
 
virtual std::string runFunction () const override
 
virtual void * getFuncPtr () const override
 
virtual std::string cxTypeStr () const override
 Returns the name of the cxWidgets class, "cxFunction4". This can be.
 
- Public Member Functions inherited from cx::cxFunction
 cxFunction (bool pUseReturnVal, bool pExitAfterRun, bool pRunOnLeaveFunction)
 Constructor.
 
virtual ~cxFunction ()
 
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.
 

Detailed Description

This class is just like cxFunction2, but for functions.

with 4 void pointer parameters instead of 2.

Constructor & Destructor Documentation

◆ cxFunction4()

cx::cxFunction4::cxFunction4 ( funcPtr4  pFuncPtr = nullptr,
void *  pParam1 = nullptr,
void *  pParam2 = nullptr,
void *  pParam3 = nullptr,
void *  pParam4 = nullptr,
bool  pUseReturnVal = false,
bool  pExitAfterRun = false,
bool  pRunOnLeaveFunction = true 
)
explicit

Default constructor. All parameters have default values.

available. Note that function must have this signature:

string func(void*, void*)

Parameters
pFuncPtrPointer to the function to be run. Defaults to nullptr.
pParam1The first parameter to pass to the function when it's run - This is a void pointer.
pParam2The second parameter to pass to the function when it's run - This is a void pointer.
pParam3The 3rd parameter to pass to the function when it's run - This is a void pointer.
pParam4The 4th parameter to pass to the function when it's run - This is a void pointer.
pUseReturnValIndicates whether caller will make use of return value. Defaults to false
pExitAfterRunWhether or not the caller should exit from its input loop once the function is done. Defaults to false.
pRunOnLeaveFunctionWhether or not the caller should run its onLeave function when it exits (useful if pExitAfterRun is true). This defaults to true.

◆ ~cxFunction4()

cx::cxFunction4::~cxFunction4 ( )
virtual

Destructor

Member Function Documentation

◆ cxTypeStr()

string cx::cxFunction4::cxTypeStr ( ) const
overridevirtual

Returns the name of the cxWidgets class, "cxFunction4". This can be.

used to determine the type of cxWidgets object that deriving

classes derive from in applications.

Returns
The name of the cxWidgets class ("cxFunction4").

Implements cx::cxFunction.

◆ functionIsSet()

bool cx::cxFunction4::functionIsSet ( ) const
overridevirtual

Returns whether the internal funtion pointer is set.

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

Implements cx::cxFunction.

◆ getFuncPtr()

void * cx::cxFunction4::getFuncPtr ( ) const
overridevirtual

Implements cx::cxFunction.

◆ getFunction()

funcPtr4 cx::cxFunction4::getFunction ( ) const

Accessor for the internal function pointer.

Returns
The internal function pointer

◆ getParam1()

void * cx::cxFunction4::getParam1 ( ) const

Accessor for the first function parameter

Returns
Returns pointer to first parameter

◆ getParam2()

void * cx::cxFunction4::getParam2 ( ) const

Accessor for the second function parameter

Returns
Returns pointer to second parameter

◆ getParam3()

void * cx::cxFunction4::getParam3 ( ) const

Accessor for the 3rd function parameter

Returns
Returns pointer to first parameter

◆ getParam4()

void * cx::cxFunction4::getParam4 ( ) const

Accessor for the 4th function parameter

Returns
Returns pointer to second parameter

◆ runFunction()

string cx::cxFunction4::runFunction ( ) const
overridevirtual

If function pointer is not null, runs the function and returns its return value; If function pointer is nullptr, returns empty string

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

Implements cx::cxFunction.

◆ setFunction()

void cx::cxFunction4::setFunction ( funcPtr4  pFuncPtr)

Sets the internal function pointer

Parameters
pFuncPtrThe function to which to point

◆ setParam1()

void cx::cxFunction4::setParam1 ( void *  pParam)

Sets the first parameter

Parameters
pParamFirst parameter to pass to function

◆ setParam2()

void cx::cxFunction4::setParam2 ( void *  pParam)

Sets the second parameter

Parameters
pParamSecond parameter to pass to function

◆ setParam3()

void cx::cxFunction4::setParam3 ( void *  pParam)

Sets the 3rd parameter

Parameters
pParam3rd parameter to pass to function

◆ setParam4()

void cx::cxFunction4::setParam4 ( void *  pParam)

Sets the 4th parameter

Parameters
pParam4th parameter to pass to function

◆ setParams()

void cx::cxFunction4::setParams ( void *  pParam1,
void *  pParam2,
void *  pParam3,
void *  pParam4 
)

Sets the parameters to pass to the function.

Parameters
pParam1First parameter to pass to function
pParam2Second parameter to pass to function
pParam33rd parameter to pass to function
pParam44th parameter to pass to function

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