Guest User

EventContainer.h

a guest
Apr 22nd, 2015
51
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // EventContainer.h
  2.  
  3. #ifndef _EVENTCONTAINER_h
  4. #define _EVENTCONTAINER_h
  5.  
  6. #if defined(ARDUINO) && ARDUINO >= 100
  7. #include "arduino.h"
  8. #else
  9. #include "WProgram.h"
  10. #endif
  11.  
  12. #include "Event.h"
  13.  
  14. #define INITIAL_CONTAINER_SIZE 4
  15.  
  16. typedef struct
  17. {
  18. Event **events;
  19.  
  20. short count;
  21. short capacity;
  22. } EventContainer;
  23.  
  24. void container_create(EventContainer *container);
  25. void container_free(EventContainer *container);
  26.  
  27. Event *container_get(EventContainer *container, char *eventName);
  28.  
  29. Event* container_create_event(EventContainer *container, char *eventName, byte safe);
  30. void container_add_listener(EventContainer *container, char *eventName, void(*callback)(void *));
  31.  
  32. #endif
RAW Paste Data