Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
|
#include "precompiled.h"
#include "lib/debug_stl.h"
#include "lib/regex.h"
#include <cassert>
#include <deque>
#include <list>
#include <map>
#include <set>
#include <vector>
Classes | |
struct | ContainerBase< Container > |
struct | Any_deque |
struct | Any_list |
struct | Any_vector |
struct | Any_queue |
struct | Any_stack |
Macros | |
#define | REPLACE(what, with) |
#define | STRIP(what) |
#define | STRIP_NESTED(what) |
#define | CONTAINER(name, type_name_pattern) |
#define | STD_CONTAINER(name) CONTAINER(name, L"std::" WIDEN(#name) L"<*>") |
#define | STRINGIZE2(id) # id |
#define | STRINGIZE(id) STRINGIZE2(id) |
Functions | |
STATUS_ADD_DEFINITIONS (debugStlStatusDefinitions) | |
wchar_t * | debug_stl_simplify_name (wchar_t *name) |
reduce complicated STL symbol names to human-readable form. More... | |
template<class T > | |
const u8 * | stl_iterator (void *it_mem, size_t el_size) |
template<class T > | |
static bool | IsContainerValid (const T &t, size_t el_count) |
template<class T > | |
bool | get_container_info (const T &t, size_t size, size_t el_size, size_t &el_count, DebugStlIterator &el_iterator, void *it_mem) |
Status | debug_stl_get_container_info (const wchar_t *type_name, const u8 *p, size_t size, size_t el_size, size_t *el_count, DebugStlIterator *el_iterator, void *it_mem) |
prepare to enumerate the elements of arbitrarily typed STL containers. More... | |
Variables | |
static const StatusDefinition | debugStlStatusDefinitions [] |
#define CONTAINER | ( | name, | |
type_name_pattern | |||
) |
#define REPLACE | ( | what, | |
with | |||
) |
#define STD_CONTAINER | ( | name | ) | CONTAINER(name, L"std::" WIDEN(#name) L"<*>") |
#define STRINGIZE | ( | id | ) | STRINGIZE2(id) |
#define STRINGIZE2 | ( | id | ) | # id |
#define STRIP | ( | what | ) |
#define STRIP_NESTED | ( | what | ) |
Status debug_stl_get_container_info | ( | const wchar_t * | type_name, |
const u8 * | p, | ||
size_t | size, | ||
size_t | el_size, | ||
size_t * | el_count, | ||
DebugStlIterator * | el_iterator, | ||
void * | it_mem | ||
) |
prepare to enumerate the elements of arbitrarily typed STL containers.
works by retrieving element count&size via debug information and hiding the container's iterator implementation behind a common interface. a basic sanity check is performed to see if the container memory is valid and appears to be initialized.
type_name | exact type of STL container (see example above) |
p | raw memory holding the container |
size | sizeof(container) |
el_size | sizeof(value_type) |
el_count | out; number of valid elements in container |
el_iterator | out; callback function that acts as an iterator |
it_mem | out; buffer holding the iterator state. must be at least DEBUG_STL_MAX_ITERATOR_SIZE bytes. |
wchar_t * debug_stl_simplify_name | ( | wchar_t * | name | ) |
reduce complicated STL symbol names to human-readable form.
algorithm: remove/replace undesired substrings in one pass (fast). example: "std::basic_string\<char, char_traits\<char\>, std::allocator\<char\> \>" => "string".
name | Buffer holding input symbol name; modified in-place. There is no length limit; must be large enough to hold typical STL strings. DEBUG_SYMBOL_CHARS chars is a good measure. |
bool get_container_info | ( | const T & | t, |
size_t | size, | ||
size_t | el_size, | ||
size_t & | el_count, | ||
DebugStlIterator & | el_iterator, | ||
void * | it_mem | ||
) |
STATUS_ADD_DEFINITIONS | ( | debugStlStatusDefinitions | ) |
|
static |