mirror of
https://github.com/JakeHillion/object-introspection.git
synced 2024-09-19 19:19:05 +01:00
68290655b1
This change is fully backwards compatible with the old ContainerInfo parser, as it is just adding new fields. The old fields will continue to be used by legacy OICodeGen until that is removed. Also add a README to document the format.
37 lines
1.1 KiB
TOML
37 lines
1.1 KiB
TOML
[info]
|
|
type_name = "folly::small_heap_vector_map"
|
|
ctype = "FOLLY_SMALL_HEAP_VECTOR_MAP"
|
|
header = "folly/container/heap_vector_types.h"
|
|
|
|
# Old:
|
|
typeName = "folly::small_heap_vector_map"
|
|
ns = ["folly::small_heap_vector_map"]
|
|
numTemplateParams = 2
|
|
replaceTemplateParamIndex = []
|
|
|
|
[codegen]
|
|
decl = """
|
|
template <typename Key, typename Value, typename SizeType, class Container, typename E>
|
|
void getSizeType(const %1%<Key,Value,SizeType,Container,E> &container, size_t& returnArg);
|
|
"""
|
|
|
|
func = """
|
|
template <typename Key, typename Value, typename SizeType, class Container, typename E>
|
|
void getSizeType(const %1%<Key,Value,SizeType,Container,E> &container, size_t& returnArg)
|
|
{
|
|
SAVE_SIZE(sizeof(%1%<Key, Value, SizeType, Container, E>));
|
|
|
|
SAVE_DATA((uintptr_t)&container);
|
|
SAVE_DATA((uintptr_t)container.capacity());
|
|
SAVE_DATA((uintptr_t)container.size());
|
|
|
|
SAVE_SIZE((container.capacity() - container.size()) * (sizeof(Key) + sizeof(Value)));
|
|
|
|
for (auto const& it : container)
|
|
{
|
|
getSizeType(it.first, returnArg);
|
|
getSizeType(it.second, returnArg);
|
|
}
|
|
}
|
|
"""
|