00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef BIT_VECTOR_H
00016 #define BIT_VECTOR_H
00017 #include "ace/pre.h"
00018
00019 #include "orbsvcs/Notify/notify_serv_export.h"
00020
00021 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00022 #pragma once
00023 #endif
00024
00025 #include "tao/Versioned_Namespace.h"
00026
00027 #include "ace/Vector_T.h"
00028 #include "ace/Basic_Types.h"
00029
00030 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00031
00032 namespace TAO_Notify
00033 {
00034
00035
00036
00037
00038
00039 class TAO_Notify_Serv_Export Bit_Vector
00040 {
00041 typedef ACE_UINT32 BASIC_UINT_TYPE;
00042 typedef ACE_Vector<BASIC_UINT_TYPE> VECTOR_TYPE;
00043 enum {
00044 BITS_PER_WORD = 32,
00045 BPW_LOG_2 = 5
00046 };
00047 public:
00048
00049
00050 Bit_Vector();
00051
00052 ~Bit_Vector();
00053
00054
00055 bool is_set(const size_t location) const;
00056
00057 void set_bit(const size_t location, bool set);
00058
00059
00060 size_t find_first_bit(bool set) const;
00061
00062 private:
00063
00064 void evaluate_firsts(const size_t location, bool set);
00065
00066
00067 size_t find_first_bit_of(const size_t location, bool set);
00068
00069 private:
00070 VECTOR_TYPE bitvec_;
00071 size_t size_;
00072 size_t first_set_bit_;
00073 size_t first_cleared_bit_;
00074 };
00075
00076 }
00077
00078 TAO_END_VERSIONED_NAMESPACE_DECL
00079
00080 #include "ace/post.h"
00081 #endif