#pragma once #include "metadata.h" #include #include // Struct describing information about an instance struct InstanceType { InstanceType* super; // May be null std::string className; InstanceConstructor constructor; }; // Base class for all instances in the data model class Instance : std::enable_shared_from_this { private: std::optional> parent; std::vector> children; public: static InstanceType* TYPE; std::string name; InstanceType* GetClass(); void SetParent(std::optional> newParent); std::optional> GetParent(); inline const std::vector> GetChildren() { return children; } }; typedef std::shared_ptr InstanceRef; typedef std::weak_ptr InstanceRefWeak;