You.i Engine
YiDeferredDeletionEvent.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2020. All rights reserved.
2 #ifndef _YI_DEFERRED_DELETION_EVENT_H
3 #define _YI_DEFERRED_DELETION_EVENT_H
4 
5 #include "event/YiEvent.h"
6 
16 {
17 public:
19 
23  virtual void Delete() = 0;
24 };
25 
29 template<typename YI_TYPE, typename SfinaeHelper = void>
31 {
32 public:
36  CYIDeferredDeletionEvent(std::unique_ptr<YI_TYPE> m_pPtr)
37  : m_pPtr(std::move(m_pPtr))
38  {
39  }
40 
44  virtual void Delete() override
45  {
46  m_pPtr.reset();
47  }
48 
49  std::unique_ptr<YI_TYPE> m_pPtr;
50 };
51 
56 #endif // _YI_DEFERRED_DELETION_EVENT_H
std::unique_ptr< YI_TYPE > m_pPtr
Definition: YiDeferredDeletionEvent.h:49
Base class for events.
Definition: YiEvent.h:27
STL namespace.
virtual void Delete() override
Definition: YiDeferredDeletionEvent.h:44
Event for handling deferred deletion of data of type YI_TYPE. SfinaeHelper type is used to control a ...
Definition: YiDeferredDeletionEvent.h:30
Abstract event for handling deferred deletion of data.
Definition: YiDeferredDeletionEvent.h:15
CYIDeferredDeletionEvent(std::unique_ptr< YI_TYPE > m_pPtr)
Definition: YiDeferredDeletionEvent.h:36