34#include <Pt/Allocator.h>
109 template <
typename EventT>
112 void* mem = allocator.
allocate(
sizeof(EventT) );
113 EventT* pev =
new (mem) EventT(ev);
119 template <
typename EventT>
150 {
return typeid(T); }
154 void* pEvent = allocator.
allocate(
sizeof(T));
155 return *(
new (pEvent)T(*
static_cast<const T*
>(
this)));
Allocator interface.
Definition Allocator.h:82
virtual void * allocate(std::size_t size)
Allocates size bytes of memory.
Definition Allocator.h:96
virtual void deallocate(void *p, std::size_t)
Deallocates memory of size bytes.
Definition Allocator.h:103
virtual Event & onClone(Allocator &allocator) const
Clones this event using an allocator.
Definition Event.h:152
virtual const std::type_info & onTypeInfo() const
Returns the type info for this class of events.
Definition Event.h:149
virtual void onDestroy(Allocator &allocator)
Destroys this event using an allocator.
Definition Event.h:158
virtual void onDestroy(Allocator &allocator)=0
Destroys this event using an allocator.
virtual Event & onClone(Allocator &allocator) const =0
Clones this event using an allocator.
static void destruct(EventT &ev, Allocator &allocator)
Destructs an event using an allocator.
Definition Event.h:120
Event()
Constructor.
Definition Event.h:91
virtual ~Event()
Destructor.
Definition Event.h:70
void destroy(Allocator &allocator)
Destroys this event using an allocator.
Definition Event.h:80
static Event & copyConstruct(const EventT &ev, Allocator &allocator)
Copies an event using an allocator.
Definition Event.h:110
const std::type_info & typeInfo() const
Returns the type info for this class of events.
Definition Event.h:85
Event & clone(Allocator &allocator) const
Clones this event using an allocator.
Definition Event.h:75
virtual const std::type_info & onTypeInfo() const =0
Returns the type info for this class of events.
Core module.
Definition Allocator.h:33