Planeshift
|
Simple Toggle with callback functionality. More...
#include <pstoggle.h>
Public Member Functions | |
void | Activate () |
Set Toggle to true. | |
void | Deactivate () |
Set Toggle to false. | |
bool | GetToggle () |
Get Toggle returns state. | |
psToggle () | |
Constructor - default state is true. | |
void | RemoveCallback () |
Remove the callback. | |
void | SetCallback (void(*object), void(*function)(void *)) |
Sets a Callback to a object function. | |
void | SetToggle (bool newstate) |
Set Toggle. | |
~psToggle () | |
Destructor. |
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.
psToggle::psToggle | ( | ) |
Constructor - default state is true.
psToggle::~psToggle | ( | ) |
Destructor.
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.
object | pointer to the object |
function | pointer to a static void function within the object |
void psToggle::SetToggle | ( | bool | newstate | ) |
Set Toggle.
newstate | true or false |