UUID.cpp
Go to the documentation of this file.
00001 // -*- C++ -*-
00020 #include <coil/UUID.h>
00021 
00022 namespace coil
00023 {
00024   //------------------------------------------------------------
00025   // UUID class
00026   //------------------------------------------------------------
00034   UUID::UUID()
00035     : m_uuidstr(0)
00036   {
00037   }
00038   
00046   UUID::UUID(const uuid_t& uuid)
00047     : m_uuid(uuid), m_uuidstr(0)
00048   {
00049   }
00050 
00058   UUID::~UUID()
00059   {
00060     ::RpcStringFreeA((RPC_CSTR*)&m_uuidstr);
00061   }
00062 
00070   const char* UUID::to_string()
00071   {
00072     if(::UuidToStringA(&m_uuid, (RPC_CSTR*)&m_uuidstr)
00073        != RPC_S_OK)
00074       {
00075         return 0;
00076       }
00077     else
00078       {
00079         return m_uuidstr;
00080       }
00081   }
00082     
00083   //------------------------------------------------------------
00084   // UUID_Generator class
00085   //------------------------------------------------------------
00095   UUID_Generator::UUID_Generator()
00096   {
00097   }
00105   UUID_Generator::~UUID_Generator()
00106   {
00107   }
00108 
00116   void UUID_Generator::init()
00117   {
00118   }
00119 
00127   UUID* UUID_Generator::generateUUID(int n, int h)
00128   {
00129     uuid_t uuid;
00130     if(::UuidCreate(&uuid) != RPC_S_OK)
00131       {
00132         return 0;
00133       }
00134     else
00135       {
00136         return new UUID(uuid);
00137       }
00138   }
00139 }; // coil


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Thu Aug 27 2015 14:16:39