refactor: standardize object type identification using uLibTypeMacro and update serialization macros

This commit is contained in:
AndreaRigoni
2026-04-02 10:33:14 +00:00
parent a1c5fc2600
commit 4435776484
32 changed files with 229 additions and 99 deletions

View File

@@ -76,8 +76,9 @@ public:
ULIB_SERIALIZABLE_OBJECT(TestObject2)
ULIB_SERIALIZE_OBJECT(TestObject2, TestObject) {
// std::cout << "Serializing TestObject2" << std::endl;
ar & boost::serialization::make_hrp("value2", ob.m_Value2, "mm").set_default(1.);
std::cout << "Serializing TestObject2" << std::endl;
// ar & boost::serialization::make_hrp("value2", ob.m_Value2, "mm").set_default(1.);
ar & HRP("value2", ob.m_Value2, "mm").set_default(1.);
}

View File

@@ -8,13 +8,12 @@ using namespace uLib;
class TestObject : public Object {
public:
uLibTypeMacro(TestObject, Object)
TestObject() : Object(),
IntProp(this, "IntProp", 10),
StringProp(this, "StringProp", "Initial")
{}
virtual const char* GetClassName() const override { return "TestObject"; }
Property<int> IntProp;
Property<std::string> StringProp;
};

View File

@@ -9,10 +9,9 @@ using namespace uLib;
class TestObject : public Object {
public:
uLibTypeMacro(TestObject, Object)
TestObject() : Object() {}
virtual const char* GetClassName() const override { return "TestObject"; }
// Use new typedefs
StringProperty StringProp = StringProperty(this, "StringProp", "Initial");
IntProperty IntProp = IntProperty(this, "IntProp", 42);