CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
sequence_position.h
1
2#pragma once
3
4#include <system/object.h>
5#include <system/object_ext.h>
6#include <system/shared_ptr.h>
7#include <cstdint>
8
9namespace System {
10
16class SequencePosition : public ::System::Details::BoxableObjectBase
17{
18 RTTI_INFO_VALUE_TYPE(SequencePosition)
19
20public:
22 ASPOSECPP_SHARED_API SequencePosition() noexcept;
23
26 ASPOSECPP_SHARED_API explicit SequencePosition(const SharedPtr<Object>& object);
27
32 ASPOSECPP_SHARED_API SequencePosition(const SharedPtr<Object>& object, int32_t integer);
33
36 ASPOSECPP_SHARED_API const SharedPtr<Object>& GetObject() const noexcept;
37
40 ASPOSECPP_SHARED_API int32_t GetInteger() const noexcept;
41
45 ASPOSECPP_SHARED_API bool Equals(const SequencePosition& other) const;
46
49 ASPOSECPP_SHARED_API int32_t GetHashCode() const;
50
55 friend bool operator ==(const SequencePosition& position1, const SequencePosition& position2) noexcept
56 {
57 return position1.Equals(position2);
58 }
59
64 friend bool operator !=(const SequencePosition& position1, const SequencePosition& position2) noexcept
65 {
66 return !(position1 == position2);
67 }
68
69private:
70 SharedPtr<Object> m_object;
71 int32_t m_integer;
72};
73
74} // namespace System
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:51
Represents the position of an element in a sequence. It wraps a reference to a segment object (usuall...
Definition: sequence_position.h:17
int32_t GetInteger() const noexcept
Gets the integer offset that accompanies the referenced segment.
bool Equals(const SequencePosition &other) const
Determines whether the current SequencePosition and the specified one represent the same position.
const SharedPtr< Object > & GetObject() const noexcept
Gets the segment reference this position points into.
int32_t GetHashCode() const
Returns a hash code for the current SequencePosition.
friend bool operator!=(const SequencePosition &position1, const SequencePosition &position2) noexcept
Determines whether the current SequencePosition and the specified one represent different positions.
Definition: sequence_position.h:64
SequencePosition() noexcept
Constructs a default SequencePosition that refers to no segment.
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
Definition: db_command.h:9