00001
00002
00003
00004
00005
00006
00007
00008 #ifndef DCPS_INSTANCEHANDLE_H
00009 #define DCPS_INSTANCEHANDLE_H
00010
00011 #include "ace/Atomic_Op_T.h"
00012 #include "ace/Thread_Mutex.h"
00013
00014 #include "dds/DdsDcpsInfrastructureC.h"
00015
00016 #include "dcps_export.h"
00017
00018 namespace OpenDDS {
00019 namespace DCPS {
00020
00021 const DDS::InstanceHandle_t HANDLE_UNKNOWN(0);
00022
00023 class OpenDDS_Dcps_Export InstanceHandleGenerator {
00024 public:
00025 explicit InstanceHandleGenerator(long begin = HANDLE_UNKNOWN);
00026
00027 ~InstanceHandleGenerator();
00028
00029 DDS::InstanceHandle_t next();
00030
00031 private:
00032 ACE_Atomic_Op<ACE_Thread_Mutex, long> sequence_;
00033 };
00034
00035 }
00036 }
00037
00038 #endif