Planeshift
psToggle Class Reference

Simple Toggle with callback functionality. More...

#include <pstoggle.h>

Public Member Functions

void Activate ()
 Set Toggle to true. More...
 
void Deactivate ()
 Set Toggle to false. More...
 
bool GetToggle ()
 Get Toggle returns state. More...
 
 psToggle ()
 Constructor - default state is true. More...
 
void RemoveCallback ()
 Remove the callback. More...
 
void SetCallback (void(*object), void(*function)(void *))
 Sets a Callback to a object function. More...
 
void SetToggle (bool newstate)
 Set Toggle. More...
 
 ~psToggle ()
 Destructor. More...
 

Detailed Description

Simple Toggle with callback functionality.

Calls the callback function on toggle state change. Dont forget to remove the callback if you destroy the object it points to.

Definition at line 38 of file pstoggle.h.

Constructor & Destructor Documentation

psToggle::psToggle ( )

Constructor - default state is true.

psToggle::~psToggle ( )

Destructor.

Member Function Documentation

void psToggle::Activate ( )

Set Toggle to true.

void psToggle::Deactivate ( )

Set Toggle to false.

bool psToggle::GetToggle ( )

Get Toggle returns state.

void psToggle::RemoveCallback ( )

Remove the callback.

void psToggle::SetCallback ( void *  object,
void(*)(void *)  function 
)

Sets a Callback to a object function.

Parameters
objectpointer to the object
functionpointer to a static void function within the object
void psToggle::SetToggle ( bool  newstate)

Set Toggle.

Parameters
newstatetrue or false

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