Ion
|
A RemoteServer starts an HttpServer with a predefined handler for the /ion subdirectory. More...
#include "remoteserver.h"
Public Types | |
typedef std::map< std::string, std::string > | QueryMap |
typedef std::map< void *, WebsocketHelper * > | WebsocketMap |
typedef base::ReferentPtr < Websocket >::Type | WebsocketPtr |
typedef base::ReferentPtr < RequestHandler >::Type | RequestHandlerPtr |
typedef std::map< std::string, RequestHandlerPtr > | HandlerMap |
Public Member Functions | |
RemoteServer (int port) | |
Starts a RemoteServer on the passed port. More... | |
RemoteServer (const gfx::RendererPtr &renderer, const gfxutils::ShaderManagerPtr &shader_manager, const gfxutils::FramePtr &frame, int port) | |
Starts a RemoteServer and takes shared ownership of some key Ion objects of the application. More... | |
~RemoteServer () override | |
void | AddNode (const gfx::NodePtr &node) const |
Adds a Node to the NodeGraphHandler which allows Remote to inspect it in the web interface. More... | |
bool | RemoveNode (const gfx::NodePtr &node) const |
Removes a Node from the NodeGraphHandler. More... | |
const std::string | GetUriData (const std::string &uri) const |
Returns the data of the requested URI, or returns an empty string if it does not exist. More... | |
bool | IsRunning () const |
Returns whether the server is running. More... | |
void | RegisterHandler (const RequestHandlerPtr &handler) |
Registers the passed handler at the path returned by handler->GetBasePath(). More... | |
void | UnregisterHandler (const std::string &path) |
Unregisters the handler at path . More... | |
HandlerMap | GetHandlers () const |
Returns the handlers registered with this server. More... | |
bool | EmbedLocalSourcedFiles () const |
Gets, sets whether local sourced files (tags with src=... More... | |
void | SetEmbedLocalSourcedFiles (bool embed) |
size_t | WebsocketCount () |
Return the number of currently-connected websockets. More... | |
const std::string & | GetFooterHtml () const |
Sets/gets the header and footer HTML, which are both empty by default. More... | |
const std::string & | GetHeaderHtml () const |
void | SetFooterHtml (const std::string &str) |
void | SetHeaderHtml (const std::string &str) |
A RemoteServer starts an HttpServer with a predefined handler for the /ion subdirectory.
Definition at line 37 of file remoteserver.h.
|
inherited |
Definition at line 116 of file httpserver.h.
|
inherited |
Definition at line 35 of file httpserver.h.
|
inherited |
Definition at line 115 of file httpserver.h.
|
inherited |
Definition at line 38 of file httpserver.h.
|
inherited |
Definition at line 65 of file httpserver.h.
|
explicit |
Starts a RemoteServer on the passed port.
Definition at line 112 of file remoteserver.cc.
ion::remote::RemoteServer::RemoteServer | ( | const gfx::RendererPtr & | renderer, |
const gfxutils::ShaderManagerPtr & | shader_manager, | ||
const gfxutils::FramePtr & | frame, | ||
int | port | ||
) |
Starts a RemoteServer and takes shared ownership of some key Ion objects of the application.
It instantiates all Ion handlers.
Definition at line 117 of file remoteserver.cc.
References ion::remote::HttpServer::RegisterHandler(), and ion::base::SharedPtr< T >::Reset().
|
override |
Definition at line 199 of file remoteserver.cc.
void ion::remote::RemoteServer::AddNode | ( | const gfx::NodePtr & | node | ) | const |
Adds a Node to the NodeGraphHandler which allows Remote to inspect it in the web interface.
Note that this only happens if there is a NodeGraphHandler added to Remote.
Definition at line 176 of file remoteserver.cc.
References ion::remote::HttpServer::GetHandlers().
|
inlineinherited |
Gets, sets whether local sourced files (tags with src=...
such as img and script that reference files starting with '/') should be embedded in returned HTML pages.
Definition at line 144 of file httpserver.h.
|
inlineinherited |
Sets/gets the header and footer HTML, which are both empty by default.
When RequestHandlers return HTML pages, the special string is replaced by the header HTML, while is replaced by the footer HTML.
Definition at line 156 of file httpserver.h.
|
inherited |
Returns the handlers registered with this server.
Definition at line 729 of file httpserver.cc.
Referenced by AddNode(), ion::remote::HttpServer::GetUriData(), and RemoveNode().
|
inlineinherited |
Definition at line 157 of file httpserver.h.
|
inherited |
Returns the data of the requested URI, or returns an empty string if it does not exist.
Definition at line 695 of file httpserver.cc.
References ion::remote::HttpServer::GetHandlers(), and ion::base::StartsWith().
|
inherited |
Returns whether the server is running.
Definition at line 710 of file httpserver.cc.
|
inherited |
Registers the passed handler at the path returned by handler->GetBasePath().
Definition at line 714 of file httpserver.cc.
References DCHECK, ion::base::SharedPtr< T >::Get(), and ion::base::RemoveSuffix().
Referenced by RemoteServer().
bool ion::remote::RemoteServer::RemoveNode | ( | const gfx::NodePtr & | node | ) | const |
Removes a Node from the NodeGraphHandler.
Note that this only happens if there is a NodeGraphHandler added to Remote. If the Node was not added, this does nothing but return false.
Definition at line 186 of file remoteserver.cc.
References ion::remote::HttpServer::GetHandlers().
|
inlineinherited |
Definition at line 145 of file httpserver.h.
|
inlineinherited |
Definition at line 158 of file httpserver.h.
References str.
|
inlineinherited |
Definition at line 159 of file httpserver.h.
References str.
|
inherited |
Unregisters the handler at path
.
Definition at line 724 of file httpserver.cc.
|
inherited |
Return the number of currently-connected websockets.
Definition at line 765 of file httpserver.cc.