Skip to content

Instantly share code, notes, and snippets.

@leffuy
Created November 7, 2011 23:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leffuy/1346525 to your computer and use it in GitHub Desktop.
Save leffuy/1346525 to your computer and use it in GitHub Desktop.
Additions made from work
//Class: Master Control Implementation
//Author: Stevie
//Description: Use this class as the main implementation of the master control
//and aggregate mini-kernel. Place extensions here if needed.
#include <vector.h>
class MasterControlImpl: public MasterControl{
public:
//Queue control
virtual void pumpQueue();
virtual void pushToQueue(BaseEvent* event);
virtual void dumpQueue();
//Controller aggregation and assignment
virtual int addController(BaseController* controller);
virtual void removeController(int iD);
//the two master controllers
virtual void assignRender(int (*renderFunc)(void));
virtual void assignFrame(int (*frameFunc)(void));
//hillside
virtual void registerController(BaseEvent* event, int iD);
virtual void unregisterController(int iD);
private:
std::vector<BaseEvent*> eventQueue;
std::vector<BaseController*> controllerRegistry;
std::vector<RegistryEntry> indexRegistry;
};
//This class is just a hack until there is a better way of doing key value
//stores in memory with sufficient abstraction and efficiency, and not a
//sacrifice between the two
class RegistryEntry{
public:
RegistryEntry(int controlID, int eventID);
int getControlID();
int getEventID();
private:
static int controlID = 0;
static int eventID = 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment