22 #if U_SHOW_CPLUSPLUS_API
32 template<
typename T, u
int32_t minValue, u
int32_t limitValue>
38 #ifndef U_HIDE_INTERNAL_API
39 inline void clear() { fBools=0; }
40 inline void add(T toAdd) { set(toAdd, 1); }
41 inline void remove(T toRemove) { set(toRemove, 0); }
42 inline int32_t contains(T toCheck)
const {
return get(toCheck); }
43 inline void set(T toSet, int32_t v) { fBools=(fBools&(~flag(toSet)))|(v?(flag(toSet)):0); }
44 inline int32_t get(T toCheck)
const {
return (fBools & flag(toCheck))?1:0; }
45 inline UBool isValidEnum(T toCheck)
const {
return (toCheck>=minValue&&toCheck<limitValue); }
46 inline UBool isValidValue(int32_t v)
const {
return (v==0||v==1); }
48 fBools = other.fBools;
52 inline uint32_t getAll()
const {
58 inline uint32_t flag(T toCheck)
const {
return (1<<(toCheck-minValue)); }