mirror of
https://github.com/JakeHillion/object-introspection.git
synced 2024-09-19 11:09:05 +01:00
tbv2: fix type names for std::optional
Type names of optional elements were accidentally left as todo. Update `std::optional` to use `make_field` and correctly name its elements. Test Plan: - CI - Updated the integration tests to test the names.
This commit is contained in:
parent
db93feb180
commit
cbeafba9bb
@ -18,6 +18,7 @@ includes = ["optional", "cstdint", "vector"]
|
|||||||
expect_json_v2 = '''
|
expect_json_v2 = '''
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
|
"typeNames": ["std::optional<uint64_t>"],
|
||||||
"staticSize": 16,
|
"staticSize": 16,
|
||||||
"exclusiveSize": 16,
|
"exclusiveSize": 16,
|
||||||
"size": 16,
|
"size": 16,
|
||||||
@ -45,6 +46,7 @@ includes = ["optional", "cstdint", "vector"]
|
|||||||
expect_json_v2 = '''
|
expect_json_v2 = '''
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
|
"typeNames": ["std::optional<uint64_t>"],
|
||||||
"staticSize": 16,
|
"staticSize": 16,
|
||||||
"exclusiveSize": 8,
|
"exclusiveSize": 8,
|
||||||
"size": 16,
|
"size": 16,
|
||||||
@ -52,6 +54,7 @@ includes = ["optional", "cstdint", "vector"]
|
|||||||
"capacity": 1,
|
"capacity": 1,
|
||||||
"members": [
|
"members": [
|
||||||
{
|
{
|
||||||
|
"typeNames": ["uint64_t"],
|
||||||
"staticSize": 8,
|
"staticSize": 8,
|
||||||
"exclusiveSize": 8
|
"exclusiveSize": 8
|
||||||
}
|
}
|
||||||
@ -77,6 +80,7 @@ includes = ["optional", "cstdint", "vector"]
|
|||||||
expect_json_v2 = '''
|
expect_json_v2 = '''
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
|
"typeNames": ["std::optional<std::vector<uint64_t, std::allocator<uint64_t>>>"],
|
||||||
"staticSize": 32,
|
"staticSize": 32,
|
||||||
"exclusiveSize": 32,
|
"exclusiveSize": 32,
|
||||||
"size": 32,
|
"size": 32,
|
||||||
@ -112,6 +116,7 @@ includes = ["optional", "cstdint", "vector"]
|
|||||||
expect_json_v2 = '''
|
expect_json_v2 = '''
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
|
"typeNames": ["std::optional<std::vector<uint64_t, std::allocator<uint64_t>>>"],
|
||||||
"staticSize": 32,
|
"staticSize": 32,
|
||||||
"exclusiveSize": 8,
|
"exclusiveSize": 8,
|
||||||
"size": 72,
|
"size": 72,
|
||||||
@ -119,6 +124,7 @@ includes = ["optional", "cstdint", "vector"]
|
|||||||
"capacity": 1,
|
"capacity": 1,
|
||||||
"members": [
|
"members": [
|
||||||
{
|
{
|
||||||
|
"typeNames": ["std::vector<uint64_t, std::allocator<uint64_t>>"],
|
||||||
"staticSize": 24,
|
"staticSize": 24,
|
||||||
"exclusiveSize": 24,
|
"exclusiveSize": 24,
|
||||||
"size": 64,
|
"size": 64,
|
||||||
|
@ -41,14 +41,7 @@ if (container.has_value()) {
|
|||||||
[[codegen.processor]]
|
[[codegen.processor]]
|
||||||
type = "types::st::Sum<DB, types::st::Unit<DB>, typename TypeHandler<Ctx, T0>::type>"
|
type = "types::st::Sum<DB, types::st::Unit<DB>, typename TypeHandler<Ctx, T0>::type>"
|
||||||
func = """
|
func = """
|
||||||
static constexpr std::array<std::string_view, 1> names{"TODO"};
|
static constexpr auto elementField = make_field<Ctx, T0>("el");
|
||||||
static constexpr auto elementField = inst::Field{
|
|
||||||
sizeof(T0),
|
|
||||||
"el",
|
|
||||||
names,
|
|
||||||
TypeHandler<Ctx, T0>::fields,
|
|
||||||
TypeHandler<Ctx, T0>::processors,
|
|
||||||
};
|
|
||||||
|
|
||||||
auto sum = std::get<ParsedData::Sum>(d.val);
|
auto sum = std::get<ParsedData::Sum>(d.val);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user