CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
bit_vector_32.h
1#pragma once
2#include <system/string.h>
3#include <system/shared_ptr.h>
4#include <system/object.h>
5#include <cstdint>
6
7namespace System { namespace Collections { namespace Specialized {
8
10class ASPOSECPP_SHARED_CLASS BitVector32 final
11{
12public:
13 class Section;
14
15private:
18
19public:
21 class ASPOSECPP_SHARED_CLASS Section final
22 {
25
26 public:
28 ASPOSECPP_SHARED_API int16_t get_Mask();
30 ASPOSECPP_SHARED_API int16_t get_Offset();
32 ASPOSECPP_SHARED_API Section();
36 ASPOSECPP_SHARED_API Section(int16_t mask, int16_t offset);
40 ASPOSECPP_SHARED_API bool Equals(const BitVector32::Section& obj);
42 ASPOSECPP_SHARED_API int32_t GetHashCode() const;
45 ASPOSECPP_SHARED_API static String ToString(BitVector32::Section value);
47 ASPOSECPP_SHARED_API String ToString() const;
48
49 private:
50 int16_t mask;
51 int16_t offset;
52 };
53
54public:
56 ASPOSECPP_SHARED_API BitVector32();
58 ASPOSECPP_SHARED_API int32_t get_Data();
61 ASPOSECPP_SHARED_API BitVector32(int32_t data);
64 ASPOSECPP_SHARED_API BitVector32(const BitVector32& value);
67 ASPOSECPP_SHARED_API bool idx_get(int32_t bit);
71 ASPOSECPP_SHARED_API void idx_set(int32_t bit, bool value);
74 ASPOSECPP_SHARED_API int32_t idx_get(BitVector32::Section section);
78 ASPOSECPP_SHARED_API void idx_set(BitVector32::Section section, int32_t value);
80 ASPOSECPP_SHARED_API static int32_t CreateMask();
83 ASPOSECPP_SHARED_API static int32_t CreateMask(int32_t previous);
86 ASPOSECPP_SHARED_API static BitVector32::Section CreateSection(int16_t maxValue);
90 ASPOSECPP_SHARED_API static BitVector32::Section CreateSection(int16_t maxValue, BitVector32::Section previous);
92 ASPOSECPP_SHARED_API int32_t GetHashCode() const;
96 ASPOSECPP_SHARED_API static String ToString(const BitVector32& value);
100 ASPOSECPP_SHARED_API bool Equals(const BitVector32& obj);
102 ASPOSECPP_SHARED_API String ToString() const;
103
104private:
105 uint32_t data;
106 static int16_t CountBitsSet(int16_t mask);
108 static int16_t CreateMaskFromHighValue(int16_t highValue);
109 static BitVector32::Section CreateSectionHelper(int16_t maxValue, int16_t priorMask, int16_t priorOffset);
110};
111
122
123}}} // namespace System::Collections::Specialized
Represents an section of the vector that can contain a integer number.
Definition: bit_vector_32.h:22
int32_t GetHashCode() const
Returns a hash code for the current object.
Section(int16_t mask, int16_t offset)
Creates Section object with specified mask and offset.
String ToString() const
Converts value represented by current object to string.
int16_t get_Offset()
Gets the offset of this section from the start of the BitVector32.
friend bool operator==(BitVector32::Section a, BitVector32::Section b)
Checks if two specified objects are equal.
static String ToString(BitVector32::Section value)
Converts value represented by value param to string.
friend bool operator!=(BitVector32::Section a, BitVector32::Section b)
Checks if two specified objects are not equal.
int16_t get_Mask()
Gets a mask that isolates this section within the BitVector32.
bool Equals(const BitVector32::Section &obj)
Determines whether the specified object is the same as the current.
Provides a simple light bit vector with easy integer or Boolean access to a 32 bit storage.
Definition: bit_vector_32.h:11
static BitVector32::Section CreateSection(int16_t maxValue)
Creates the first section in a series, with the specified maximum value.
bool idx_get(int32_t bit)
Gets a value indicating whether all the specified bits are set.
BitVector32(int32_t data)
Initializes a new instance of the BitVector32 structure with the specified internal data.
String ToString() const
Converts value represented by current object to string.
int32_t GetHashCode() const
Returns a hash code for the current object.
bool Equals(const BitVector32 &obj)
Determines whether the specified object is the same as the current.
BitVector32()
Initializes a new empty instance of the BitVector32.
static int32_t CreateMask(int32_t previous)
Creates the next mask in a series.
friend bool operator==(BitVector32::Section a, BitVector32::Section b)
Checks if two specified objects are equal.
void idx_set(BitVector32::Section section, int32_t value)
Sets the value for the specified section.
friend bool operator!=(BitVector32::Section a, BitVector32::Section b)
Checks if two specified objects are not equal.
BitVector32(const BitVector32 &value)
Initializes a new instance of the BitVector32 structure with the information in the specified value.
int32_t idx_get(BitVector32::Section section)
Gets the value for the specified section.
void idx_set(int32_t bit, bool value)
Sets a value indicating whether all the specified bits are set.
int32_t get_Data()
returns the raw data stored in this bit vector...
static int32_t CreateMask()
Creates the first mask in a series.
static BitVector32::Section CreateSection(int16_t maxValue, BitVector32::Section previous)
Creates the next section in a series, with the specified maximum value.
static String ToString(const BitVector32 &value)
Converts value represented by value parameter to string.
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
bool operator==(BitVector32::Section a, BitVector32::Section b)
Checks if two specified objects are equal.
bool operator!=(BitVector32::Section a, BitVector32::Section b)
Checks if two specified objects are not equal.
Definition: db_command.h:9