00001 #ifndef _CATEGORYFLAGS_H_
00002 #define _CATEGORYFLAGS_H_
00003 #include <iosfwd>
00004 #include <cassert>
00005 #include <cstddef>
00006 namespace osl
00007 {
00008 namespace category
00009 {
00010 struct CategoryFlags
00011 {
00012 static const size_t maxCategories = 64;
00013 unsigned long long data;
00014 bool isSet(size_t i) const
00015 {
00016 assert(i < maxCategories);
00017 return data & (1uLL << i);
00018 }
00019 void set(size_t i)
00020 {
00021 assert(i < maxCategories);
00022 data |= (1uLL << i);
00023 }
00024 void clear()
00025 {
00026 data = 0;
00027 }
00028 };
00029 std::ostream& operator<<(std::ostream&, CategoryFlags);
00030
00031 }
00032 }
00033
00034 #endif
00035
00036
00037
00038