ObjectSignalEvent.h 756 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef OBJECTSIGNALEVENT_H
  2. #define OBJECTSIGNALEVENT_H
  3. #include <iostream>
  4. #include <iomanip>
  5. #include <string>
  6. #include <vector>
  7. #include <map>
  8. #include <ctime>
  9. #include <functional>
  10. #include "SignalEvent.h"
  11. using namespace std;
  12. /*
  13. ObjectSignalEvent is an event that contains data of a specific type which can be passed on in a handler
  14. */
  15. template<class T>
  16. class ObjectSignalEvent: public SignalEvent{
  17. public:
  18. //create signalevent with the corresponding data
  19. ObjectSignalEvent(string n, T* data);
  20. ObjectSignalEvent(ObjectSignalEvent& other);
  21. ~ObjectSignalEvent();
  22. //create clone of signal event
  23. SignalEvent* clone();
  24. //get the data passed on in the event
  25. T* getData() const;
  26. public:
  27. //data of the event as a pointer
  28. T* data;
  29. };
  30. #endif