Skip to content

Could I serialize a class with some "recursive/tree-like" data? #26

Open
@jkooooo99

Description

@jkooooo99

Hi, I am a newbie in C++ and everything...

Could I use this library to serialize my class with some complex data like :

        struct BoneNode
	{
		std::string name;
		glm::mat4 transMatrix;
		std::vector<BoneNode> children;
		int meshBoneId = -1;
		int nonMeshBoneId = -1;
	};

and

std::unordered_map<std::string, size_t> boneExMap ?

The loading speed of FBX is driving me crazy and forcing me to learn some new words like "binary files" and "serialize"...

And sorry for my poor English...

Activity

eieio

eieio commented on Apr 7, 2023

@eieio
Collaborator

Hi!

Recursive types are supported. Here's an example based on your code: https://godbolt.org/z/K1WbMdKno

Cheers,
Corey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @eieio@jkooooo99

        Issue actions

          Could I serialize a class with some "recursive/tree-like" data? · Issue #26 · google/libnop