|
| | HttpAdapter (HttpAdapterConfig config={}) |
| | ~HttpAdapter () override |
| | HttpAdapter (const HttpAdapter &)=delete |
| HttpAdapter & | operator= (const HttpAdapter &)=delete |
| | HttpAdapter (HttpAdapter &&)=delete |
| HttpAdapter & | operator= (HttpAdapter &&)=delete |
| bool | start () |
| | Start the HTTP server on a background thread.
|
| void | stop () |
| | Stop the server; closes all SSE connections.
|
| bool | running () const noexcept |
| | True iff the server thread is alive and listening.
|
| std::uint16_t | actual_port () const noexcept |
| | Actual bound port — useful when config.port == 0 and the OS picked.
|
| std::size_t | client_count () const noexcept |
| | Number of currently connected SSE clients.
|
| HttpView & | register_view (std::string id, std::string kind) |
| | Register a logical view with stable id and kind.
|
| HttpView * | find_view (std::string_view id) |
| | Look up a previously-registered view by id, or nullptr.
|
| void | unregister_view (std::string_view id) |
| | Unregister a view (also fires its on_destroy signal so any BindingEngine subscriptions are released cleanly).
|
| std::vector< ViewInfo > | list_views () const |
| std::string_view | platform_name () const noexcept override |
| void | set_text (binding::IView &v, std::string_view text) override |
| std::string | get_text (binding::IView &v) override |
| ::aria::Subscription | on_text_changed (binding::IView &v, std::function< void(std::string_view)> cb) override |
| void | set_bool (binding::IView &v, bool value) override |
| bool | get_bool (binding::IView &v) override |
| ::aria::Subscription | on_bool_changed (binding::IView &v, std::function< void(bool)> cb) override |
| void | set_int (binding::IView &v, int value) override |
| int | get_int (binding::IView &v) override |
| ::aria::Subscription | on_int_changed (binding::IView &v, std::function< void(int)> cb) override |
| void | set_int64 (binding::IView &v, std::int64_t value) override |
| std::int64_t | get_int64 (binding::IView &v) override |
| ::aria::Subscription | on_int64_changed (binding::IView &v, std::function< void(std::int64_t)> cb) override |
| void | set_uint64 (binding::IView &v, std::uint64_t value) override |
| std::uint64_t | get_uint64 (binding::IView &v) override |
| ::aria::Subscription | on_uint64_changed (binding::IView &v, std::function< void(std::uint64_t)> cb) override |
| void | set_float (binding::IView &v, float value) override |
| float | get_float (binding::IView &v) override |
| ::aria::Subscription | on_float_changed (binding::IView &v, std::function< void(float)> cb) override |
| void | set_double (binding::IView &v, double value) override |
| double | get_double (binding::IView &v) override |
| ::aria::Subscription | on_double_changed (binding::IView &v, std::function< void(double)> cb) override |
| void | set_visible (binding::IView &v, bool visible) override |
| void | set_enabled (binding::IView &v, bool enabled) override |
| ::aria::Subscription | on_click (binding::IView &v, std::function< void()> cb) override |
| void | register_command (std::string_view view_id, std::string_view command_name, CommandHandler handler) |
| | Register a custom command.
|
| void | unregister_command (std::string_view view_id, std::string_view command_name) |
| | Unregister a previously-registered command.
|
| ::httplib::Server & | native_server () noexcept |
| | Direct access to the underlying cpp-httplib server, for consumers that want to register their own REST routes / static mounts / chunked responses on the same listening socket.
|
| virtual | ~IViewAdapter () |
HTTP/REST/SSE implementation of IViewAdapter.
| HttpView & aria::adapters::http::HttpAdapter::register_view |
( |
std::string | id, |
|
|
std::string | kind ) |
Register a logical view with stable id and kind.
kind ∈ {"text","bool","int","int64","uint64","float","double","click"}. Returns a reference to the owned HttpView (lifetime-bound to the adapter). Registering the same id twice replaces the previous view (after firing its on_destroy signal).
| ::httplib::Server & aria::adapters::http::HttpAdapter::native_server |
( |
| ) |
|
|
nodiscardnoexcept |
Direct access to the underlying cpp-httplib server, for consumers that want to register their own REST routes / static mounts / chunked responses on the same listening socket.
Stability: This is an escape hatch, not a stable contract. The return type leaks the implementation detail that the adapter is built on cpp-httplib. If we ever swap the HTTP backend, this signature changes. Higher-level use cases should prefer register_command() (REST-style POST handlers) or register_view() + binding (state pushed via SSE).
Threading:
- Must be called before start() to register routes — once the server thread is running, mutating the route table is racy.
- Available after construction (the underlying server is constructed eagerly), unlike pre-1.0 versions where you had to start first and downcast a void*.
Build-time visibility: Include <httplib.h> to use the returned server. The installed aria::http target exports the matching header, compile definitions and optional TLS link dependencies. This API remains coupled to the bundled cpp-httplib version.