MeshLib
 
Loading...
Searching...
No Matches
MRDotNet/MRBitSet.h
Go to the documentation of this file.
1#pragma once
2#include "MRMeshFwd.h"
3
5
7public ref class BitSetReadOnly abstract
8{
9public:
11 bool Test( int index );
13 int FindFirst();
15 int FindLast();
17 int Size();
19 int Count();
20
21 virtual BitSetReadOnly^ Clone() = 0;
22
23 static bool operator==( BitSetReadOnly^ a, BitSetReadOnly^ b );
24 static bool operator!=( BitSetReadOnly^ a, BitSetReadOnly^ b );
25
26 static BitSetReadOnly^ operator-( BitSetReadOnly^ a, BitSetReadOnly^ b );
27
28internal:
29 BitSetReadOnly( MR::BitSet* bs );
31protected:
34
35 virtual bool IsEqualTo( BitSetReadOnly^ other ) = 0;
36};
37
38public ref class BitSet : public BitSetReadOnly
39{
40public:
43
45 BitSet(int size);
46
48 void Set( int index );
50 void Set( int index, bool value );
51
53 void Resize( int size );
54
56 void AutoResizeSet( int index );
58 void AutoResizeSet( int index, bool value );
59
60 virtual BitSetReadOnly^ Clone() override;
61
62internal:
63 BitSet( MR::BitSet* bs );
64 MR::BitSet* bitSet() { return bs_; }
65
66protected:
67 virtual bool IsEqualTo( BitSetReadOnly^ other ) override;
68};
69
#define MR_DOTNET_NAMESPACE_BEGIN
Definition MRDotNet/MRMeshFwd.h:42
#define MR_DOTNET_NAMESPACE_END
Definition MRDotNet/MRMeshFwd.h:43
Definition MRDotNet/MRBitSet.h:39
virtual bool IsEqualTo(BitSetReadOnly^ other) override
void AutoResizeSet(int index, bool value)
sets the given bit to given value. If index is out of range, it will be automatically resized
void Set(int index)
sets the given bit to true
virtual BitSetReadOnly Clone() override
BitSet(int size)
creates bitset with given size
BitSet()
creates empty bitset
void Resize(int size)
changes the size of the bitset
MR::BitSet * bitSet()
Definition MRDotNet/MRBitSet.h:64
void AutoResizeSet(int index)
sets the given bit to true. If index is out of range, it will be automatically resized
void Set(int index, bool value)
sets the given bit to given value
container of bits
Definition MRMesh/MRBitSet.h:26
static bool operator==(BitSetReadOnly^ a, BitSetReadOnly^ b)
BitSetReadOnly()
virtual bool IsEqualTo(BitSetReadOnly^ other)=0
int Size()
returns total number of bits
int FindFirst()
returns index of the first set bit
MR::BitSet * bs_
Definition MRDotNet/MRBitSet.h:33
~BitSetReadOnly()
virtual BitSetReadOnly Clone()=0
int Count()
returns number of set bits
bool Test(int index)
test if given bit is set
int FindLast()
returns index of the last set bit
static bool operator!=(BitSetReadOnly^ a, BitSetReadOnly^ b)
static BitSetReadOnly operator-(BitSetReadOnly^ a, BitSetReadOnly^ b)