Zen API

- Home
- Topics
- Types
- Files

All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kMemory.h
Go to the documentation of this file.
1
10 #ifndef K_API_MEMORY_H
11 #define K_API_MEMORY_H
12
13 #include <kApi/kApiDef.h>
14 #include <kApi/Io/kMemory.x.h>
15
22 //typedef kStream kMemory; --forward-declared in kApiDef.x.h
23
34 kFx(kStatus) kMemory_Construct(kMemory* memory, kAlloc allocator);
35
47 kFx(kStatus) kMemory_Attach(kMemory memory, void* buffer, kSize position, kSize length, kSize capacity);
48
57 kFx(kStatus) kMemory_Allocate(kMemory memory, kSize initialCapacity);
58
69 kFx(kStatus) kMemory_Reserve(kMemory memory, kSize minimumCapacity);
70
78 kFx(k64u) kMemory_Length(kMemory memory);
79
87 kFx(k64u) kMemory_Position(kMemory memory);
88
96 kFx(kSize) kMemory_Capacity(kMemory memory);
97
106 kFx(kStatus) kMemory_SetLength(kMemory memory, kSize length);
107
116 kFx(void*) kMemory_At(kMemory memory, kSize offset);
117
118
119 #endif
kMemory
Represents an in-memory stream.
k64u
Represents a 64-bit unsigned integer.
kMemory::kMemory_Reserve
kStatus kMemory_Reserve(kMemory memory, kSize minimumCapacity)
Ensures that capacity is reserved for at least the specified number of bytes.
kSize
Represents an unsigned integer that can store a pointer address.
kAlloc
Abstract base class for memory allocator types.
kMemory::kMemory_Allocate
kStatus kMemory_Allocate(kMemory memory, kSize initialCapacity)
Allocates an auto-sizing, internally-managed buffer for the memory stream.
kMemory::kMemory_Attach
kStatus kMemory_Attach(kMemory memory, void *buffer, kSize position, kSize length, kSize capacity)
Attaches the memory stream to an external, fixed-capacity buffer.
kMemory::kMemory_Capacity
kSize kMemory_Capacity(kMemory memory)
Returns the current capacity of the memory buffer.
kMemory::kMemory_At
void * kMemory_At(kMemory memory, kSize offset)
Returns a pointer to the memory buffer at the specified position.
kApiDef.h
Core Zen type declarations.
kMemory::kMemory_Construct
kStatus kMemory_Construct(kMemory *memory, kAlloc allocator)
Constructs a kMemory object.
kMemory::kMemory_Position
k64u kMemory_Position(kMemory memory)
Returns the current position of the read/write pointer, relative to the beginning of the buffer...
kStatus
Represents an error code.
kMemory::kMemory_Length
k64u kMemory_Length(kMemory memory)
Returns the current length of the memory buffer.
kMemory::kMemory_SetLength
kStatus kMemory_SetLength(kMemory memory, kSize length)
Sets the reported length of the memory buffer.