#ifndef LOGOS_PLAIN_LOGOS_OBJECT_H #define LOGOS_PLAIN_LOGOS_OBJECT_H #include "logos_object.h" #include "rpc_connection.h" #include #include #include #include #include namespace logos::plain { // ----------------------------------------------------------------------------- // PlainLogosObject — consumer-side LogosObject backed by the plain-C++ // RPC runtime. Identical public shape to LocalLogosObject / RemoteLogosObject // so LogosAPIConsumer doesn't care which backend it's talking to. // // Owns a shared_ptr; the transport layer hands the // connection over after opening the socket. release() stops the connection. // ----------------------------------------------------------------------------- class PlainLogosObject : public LogosObject { public: PlainLogosObject(std::string objectName, std::shared_ptr conn); ~PlainLogosObject() override; QVariant callMethod(const QString& authToken, const QString& methodName, const QVariantList& args, int timeoutMs) override; void callMethodAsync(const QString& authToken, const QString& methodName, const QVariantList& args, int timeoutMs, AsyncResultCallback callback) override; bool informModuleToken(const QString& authToken, const QString& moduleName, const QString& token, int timeoutMs) override; void onEvent(const QString& eventName, EventCallback callback) override; void disconnectEvents() override; void emitEvent(const QString& eventName, const QVariantList& data) override; QJsonArray getMethods() override; void release() override; quintptr id() const override; private: std::string m_objectName; std::shared_ptr m_conn; std::mutex m_mu; std::vector> m_subs; }; } // namespace logos::plain #endif // LOGOS_PLAIN_LOGOS_OBJECT_H