7 #ifndef __FWTOOLS_FWID_HPP__ 8 #define __FWTOOLS_FWID_HPP__ 10 #include "fwTools/config.hpp" 12 #include <fwCore/base.hpp> 13 #include <fwCore/mt/types.hpp> 17 #include <unordered_map> 26 class FWTOOLS_CLASS_API
fwID 32 typedef std::string IDType;
47 FWTOOLS_API
static bool exist( IDType _id);
55 FWTOOLS_API virtual ~
fwID();
64 FWTOOLS_API
bool hasID() const;
75 FWTOOLS_API IDType getID( Policy policy = GENERATE ) const;
82 FWTOOLS_API virtual
void setID( IDType newID );
88 FWTOOLS_API
void resetID();
103 IDType generate()
const;
109 static void removeIDfromDictionary(IDType _id );
115 static bool isIdFound( IDType _id);
121 void addIDInDictionary( IDType newID );
125 typedef std::unordered_map< IDType, WPTR(::fwTools::Object ) > Dictionary;
126 typedef std::unordered_map< std::string, std::uint32_t > CategorizedCounter;
128 static Dictionary m_dictionary;
129 static CategorizedCounter m_CategorizedCounter;
132 static ::fwCore::mt::ReadWriteMutex s_dictionaryMutex;
135 static ::fwCore::mt::Mutex s_mutexCounter;
138 mutable ::fwCore::mt::ReadWriteMutex m_idMutex;
#define fwCoreBaseClassDefinitionsMacro(_classinfo_)
Generate common code for a base class (Interfaces, Abstract classes, ...)