75 for (bit_vector::const_iterator bitsBegin =
bits_.begin(), bitsEnd =
bits_.end(), ibit = bitsBegin;
94 *(
bits_.rbegin()) =
false;
96 std::cout <<
"Duplicate entry " <<
s <<
", not added to registry" << std::endl;
102 for (str_index_map::const_iterator mbegin =
map_.begin(), mend =
map_.end(), mit = mbegin; mit != mend; ++mit) {
104 sprintf(buff,
"%10s = %6i", mit->first.c_str(), (
int)(
bits_.at(mit->second)));
105 out << buff << std::endl;
127 for (bit_vector::iterator ibegin =
bits_.begin(), iend =
bits_.end(),
i = ibegin;
i != iend; ++
i) {
135 for (bit_vector::iterator ibegin =
bits_.begin(), iend =
bits_.end(),
i = ibegin;
i != iend; ++
i) {
154 (*this)[
s] = !((*this)[
s]);
159 (*this)[
i] = !((*this)[
i]);
166 for (bit_vector::iterator ibegin =
ret.bits_.begin(), iend =
ret.bits_.end(),
i = ibegin;
i != iend; ++
i) {
174 if (
map_.size() !=
r.map_.size()) {
175 std::cout <<
"strbitset operator&= : bitsets not the same size" << std::endl;
177 str_index_map::iterator ibegin =
map_.begin(), iend =
map_.end(),
i = ibegin;
178 for (;
i != iend; ++
i) {
180 str_index_map::const_iterator
j =
r.map_.find(
key);
181 if (
j ==
r.map_.end()) {
182 std::cout <<
"strbitset operator&= : cannot find key " <<
key << std::endl;
193 if (
map_.size() !=
r.map_.size()) {
194 std::cout <<
"strbitset operator&= : bitsets not the same size" << std::endl;
196 str_index_map::iterator ibegin =
map_.begin(), iend =
map_.end(),
i = ibegin;
197 for (;
i != iend; ++
i) {
199 str_index_map::const_iterator
j =
r.map_.find(
key);
200 if (
j ==
r.map_.end()) {
201 std::cout <<
"strbitset operator&= : cannot find key " <<
key << std::endl;
212 if (
map_.size() !=
r.map_.size()) {
213 std::cout <<
"strbitset operator&= : bitsets not the same size" << std::endl;
215 str_index_map::iterator ibegin =
map_.begin(), iend =
map_.end(),
i = ibegin;
216 for (;
i != iend; ++
i) {
218 str_index_map::const_iterator
j =
r.map_.find(
key);
219 if (
j ==
r.map_.end()) {
220 std::cout <<
"strbitset operator&= : cannot find key " <<
key << std::endl;
231 if (
map_.size() !=
r.map_.size()) {
232 std::cout <<
"strbitset operator&= : bitsets not the same size" << std::endl;
234 str_index_map::const_iterator ibegin =
map_.begin(), iend =
map_.end(),
i = ibegin;
235 for (;
i != iend; ++
i) {
237 str_index_map::const_iterator
j =
r.map_.find(
key);
238 if (
j ==
r.map_.end()) {
239 std::cout <<
"strbitset operator&= : cannot find key " <<
key << std::endl;
252 for (bit_vector::const_iterator iBegin =
bits_.begin(), iEnd =
bits_.end(), ibit = iBegin; ibit != iEnd; ++ibit) {
267 for (bit_vector::const_iterator ibegin =
bits_.begin(), iend =
bits_.end(),
i = ibegin;
i != iend; ++
i) {
276 for (bit_vector::const_iterator ibegin =
bits_.begin(), iend =
bits_.end(),
i = ibegin;
i != iend; ++
i) {
295 const std::vector<std::string>
strings()
const {
296 std::vector<std::string>
strings;
312 str_index_map::const_iterator
f =
map_.find(
s);
313 if (
f ==
map_.end()) {
314 std::cout <<
"Cannot find " <<
s <<
", returning size()" << std::endl;
322 for (str_index_map::const_iterator
f =
map_.begin(), fEnd =
map_.end();
f != fEnd; ++
f) {
326 std::cout <<
"Cannot find " <<
i <<
", returning dummy" << std::endl;
bool operator>=(index_type const &r) const
friend strbitset operator &(const strbitset &l, const strbitset &r)
bool test(std::string s) const
test
bool operator!=(bool b) const
inequality operator to bool
std::map< std::string, size_t > str_index_map
std::string const & str() const
friend strbitset operator^(const strbitset &l, const strbitset &r)
ret
prodAgent to be discontinued
strbitset & flip()
flip method of all bits
bool operator!=(const strbitset &r) const
inequality operator
friend strbitset operator|(const strbitset &l, const strbitset &r)
strbitset operator|(const strbitset &l, const strbitset &r)
const std::vector< std::string > strings() const
give access to the ordered strings
size_t index(std::string s) const
bit_vector::reference operator[](index_type const &i)
strbitset operator &(const strbitset &l, const strbitset &r)
bool operator==(index_type const &r) const
void print(std::ostream &out) const
print method
strbitset operator~()
logical negation
strbitset & flip(std::string s)
flip method of one bit
strbitset()
constructor: just clears the bitset and map
const bit_vector & bits() const
give access to the ordered bits
index_type(strbitset const *b, std::string const &s)
bit_vector::const_reference operator[](const std::string s) const
access method const
bool operator<(index_type const &r) const
strbitset operator^(const strbitset &l, const strbitset &r)
bit_vector::reference operator[](const std::string s)
access method non-const
size_t count() const
returns number of bits set
bit_vector::const_reference operator[](index_type const &i) const
size_t any() const
returns true if any are set
bool operator!() const
! Logical negation of bool()
strbitset const * bitset_
key
prepare the HTCondor submission files and eventually submit them
std::string const & index(size_t i) const
void clear()
clear the bitset and map
bool operator<=(index_type const &r) const
bool operator==(bool b) const
equality operator to bool
strbitset & flip(index_type const &i)
bool operator==(const strbitset &r) const
equality operator
size_t none() const
returns true if none are set
static const std::string dummy_
bit_vector bits_
the actual bits, indexed by the index in "map_"
bool test(index_type const &i) const
str_index_map map_
map that holds the string–>index map
friend std::ostream & operator<<(std::ostream &out, const index_type &r)
strbitset & operator^=(const strbitset &r)
bitwise xor
std::vector< bool > bit_vector
bool operator>(index_type const &r) const
strbitset & operator|=(const strbitset &r)
bitwise or
void push_back(std::string s)
strbitset & operator &=(const strbitset &r)
bitwise and