12#ifndef ARCANE_UTILS_AUTODESTROYUSERDATA_H
13#define ARCANE_UTILS_AUTODESTROYUSERDATA_H
17#include "arcane/utils/IUserData.h"
33 static void destroy(T* t) {
delete t; }
51template <
typename T,
typename DestroyBehaviour = DeleteOnDestroyBehaviour<T>>
52class AutoDestroyUserData
57 AutoDestroyUserData(T* adata)
63 ~AutoDestroyUserData()
73 DestroyBehaviour::destroy(m_data);
78 T* data() {
return m_data; }
virtual void notifyAttach()
Method executed when the instance is attached.
virtual void notifyDetach()
Method executed when the instance is detached.
Interface for user data attached to another object.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --