18 #ifndef INCLUDE_SF_BITSET_HPP 19 #define INCLUDE_SF_BITSET_HPP 23 #include <RCF/Export.hpp> 24 #include <RCF/Tools.hpp> 33 virtual std::size_t size() = 0;
34 virtual void resize(std::size_t newSize) = 0;
35 virtual void setBit(std::size_t idx,
bool newValue) = 0;
36 virtual bool getBit(std::size_t idx) = 0;
39 template<std::
size_t N>
40 class BitsetWrapper :
public I_BitsetWrapper
43 BitsetWrapper(std::bitset<N> & bits) : mBits(bits)
47 virtual std::size_t size()
52 virtual void resize(std::size_t newSize)
54 RCF_ASSERT(newSize == N);
57 virtual void setBit(std::size_t idx,
bool newValue)
59 mBits[idx] = newValue;
62 virtual bool getBit(std::size_t idx)
69 std::bitset<N> & mBits;
72 RCF_EXPORT
void serializeBitset(
SF::Archive & ar, I_BitsetWrapper & bits);
74 template<std::
size_t N>
75 void serialize(
SF::Archive & ar, std::bitset<N> & bits)
77 BitsetWrapper<N> wrapper(bits);
78 serializeBitset(ar, wrapper);
83 #endif // ! INCLUDE_SF_BITSET_HPP Represents an archive, in which serialized objects are stored.
Definition: Archive.hpp:31
Definition: ByteBuffer.hpp:188