ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/utils/BitSet.hpp
(Generate patch)

Comparing trunk/src/utils/BitSet.hpp (file contents):
Revision 312 by tim, Fri Feb 11 22:35:05 2005 UTC vs.
Revision 353 by tim, Wed Feb 16 19:36:30 2005 UTC

# Line 43 | Line 43
43   #define UTILS_BITSET_HPP
44  
45   #include <iostream>
46 #include <functional>
46   #include <vector>
47   namespace oopse {
48  
# Line 123 | Line 122 | class BitSet {
122          BitSet& operator&= (const BitSet &bs) {  andOperator (bs); return *this; }
123          BitSet& operator|= (const BitSet &bs) { orOperator (bs); return *this; }
124          BitSet& operator^= (const BitSet &bs) { xorOperator (bs); return *this; }
125 +        BitSet& operator-= (const BitSet &bs) {
126 +            BitSet tmp = *this ^ bs;
127 +            *this &= tmp;
128 +            return *this;
129 +        }
130 +        
131          bool operator[] (int bitIndex)  const {  return bitset_[bitIndex];  }
132          friend BitSet operator| (const BitSet& bs1, const BitSet& bs2);
133          friend BitSet operator& (const BitSet& bs1, const BitSet& bs2);
134          friend BitSet operator^ (const BitSet& bs1, const BitSet& bs2);
135 +        friend BitSet operator- (const BitSet& bs1, const BitSet& bs2);
136 +        
137          friend bool operator== (const BitSet & bs1, const BitSet &bs2);
138  
139          friend std::istream& operator>> ( std::istream&, const BitSet& bs);
# Line 143 | Line 150 | class BitSet {
150          std::vector<char> bitset_;
151   };
152  
146 template<typename T>
147 struct logical_xor :public std::binary_function<T, T, bool> {
148    double operator()(T x, T y) { return x ^ y; }
149 };
153  
154   }
155   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines