MCPcopy Create free account
hub / github.com/MITK/MITK / AddDeleteEventObserver

Method AddDeleteEventObserver

Modules/Core/include/mitkWeakPointer.h:223–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221
222 private:
223 void AddDeleteEventObserver()
224 {
225 if (nullptr != m_RawPointer)
226 {
227 auto command = itk::SimpleMemberCommand<WeakPointer>::New();
228 command->SetCallbackFunction(this, &WeakPointer::OnDeleteEvent);
229
230 using TWithoutConst = typename std::remove_const_t<T>;
231 //cast the pointer to non const before adding the observer. This is done to ensure that
232 //weak pointer also supports const pointers.
233 auto nonConstPointer = const_cast<TWithoutConst*>(m_RawPointer);
234 m_ObserverTag = nonConstPointer->AddObserver(itk::DeleteEvent(), command);
235 }
236 }
237
238 void RemoveDeleteEventObserver()
239 {

Callers 2

WeakPointerMethod · 0.95
WeakPointerClass · 0.95

Calls 2

AddObserverMethod · 0.80
NewFunction · 0.70

Tested by

no test coverage detected