Created
September 20, 2013 09:36
-
-
Save clooth/6635219 to your computer and use it in GitHub Desktop.
example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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