Hermes
hermes::MemoryDumper::RegionLayout Struct Reference

Memory region description. More...

Public Member Functions

 RegionLayout ()=default
 Default constructor.
 
RegionLayoutwithOffset (std::size_t offset_in_bytes)
 Modifies layout offset. More...
 
RegionLayoutwithColor (const std::string &console_color)
 Modifies layout color. More...
 
RegionLayoutwithCount (std::size_t region_count)
 Modifies layout count. More...
 
RegionLayoutwithType (DataType t)
 Modifies layout base data type. More...
 
RegionLayoutwithSubRegion (const RegionLayout &sub_region, bool increment_to_parent_size=false)
 Appends a layout representing a sub-region of this layout. More...
 
void pushSubRegion (const RegionLayout &sub_region, bool increment_to_parent_size=false)
 Appends a layout representing a sub-region of this layout. More...
 
template<typename T >
RegionLayoutwithTypeFrom ()
 Modifies layout base data type based on a given type. More...
 
template<typename T >
RegionLayoutwithSizeOf (std::size_t element_count=1)
 Modifies layout size based on given type and count. More...
 
RegionLayoutwithSize (std::size_t size_in_bytes, std::size_t element_count=1)
 Modifies layout size based on given quantities. More...
 
std::size_t sizeInBytes () const
 Gets layout size in bytes. More...
 
void resizeSubRegions (size_t sub_regions_count)
 Resizes number of sub-regions of this layout. More...
 
void clear ()
 Removes all description.
 

Public Attributes

std::size_t offset {0}
 Layout offset in bytes.
 
std::size_t field_size_in_bytes {0}
 Region size.
 
std::size_t count {1}
 Region count.
 
std::string color = ConsoleColors::default_color
 Region color.
 
std::vector< RegionLayoutsub_regions {}
 Sub-region descriptions.
 
DataType type {DataType::CUSTOM}
 Base data type.
 

Detailed Description

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).

Member Function Documentation

◆ 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
sub_regions_count

◆ 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
console_color
Returns

◆ withCount()

RegionLayout& hermes::MemoryDumper::RegionLayout::withCount ( std::size_t  region_count)
inline

Modifies layout count.

Parameters
region_count
Returns

◆ withOffset()

RegionLayout& hermes::MemoryDumper::RegionLayout::withOffset ( std::size_t  offset_in_bytes)
inline

Modifies layout offset.

Parameters
offset_in_bytes
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
T
Parameters
element_count
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()

RegionLayout& hermes::MemoryDumper::RegionLayout::withType ( DataType  t)
inline

Modifies layout base data type.

Parameters
t
Returns

◆ withTypeFrom()

template<typename T >
RegionLayout& hermes::MemoryDumper::RegionLayout::withTypeFrom ( )
inline

Modifies layout base data type based on a given type.

Template Parameters
T
Returns

The documentation for this struct was generated from the following file: