Dev Essential
Loading...
Searching...
No Matches
memory.h
Go to the documentation of this file.
1
14
15#ifndef _A_UTILS_UTIL_MEMORY_MEMORY_INCLUDED_
16#define _A_UTILS_UTIL_MEMORY_MEMORY_INCLUDED_
17
18#include <cstddef>
19#include <cstdint>
20
21namespace a_util {
22namespace memory {
23class MemoryBuffer;
24
34bool copy(void* dest, std::size_t dest_size, const void* source, std::size_t bytes_to_copy);
35
43bool copy(void* dest, const void* source, std::size_t bytes_to_copy);
44
52bool copy(MemoryBuffer& buffer, const void* source, std::size_t bytes_to_copy);
53
62bool set(void* dest, std::size_t dest_size, std::uint8_t value, std::size_t bytes_to_set);
63
71bool set(void* dest, std::uint8_t value, std::size_t bytes_to_set);
72
80bool set(MemoryBuffer& buffer, std::uint8_t value, std::size_t bytes_to_set);
81
89bool zero(void* dest, std::size_t dest_size, std::size_t bytes_to_zero);
90
97bool zero(void* dest, std::size_t bytes_to_zero);
98
105bool zero(MemoryBuffer& buffer, std::size_t bytes_to_zero);
106
118int compare(const void* buf1, std::size_t buf1_size, const void* buf2, std::size_t buf2_size);
119
126bool isZero(const void* buffer, std::size_t buffer_size);
127
132bool swapEndianess(bool value);
134std::int8_t swapEndianess(std::int8_t value);
136std::uint8_t swapEndianess(std::uint8_t value);
138std::int16_t swapEndianess(std::int16_t value);
140std::uint16_t swapEndianess(std::uint16_t value);
142std::int32_t swapEndianess(std::int32_t value);
144std::uint32_t swapEndianess(std::uint32_t value);
146std::int64_t swapEndianess(std::int64_t value);
148std::uint64_t swapEndianess(std::uint64_t value);
149
150} // namespace memory
151} // namespace a_util
152
153#endif // _A_UTILS_UTIL_MEMORY_MEMORY_INCLUDED_
Memory buffer class to encapsulate and manage raw contiguously memory.
Definition memorybuffer.h:23
Serves as component for memory access and management.
Definition memory.h:20
bool swapEndianess(bool value)
int compare(const void *buf1, std::size_t buf1_size, const void *buf2, std::size_t buf2_size)
bool set(void *dest, std::size_t dest_size, std::uint8_t value, std::size_t bytes_to_set)
bool isZero(const void *buffer, std::size_t buffer_size)
bool copy(void *dest, std::size_t dest_size, const void *source, std::size_t bytes_to_copy)
bool zero(void *dest, std::size_t dest_size, std::size_t bytes_to_zero)
Serves as the root component, with common functionality documented in core functionality.
Definition base.h:24