fw4spl
fwTools::UUID Class Reference

Management of UUID on objects. More...

#include <UUID.hpp>

+ Collaboration diagram for fwTools::UUID:

Public Types

typedef std::string UUIDType
 

Public Member Functions

virtual FWTOOLS_API ~UUID ()
 Destructor : does nothing.
 

Static Public Member Functions

static FWTOOLS_API bool exist (const UUIDType &uuid)
 Return true iff the given uuid is used. More...
 
static FWTOOLS_API const UUIDType & get (::fwTools::Object::sptr object)
 Return an uuid to the given object : if no one previously set then generate a new one. More...
 
static FWTOOLS_API::fwTools::Object::sptr get (const UUIDType &uuid)
 Return a smart ptr on the object related to a given UUID : return null shared if not supervised. More...
 
static FWTOOLS_API UUIDType generateUUID ()
 Return a new extended UUID;. More...
 
static FWTOOLS_API bool set (::fwTools::Object::sptr object, const UUID::UUIDType &uuid)
 Attempt to set an UUID. If uuid already exists, do nothing. More...
 

Protected Types

typedef std::map< UUIDType,::fwTools::Object::wptr > UUIDContainer
 Store association std::weak_ptr <–> uuid as a string.
 

Protected Member Functions

FWTOOLS_API UUID ()
 Default constructor : does nothing.
 

Protected Attributes

::fwCore::mt::ReadWriteMutex m_uuidMutex
 Mutex used to lock uuid object access.
 

Static Protected Attributes

static FWTOOLS_API UUIDContainer s_uuidMap
 

Friends

class ::boost::serialization::access
 
template<class , class >
struct ::boost::python::objects::pointer_holder
 
template<class , class , class >
class ::fwTools::ClassFactory
 
class ::fwTools::Factory
 

Detailed Description

Management of UUID on objects.

Definition at line 24 of file UUID.hpp.

Member Function Documentation

bool fwTools::UUID::exist ( const UUIDType &  uuid)
static

Return true iff the given uuid is used.

Note
This method is thread-safe.

Definition at line 42 of file UUID.cpp.

const UUID::UUIDType & fwTools::UUID::get ( ::fwTools::Object::sptr  object)
static

Return an uuid to the given object : if no one previously set then generate a new one.

Note
This method is thread-safe.

Definition at line 50 of file UUID.cpp.

References generateUUID(), and SLM_ASSERT.

Referenced by fwAtomConversion::DataVisitor::DataVisitor(), ioVTK::SModelSeriesWriter::updating(), and fwVtkIO::ModelSeriesObjWriter::write().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

fwTools::Object::sptr fwTools::UUID::get ( const UUIDType &  uuid)
static

Return a smart ptr on the object related to a given UUID : return null shared if not supervised.

Note
This method thread-safe.

Definition at line 74 of file UUID.cpp.

bool fwTools::UUID::set ( ::fwTools::Object::sptr  object,
const UUID::UUIDType &  uuid 
)
static

Attempt to set an UUID. If uuid already exists, do nothing.

Returns
true if the uuid is set, else false.
Note
This method is thread-safe.

Definition at line 88 of file UUID.cpp.


The documentation for this class was generated from the following files: