X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5ed37babb2fa9097abe82df299c0aa259ed84d5a..bfffef69e1b0554d13eec920f1a32f75b49ceac6:/include/xbt/Extendable.hpp diff --git a/include/xbt/Extendable.hpp b/include/xbt/Extendable.hpp index eb205def7e..54adb3e65d 100644 --- a/include/xbt/Extendable.hpp +++ b/include/xbt/Extendable.hpp @@ -7,14 +7,13 @@ #ifndef SIMGRID_XBT_LIB_HPP #define SIMGRID_XBT_LIB_HPP -#include "xbt/base.h" // XBT_ATTRIB_DEPRECATED_v334 #include #include #include +#include #include -namespace simgrid { -namespace xbt { +namespace simgrid::xbt { template class Extension; template class Extendable; @@ -110,10 +109,8 @@ public: extensions_[0]=data; } template D* get_data() const { return static_cast(extensions_[0]); } - XBT_ATTRIB_DEPRECATED_v334("Please use typed template Extendable::get_data<>()") void* get_data() const - { - return get_data(); - } + template std::unique_ptr get_unique_data() { return std::unique_ptr(get_data()); } + // Convenience extension access when the type has an associated EXTENSION ID: template U* extension() const { return extension(U::EXTENSION_ID); } template void extension_set(U* p) { extension_set(U::EXTENSION_ID, p); } @@ -121,7 +118,6 @@ public: // Initialized with a first element, to save space for void* user data template std::vector> Extendable::deleters_{1}; -} -} +} // namespace simgrid::xbt #endif