Skip to content

Instantly share code, notes, and snippets.

@clooth
Created September 20, 2013 09:36
Show Gist options
  • Save clooth/6635219 to your computer and use it in GitHub Desktop.
Save clooth/6635219 to your computer and use it in GitHub Desktop.
example
struct Process
{
Process* next_;
Process* previous_;
void (*function_)(void* caller_ptr, Purpose purpose);
unsigned int id;
Process()
{
previous_ = NULL;
next_ = NULL;
function_ = NULL;
id = 0;
}
~Process()
{
delete previous_;
delete next_;
}
};
class ProcessManager
{
public:
ProcessManager();
~ProcessManager();
int Push( void (*Function)(void* caller_ptr, Purpose Purp), void* caller_ptr = NULL);
bool Pop( unsigned int id, void* caller_ptr = NULL);
bool PopAll( void* caller_ptr = NULL);
bool Process( void* caller_ptr = NULL);
private:
Process* first_process_;
Process* last_process_;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment