CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
array_buffer.h
1#pragma once
2
3#include <system/idisposable.h>
4#include <system/array.h>
5#include <cstdint>
6
7namespace System
8{
9template <typename> class Memory;
10template <typename> class Span;
11} // namespace System
12
13namespace System {
14
15namespace Net {
16
17class ArrayBuffer : public IDisposable, public System::Details::BoxableObjectBase
18{
19 typedef ArrayBuffer ThisType;
20 typedef IDisposable BaseType;
21
22 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
23 RTTI_INFO_DECL();
24
25public:
26
28
29public:
30
37 int32_t get_Capacity();
38
39 ArrayBuffer(int32_t initialSize, bool usePool = false);
40
41 void Dispose() override;
43 void Discard(int32_t byteCount);
44 void Commit(int32_t byteCount);
45 void EnsureAvailableSpace(int32_t byteCount);
46
48
49protected:
50
51 #ifdef ASPOSE_GET_SHARED_MEMBERS
52 void GetSharedMembers(System::Object::shared_members_type& result) const override;
53 #endif
54
55private:
56
57 static int32_t get_ArrayMaxLength();
58
59 bool _usePool;
61 int32_t _activeStart;
62 int32_t _availableStart;
63
64 void EnsureAvailableSpaceCore(int32_t byteCount);
65 void ReturnBufferIfPooled(System::SharedPtr<Array<uint8_t>> buffer);
66};
67
68} // namespace Net
69} // namespace System
Class that represents an array data structure. Objects of this class should only be allocated using S...
Definition: array.h:296
Defines method that releases resources owned by the current object. Objects of this class should only...
Definition: idisposable.h:30
Definition: array_buffer.h:18
Span< uint8_t > get_ActiveSpan()
Memory< uint8_t > get_AvailableMemory()
void Commit(int32_t byteCount)
void Discard(int32_t byteCount)
void Dispose() override
Does nothing.
Memory< uint8_t > get_ActiveMemory()
Span< uint8_t > get_AvailableSpan()
ArrayBuffer(int32_t initialSize, bool usePool=false)
void EnsureAvailableSpace(int32_t byteCount)
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
Represents a contiguous region of arbitrary memory similar to C++20's std::span.
Definition: span.h:375
Definition: db_command.h:9