36 std::size_t
uid()
const ;
42 std::shared_ptr<T>
event()
const ;
60 const std::type_index &
type()
const ;
68 void setEvent( std::shared_ptr<T> evt ) ;
85 template <
typename T,
typename ...Args>
86 std::shared_ptr<T>
allocate(Args && ...args) ;
129 template <
typename T>
131 return std::static_pointer_cast<T>(
_event ) ;
136 template <
typename T>
138 _eventType = std::type_index(
typeid(
nullptr) ) ;
139 return std::static_pointer_cast<T>(
_event ) ;
144 template <
typename T>
147 return (std::type_index(
typeid(T)) ==
_eventType) ;
158 template <
typename T>
166 template <
typename T>
169 _event = std::shared_ptr<T>( evt ) ;
172 _event = std::shared_ptr<T>( evt, [](T *ptr){} ) ;
179 template <
typename T,
typename ...Args>
181 auto ptr = std::make_shared<T>( args... ) ;
189 _eventType = std::type_index(
typeid(
nullptr)) ;
Extensions _extensions
The event extensions.
std::shared_ptr< T > event() const
Get the underlying event to a specific type.
std::size_t uid() const
Get the event unique id.
std::type_index _eventType
The event implementtion type.
void setEvent(std::shared_ptr< T > evt)
Set the event pointer using a shared pointer.
void reset()
Reset the internal pointer.
bool isType() const
Check whether the stored event is of a given type.
EventStore & operator=(const EventStore &)=delete
void setBareEvent(T *evt, bool owner)
Set the event pointer using a bare pointer and an ownership flag.
Extensions & extensions()
Access the event extensions.
std::shared_ptr< void > _event
The underlying event store implementation.
const std::type_index & type() const
Get the event type.
std::shared_ptr< T > takeEvent()
Get the underlying event to a specific type.
void setUID(std::size_t uid)
Set the event unique id.
std::shared_ptr< T > allocate(Args &&...args)
Allocate a new event in the event store and return it.