Memory region description.
More...
Memory region description.
A RegionLayout describes how data is laid out in a specific portion of memory. The memory region can be composed of multiple sub-regions recursively. Each final sub-region will contain one or more elements of the same type. You can pick a different color for each sub-region and also repeat them over the layout (when you have arrays).
- Example
struct S {
};
S v[3];
auto layout = MemoryDumper::RegionLayout().withSizeOf<S>(3)
static char blue[6]
"\e[34m"
Definition: console_colors.h:66
static char yellow[6]
"\e[33m"
Definition: console_colors.h:65
static MemoryDumper::RegionLayout memoryDumpLayout()
Gets memory layout.
Definition: math_element.h:56
RegionLayout & withColor(const std::string &console_color)
Modifies layout color.
Definition: memory_dump.h:110
RegionLayout & withSubRegion(const RegionLayout &sub_region, bool increment_to_parent_size=false)
Appends a layout representing a sub-region of this layout.
Definition: memory_dump.h:132
- Note
- Most types in hermes, such as
point2
and vec3
, provide their RegionLayout for you
◆ pushSubRegion()
void hermes::MemoryDumper::RegionLayout::pushSubRegion |
( |
const RegionLayout & |
sub_region, |
|
|
bool |
increment_to_parent_size = false |
|
) |
| |
|
inline |
Appends a layout representing a sub-region of this layout.
- Parameters
-
sub_region | |
increment_to_parent_size | |
◆ resizeSubRegions()
void hermes::MemoryDumper::RegionLayout::resizeSubRegions |
( |
size_t |
sub_regions_count | ) |
|
|
inline |
Resizes number of sub-regions of this layout.
- Parameters
-
◆ sizeInBytes()
std::size_t hermes::MemoryDumper::RegionLayout::sizeInBytes |
( |
| ) |
const |
|
inline |
Gets layout size in bytes.
- Returns
◆ withColor()
RegionLayout& hermes::MemoryDumper::RegionLayout::withColor |
( |
const std::string & |
console_color | ) |
|
|
inline |
Modifies layout color.
- Parameters
-
- Returns
◆ withCount()
RegionLayout& hermes::MemoryDumper::RegionLayout::withCount |
( |
std::size_t |
region_count | ) |
|
|
inline |
Modifies layout count.
- Parameters
-
- Returns
◆ withOffset()
RegionLayout& hermes::MemoryDumper::RegionLayout::withOffset |
( |
std::size_t |
offset_in_bytes | ) |
|
|
inline |
Modifies layout offset.
- Parameters
-
- Returns
◆ withSize()
RegionLayout& hermes::MemoryDumper::RegionLayout::withSize |
( |
std::size_t |
size_in_bytes, |
|
|
std::size_t |
element_count = 1 |
|
) |
| |
|
inline |
Modifies layout size based on given quantities.
- Parameters
-
size_in_bytes | |
element_count | |
- Returns
◆ withSizeOf()
template<typename T >
RegionLayout& hermes::MemoryDumper::RegionLayout::withSizeOf |
( |
std::size_t |
element_count = 1 | ) |
|
|
inline |
Modifies layout size based on given type and count.
- Template Parameters
-
- Parameters
-
- Returns
◆ withSubRegion()
RegionLayout& hermes::MemoryDumper::RegionLayout::withSubRegion |
( |
const RegionLayout & |
sub_region, |
|
|
bool |
increment_to_parent_size = false |
|
) |
| |
|
inline |
Appends a layout representing a sub-region of this layout.
- Parameters
-
sub_region | |
increment_to_parent_size | |
- Returns
◆ withType()
Modifies layout base data type.
- Parameters
-
- Returns
◆ withTypeFrom()
template<typename T >
RegionLayout& hermes::MemoryDumper::RegionLayout::withTypeFrom |
( |
| ) |
|
|
inline |
Modifies layout base data type based on a given type.
- Template Parameters
-
- Returns
The documentation for this struct was generated from the following file: