#ifndef SOPHIAR2_SOPHIAR_OBJ_HPP #define SOPHIAR2_SOPHIAR_OBJ_HPP #include "core/sophiar_manager.h" #include #include namespace sophiar { extern boost::asio::io_context global_context; class sophiar_obj { public: virtual ~sophiar_obj() = default; // 加载初始化配置 [[deprecated]] virtual void load_construct_config(const nlohmann::json &config) {}; static constexpr auto &get_context() { return global_context; } static constexpr auto &get_manager() { return global_sophiar_manager; } }; #define DEFAULT_NEW_INSTANCE(DerivedT) \ static sophiar_obj *new_instance() { \ return new DerivedT{}; \ } } #endif //SOPHIAR2_SOPHIAR_OBJ_HPP