Blue Brain BioExplorer
core::RocketsPlugin::Impl Class Reference
Inheritance diagram for core::RocketsPlugin::Impl:
Collaboration diagram for core::RocketsPlugin::Impl:

Classes

struct  ScopedCurrentClient
 

Public Types

using JsonRpcServer = rockets::jsonrpc::Server< rockets::Server >
 

Public Member Functions

 Impl (PluginAPI *api)
 
 ~Impl ()
 
void preRender ()
 
void postRender ()
 
void registerNotification (const RpcParameterDescription &desc, const PropertyMap &input, const std::function< void(PropertyMap)> &action)
 
void registerNotification (const RpcDescription &desc, const std::function< void()> &action)
 
void registerRequest (const RpcParameterDescription &desc, const PropertyMap &input, const PropertyMap &output, const std::function< PropertyMap(PropertyMap)> &action)
 
void registerRequest (const RpcDescription &desc, const PropertyMap &output, const std::function< PropertyMap()> &action)
 
void _registerRequest (const std::string &name, const RetParamFunc &action)
 
void _registerRequest (const std::string &name, const RetFunc &action)
 
void _registerNotification (const std::string &name, const ParamFunc &action)
 
void _registerNotification (const std::string &name, const VoidFunc &action)
 
void processDelayedNotifies ()
 
void _setupRocketsServer ()
 
void _setupWebsocket ()
 
void _delayedNotify (const std::function< void()> &notify)
 
void _rebroadcast (const std::string &endpoint, const std::string &message, const std::set< uintptr_t > &filter)
 
void _bindEndpoint (const std::string &method, rockets::jsonrpc::ResponseCallback action)
 
template<typename Params , typename RetVal >
void _bindEndpoint (const std::string &method, std::function< RetVal(Params)> action)
 
template<typename RetVal >
void _bindEndpoint (const std::string &method, std::function< RetVal()> action)
 
template<typename Params >
void _bindEndpoint (const std::string &method, std::function< void(Params)> action)
 
void _bindEndpoint (const std::string &method, rockets::jsonrpc::VoidCallback action)
 
void _bindModelEndpoint (const std::string &method, const std::string &key, std::function< bool(std::string, ModelDescriptorPtr)> action)
 
template<class T >
void _handleGET (const std::string &endpoint, T &obj, const int64_t throttleTime=DEFAULT_THROTTLE)
 
template<class T >
void _handlePUT (const std::string &endpoint, T &obj)
 
template<class T , class PRE , class POST >
void _handlePUT (const std::string &endpoint, T &obj, PRE preUpdateFunc, POST postUpdateFunc)
 
template<class T >
void _handle (const std::string &endpoint, T &obj, const int64_t throttleTime=DEFAULT_THROTTLE)
 
template<class P , class R >
void _handleRPC (const RpcParameterDescription &desc, std::function< R(P)> action)
 
template<class R >
void _handleRPC (const RpcDescription &desc, std::function< R()> action)
 
template<class P >
void _handleRPC (const RpcParameterDescription &desc, std::function< void(P)> action)
 
void _handleRPC (const RpcDescription &desc, std::function< void()> action)
 
template<class P , class R >
void _handleAsyncRPC (const RpcParameterDescription &desc, std::function< rockets::jsonrpc::CancelRequestCallback(P, uintptr_t, rockets::jsonrpc::AsyncResponse, rockets::jsonrpc::ProgressUpdateCallback)> action)
 
template<class P , class R >
void _handleTask (const RpcParameterDescription &desc, std::function< std::shared_ptr< Task< R >>(P, uintptr_t)> createTask)
 
template<class T >
void _handleObjectSchema (const std::string &endpoint)
 
template<class T >
void _handleObjectSchema (const std::string &endpoint, T &obj)
 
void _handleSchema (const std::string &endpoint, const std::string &schema)
 
void _registerEndpoints ()
 
void _handleImageJPEG ()
 
void _broadcastImageJpeg ()
 
void _broadcastControlledImageJpeg ()
 
void _handleVersion ()
 
void _handleAnimationParams ()
 
void _handleCamera ()
 
void _handleRenderer ()
 
void _handleSchemaRPC ()
 
void _handleInspect ()
 
void _handleQuit ()
 
void _handleExitLater ()
 
void _handleResetCamera ()
 
void _handleSnapshot ()
 
void _handleTriggerImageStream ()
 
void _handleSetImageStreamingMode ()
 
void _handleRequestModelUpload ()
 
void _handleChunk ()
 
void _handleSetModelTransferFunction ()
 
void _handleGetModelTransferFunction ()
 
void _handleAddClipPlane ()
 
void _handleGetClipPlanes ()
 
void _handleUpdateClipPlane ()
 
void _handleRemoveClipPlanes ()
 
void _handleGetLights ()
 
void _handleAddLight ()
 
void _handleRemoveLights ()
 
void _handleClearLights ()
 
FileStats _getFileStats (const std::string &path)
 
void _handleFsExists ()
 
void _handleFsGetContent ()
 
void _handleFsGetRoot ()
 
void _handleFsGetListDir ()
 
void _handleAddModel ()
 
void _handleRemoveModel ()
 
void _handleUpdateModel ()
 
void _handleGetModelProperties ()
 
void _handleSetModelProperties ()
 
void _handleModelPropertiesSchema ()
 
void _handleGetInstances ()
 
void _handleGetLoaders ()
 
void _handleUpdateInstance ()
 
void _handlePropertyObject (PropertyObject &object, const std::string &endpoint, const std::string objectName)
 
void _handleLoadersSchema ()
 
void _handleSetEnvironmentMap ()
 
void _handleGetEnvironmentMap ()
 
void _handleSetVideostream ()
 
void _handleGetVideostream ()
 
void _triggerControlledStreaming ()
 
- Public Member Functions inherited from core::ActionInterface
virtual ~ActionInterface ()=default
 
void registerNotification (const std::string &name, const std::function< void()> &action)
 
template<typename Params >
void registerNotification (const std::string &name, const std::function< void(Params)> &action)
 
template<typename Params , typename RetVal >
void registerRequest (const std::string &name, const std::function< RetVal(Params)> &action)
 
template<typename RetVal >
void registerRequest (const std::string &name, const std::function< RetVal()> &action)
 

Public Attributes

Engine_engine
 
std::unordered_map< std::string, std::pair< std::mutex, Throttle > > _throttle
 
std::vector< std::function< void()> > _delayedNotifies
 
std::mutex _delayedNotifiesMutex
 
uintptr_t _currentClientID {NO_CURRENT_CLIENT}
 
std::unordered_map< std::string, std::string > _schemas
 
ParametersManager_parametersManager
 
std::unique_ptr< rockets::Server > _rocketsServer
 
std::unique_ptr< JsonRpcServer_jsonrpcServer
 
bool _manualProcessing {true}
 
ImageGenerator _imageGenerator
 
Timer _timer
 
float _leftover {0.f}
 
std::map< TaskPtr, std::shared_ptr< async::task< void > > > _tasks
 
std::mutex _tasksMutex
 
BinaryRequests _binaryRequests
 
bool _endpointsRegistered {false}
 
bool _useControlledStream {false}
 
std::atomic< bool > _controlledStreamingFlag {false}
 
bool _scheduledShutdownActive {false}
 
bool _cancelScheduledShutdown {false}
 
std::unique_ptr< std::thread > _shutDownWorker
 
std::mutex _scheduleMutex
 
std::mutex _waitLock
 
std::condition_variable _monitor
 
std::vector< BaseObject * > _objects
 

Static Public Attributes

static constexpr uintptr_t NO_CURRENT_CLIENT {0}
 

Additional Inherited Members

- Protected Types inherited from core::ActionInterface
using RetParamFunc = std::function< std::string(std::string)>
 
using RetFunc = std::function< std::string()>
 
using ParamFunc = std::function< void(std::string)>
 
using VoidFunc = std::function< void()>
 

Detailed Description

Definition at line 232 of file RocketsPlugin.cpp.

Member Typedef Documentation

◆ JsonRpcServer

using core::RocketsPlugin::Impl::JsonRpcServer = rockets::jsonrpc::Server<rockets::Server>

Definition at line 2168 of file RocketsPlugin.cpp.

Constructor & Destructor Documentation

◆ Impl()

core::RocketsPlugin::Impl::Impl ( PluginAPI api)
inline

Definition at line 235 of file RocketsPlugin.cpp.

◆ ~Impl()

core::RocketsPlugin::Impl::~Impl ( )
inline

Definition at line 249 of file RocketsPlugin.cpp.

Member Function Documentation

◆ _bindEndpoint() [1/5]

void core::RocketsPlugin::Impl::_bindEndpoint ( const std::string &  method,
rockets::jsonrpc::ResponseCallback  action 
)
inline

Definition at line 525 of file RocketsPlugin.cpp.

◆ _bindEndpoint() [2/5]

void core::RocketsPlugin::Impl::_bindEndpoint ( const std::string &  method,
rockets::jsonrpc::VoidCallback  action 
)
inline

Definition at line 594 of file RocketsPlugin.cpp.

◆ _bindEndpoint() [3/5]

template<typename RetVal >
void core::RocketsPlugin::Impl::_bindEndpoint ( const std::string &  method,
std::function< RetVal()>  action 
)
inline

Definition at line 559 of file RocketsPlugin.cpp.

◆ _bindEndpoint() [4/5]

template<typename Params , typename RetVal >
void core::RocketsPlugin::Impl::_bindEndpoint ( const std::string &  method,
std::function< RetVal(Params)>  action 
)
inline

Definition at line 536 of file RocketsPlugin.cpp.

◆ _bindEndpoint() [5/5]

template<typename Params >
void core::RocketsPlugin::Impl::_bindEndpoint ( const std::string &  method,
std::function< void(Params)>  action 
)
inline

Definition at line 579 of file RocketsPlugin.cpp.

◆ _bindModelEndpoint()

void core::RocketsPlugin::Impl::_bindModelEndpoint ( const std::string &  method,
const std::string &  key,
std::function< bool(std::string, ModelDescriptorPtr)>  action 
)
inline

Definition at line 605 of file RocketsPlugin.cpp.

◆ _broadcastControlledImageJpeg()

void core::RocketsPlugin::Impl::_broadcastControlledImageJpeg ( )
inline

Definition at line 1058 of file RocketsPlugin.cpp.

◆ _broadcastImageJpeg()

void core::RocketsPlugin::Impl::_broadcastImageJpeg ( )
inline

Definition at line 1030 of file RocketsPlugin.cpp.

◆ _delayedNotify()

void core::RocketsPlugin::Impl::_delayedNotify ( const std::function< void()> &  notify)
inline

Definition at line 470 of file RocketsPlugin.cpp.

◆ _getFileStats()

FileStats core::RocketsPlugin::Impl::_getFileStats ( const std::string &  path)
inline

Definition at line 1592 of file RocketsPlugin.cpp.

◆ _handle()

template<class T >
void core::RocketsPlugin::Impl::_handle ( const std::string &  endpoint,
T &  obj,
const int64_t  throttleTime = DEFAULT_THROTTLE 
)
inline

Definition at line 752 of file RocketsPlugin.cpp.

◆ _handleAddClipPlane()

void core::RocketsPlugin::Impl::_handleAddClipPlane ( )
inline

Definition at line 1363 of file RocketsPlugin.cpp.

◆ _handleAddLight()

void core::RocketsPlugin::Impl::_handleAddLight ( )
inline

Definition at line 1498 of file RocketsPlugin.cpp.

◆ _handleAddModel()

void core::RocketsPlugin::Impl::_handleAddModel ( )
inline

Definition at line 1841 of file RocketsPlugin.cpp.

◆ _handleAnimationParams()

void core::RocketsPlugin::Impl::_handleAnimationParams ( )
inline

Definition at line 1141 of file RocketsPlugin.cpp.

◆ _handleAsyncRPC()

template<class P , class R >
void core::RocketsPlugin::Impl::_handleAsyncRPC ( const RpcParameterDescription desc,
std::function< rockets::jsonrpc::CancelRequestCallback(P, uintptr_t, rockets::jsonrpc::AsyncResponse, rockets::jsonrpc::ProgressUpdateCallback)>  action 
)
inline

Definition at line 786 of file RocketsPlugin.cpp.

◆ _handleCamera()

void core::RocketsPlugin::Impl::_handleCamera ( )
inline

Definition at line 1150 of file RocketsPlugin.cpp.

◆ _handleChunk()

void core::RocketsPlugin::Impl::_handleChunk ( )
inline

Definition at line 1317 of file RocketsPlugin.cpp.

◆ _handleClearLights()

void core::RocketsPlugin::Impl::_handleClearLights ( )
inline

Definition at line 1580 of file RocketsPlugin.cpp.

◆ _handleExitLater()

void core::RocketsPlugin::Impl::_handleExitLater ( )
inline

Definition at line 1222 of file RocketsPlugin.cpp.

◆ _handleFsExists()

void core::RocketsPlugin::Impl::_handleFsExists ( )
inline

Definition at line 1685 of file RocketsPlugin.cpp.

◆ _handleFsGetContent()

void core::RocketsPlugin::Impl::_handleFsGetContent ( )
inline

Definition at line 1705 of file RocketsPlugin.cpp.

◆ _handleFsGetListDir()

void core::RocketsPlugin::Impl::_handleFsGetListDir ( )
inline

Definition at line 1765 of file RocketsPlugin.cpp.

◆ _handleFsGetRoot()

void core::RocketsPlugin::Impl::_handleFsGetRoot ( )
inline

Definition at line 1749 of file RocketsPlugin.cpp.

◆ _handleGET()

template<class T >
void core::RocketsPlugin::Impl::_handleGET ( const std::string &  endpoint,
T &  obj,
const int64_t  throttleTime = DEFAULT_THROTTLE 
)
inline

Definition at line 645 of file RocketsPlugin.cpp.

◆ _handleGetClipPlanes()

void core::RocketsPlugin::Impl::_handleGetClipPlanes ( )
inline

Definition at line 1379 of file RocketsPlugin.cpp.

◆ _handleGetEnvironmentMap()

void core::RocketsPlugin::Impl::_handleGetEnvironmentMap ( )
inline

Definition at line 2084 of file RocketsPlugin.cpp.

◆ _handleGetInstances()

void core::RocketsPlugin::Impl::_handleGetInstances ( )
inline

Definition at line 1950 of file RocketsPlugin.cpp.

◆ _handleGetLights()

void core::RocketsPlugin::Impl::_handleGetLights ( )
inline

Definition at line 1425 of file RocketsPlugin.cpp.

◆ _handleGetLoaders()

void core::RocketsPlugin::Impl::_handleGetLoaders ( )
inline

Definition at line 1971 of file RocketsPlugin.cpp.

◆ _handleGetModelProperties()

void core::RocketsPlugin::Impl::_handleGetModelProperties ( )
inline

Definition at line 1892 of file RocketsPlugin.cpp.

◆ _handleGetModelTransferFunction()

void core::RocketsPlugin::Impl::_handleGetModelTransferFunction ( )
inline

Definition at line 1345 of file RocketsPlugin.cpp.

◆ _handleGetVideostream()

void core::RocketsPlugin::Impl::_handleGetVideostream ( )
inline

Definition at line 2128 of file RocketsPlugin.cpp.

◆ _handleImageJPEG()

void core::RocketsPlugin::Impl::_handleImageJPEG ( )
inline

Definition at line 1016 of file RocketsPlugin.cpp.

◆ _handleInspect()

void core::RocketsPlugin::Impl::_handleInspect ( )
inline

Definition at line 1200 of file RocketsPlugin.cpp.

◆ _handleLoadersSchema()

void core::RocketsPlugin::Impl::_handleLoadersSchema ( )
inline

Definition at line 2046 of file RocketsPlugin.cpp.

◆ _handleModelPropertiesSchema()

void core::RocketsPlugin::Impl::_handleModelPropertiesSchema ( )
inline

Definition at line 1927 of file RocketsPlugin.cpp.

◆ _handleObjectSchema() [1/2]

template<class T >
void core::RocketsPlugin::Impl::_handleObjectSchema ( const std::string &  endpoint)
inline

Definition at line 917 of file RocketsPlugin.cpp.

◆ _handleObjectSchema() [2/2]

template<class T >
void core::RocketsPlugin::Impl::_handleObjectSchema ( const std::string &  endpoint,
T &  obj 
)
inline

Definition at line 923 of file RocketsPlugin.cpp.

◆ _handlePropertyObject()

void core::RocketsPlugin::Impl::_handlePropertyObject ( PropertyObject object,
const std::string &  endpoint,
const std::string  objectName 
)
inline

Definition at line 2013 of file RocketsPlugin.cpp.

◆ _handlePUT() [1/2]

template<class T >
void core::RocketsPlugin::Impl::_handlePUT ( const std::string &  endpoint,
T &  obj 
)
inline

Definition at line 716 of file RocketsPlugin.cpp.

◆ _handlePUT() [2/2]

template<class T , class PRE , class POST >
void core::RocketsPlugin::Impl::_handlePUT ( const std::string &  endpoint,
T &  obj,
PRE  preUpdateFunc,
POST  postUpdateFunc 
)
inline

Definition at line 722 of file RocketsPlugin.cpp.

◆ _handleQuit()

void core::RocketsPlugin::Impl::_handleQuit ( )
inline

Definition at line 1212 of file RocketsPlugin.cpp.

◆ _handleRemoveClipPlanes()

void core::RocketsPlugin::Impl::_handleRemoveClipPlanes ( )
inline

Definition at line 1409 of file RocketsPlugin.cpp.

◆ _handleRemoveLights()

void core::RocketsPlugin::Impl::_handleRemoveLights ( )
inline

Definition at line 1565 of file RocketsPlugin.cpp.

◆ _handleRemoveModel()

void core::RocketsPlugin::Impl::_handleRemoveModel ( )
inline

Definition at line 1853 of file RocketsPlugin.cpp.

◆ _handleRenderer()

void core::RocketsPlugin::Impl::_handleRenderer ( )
inline

Definition at line 1163 of file RocketsPlugin.cpp.

◆ _handleRequestModelUpload()

void core::RocketsPlugin::Impl::_handleRequestModelUpload ( )
inline

Definition at line 1305 of file RocketsPlugin.cpp.

◆ _handleResetCamera()

void core::RocketsPlugin::Impl::_handleResetCamera ( )
inline

Definition at line 1259 of file RocketsPlugin.cpp.

◆ _handleRPC() [1/4]

template<class R >
void core::RocketsPlugin::Impl::_handleRPC ( const RpcDescription desc,
std::function< R()>  action 
)
inline

Definition at line 766 of file RocketsPlugin.cpp.

◆ _handleRPC() [2/4]

void core::RocketsPlugin::Impl::_handleRPC ( const RpcDescription desc,
std::function< void()>  action 
)
inline

Definition at line 779 of file RocketsPlugin.cpp.

◆ _handleRPC() [3/4]

template<class P , class R >
void core::RocketsPlugin::Impl::_handleRPC ( const RpcParameterDescription desc,
std::function< R(P)>  action 
)
inline

Definition at line 759 of file RocketsPlugin.cpp.

◆ _handleRPC() [4/4]

template<class P >
void core::RocketsPlugin::Impl::_handleRPC ( const RpcParameterDescription desc,
std::function< void(P)>  action 
)
inline

Definition at line 773 of file RocketsPlugin.cpp.

◆ _handleSchema()

void core::RocketsPlugin::Impl::_handleSchema ( const std::string &  endpoint,
const std::string &  schema 
)
inline

Definition at line 928 of file RocketsPlugin.cpp.

◆ _handleSchemaRPC()

void core::RocketsPlugin::Impl::_handleSchemaRPC ( )
inline

Definition at line 1176 of file RocketsPlugin.cpp.

◆ _handleSetEnvironmentMap()

void core::RocketsPlugin::Impl::_handleSetEnvironmentMap ( )
inline

Definition at line 2065 of file RocketsPlugin.cpp.

◆ _handleSetImageStreamingMode()

void core::RocketsPlugin::Impl::_handleSetImageStreamingMode ( )
inline

Definition at line 1287 of file RocketsPlugin.cpp.

◆ _handleSetModelProperties()

void core::RocketsPlugin::Impl::_handleSetModelProperties ( )
inline

Definition at line 1910 of file RocketsPlugin.cpp.

◆ _handleSetModelTransferFunction()

void core::RocketsPlugin::Impl::_handleSetModelTransferFunction ( )
inline

Definition at line 1325 of file RocketsPlugin.cpp.

◆ _handleSetVideostream()

void core::RocketsPlugin::Impl::_handleSetVideostream ( )
inline

Definition at line 2093 of file RocketsPlugin.cpp.

◆ _handleSnapshot()

void core::RocketsPlugin::Impl::_handleSnapshot ( )
inline

Definition at line 1269 of file RocketsPlugin.cpp.

◆ _handleTask()

template<class P , class R >
void core::RocketsPlugin::Impl::_handleTask ( const RpcParameterDescription desc,
std::function< std::shared_ptr< Task< R >>(P, uintptr_t)>  createTask 
)
inline

Definition at line 796 of file RocketsPlugin.cpp.

◆ _handleTriggerImageStream()

void core::RocketsPlugin::Impl::_handleTriggerImageStream ( )
inline

Definition at line 1281 of file RocketsPlugin.cpp.

◆ _handleUpdateClipPlane()

void core::RocketsPlugin::Impl::_handleUpdateClipPlane ( )
inline

Definition at line 1389 of file RocketsPlugin.cpp.

◆ _handleUpdateInstance()

void core::RocketsPlugin::Impl::_handleUpdateInstance ( )
inline

Definition at line 1981 of file RocketsPlugin.cpp.

◆ _handleUpdateModel()

void core::RocketsPlugin::Impl::_handleUpdateModel ( )
inline

Definition at line 1868 of file RocketsPlugin.cpp.

◆ _handleVersion()

void core::RocketsPlugin::Impl::_handleVersion ( )
inline

Definition at line 1126 of file RocketsPlugin.cpp.

◆ _rebroadcast()

void core::RocketsPlugin::Impl::_rebroadcast ( const std::string &  endpoint,
const std::string &  message,
const std::set< uintptr_t > &  filter 
)
inline

Definition at line 487 of file RocketsPlugin.cpp.

◆ _registerEndpoints()

void core::RocketsPlugin::Impl::_registerEndpoints ( )
inline

Definition at line 937 of file RocketsPlugin.cpp.

◆ _registerNotification() [1/2]

void core::RocketsPlugin::Impl::_registerNotification ( const std::string &  name,
const ParamFunc action 
)
inlinevirtual

Reimplemented from core::ActionInterface.

Definition at line 390 of file RocketsPlugin.cpp.

◆ _registerNotification() [2/2]

void core::RocketsPlugin::Impl::_registerNotification ( const std::string &  name,
const VoidFunc action 
)
inlinevirtual

Reimplemented from core::ActionInterface.

Definition at line 400 of file RocketsPlugin.cpp.

◆ _registerRequest() [1/2]

void core::RocketsPlugin::Impl::_registerRequest ( const std::string &  name,
const RetFunc action 
)
inlinevirtual

Reimplemented from core::ActionInterface.

Definition at line 380 of file RocketsPlugin.cpp.

◆ _registerRequest() [2/2]

void core::RocketsPlugin::Impl::_registerRequest ( const std::string &  name,
const RetParamFunc action 
)
inlinevirtual

Reimplemented from core::ActionInterface.

Definition at line 370 of file RocketsPlugin.cpp.

◆ _setupRocketsServer()

void core::RocketsPlugin::Impl::_setupRocketsServer ( )
inline

Definition at line 424 of file RocketsPlugin.cpp.

◆ _setupWebsocket()

void core::RocketsPlugin::Impl::_setupWebsocket ( )
inline

Definition at line 456 of file RocketsPlugin.cpp.

◆ _triggerControlledStreaming()

void core::RocketsPlugin::Impl::_triggerControlledStreaming ( )
inline

Definition at line 2145 of file RocketsPlugin.cpp.

◆ postRender()

void core::RocketsPlugin::Impl::postRender ( )
inline

Definition at line 294 of file RocketsPlugin.cpp.

◆ preRender()

void core::RocketsPlugin::Impl::preRender ( )
inline

Definition at line 276 of file RocketsPlugin.cpp.

◆ processDelayedNotifies()

void core::RocketsPlugin::Impl::processDelayedNotifies ( )
inline

Definition at line 410 of file RocketsPlugin.cpp.

◆ registerNotification() [1/2]

void core::RocketsPlugin::Impl::registerNotification ( const RpcDescription desc,
const std::function< void()> &  action 
)
inlinevirtual

Register an action with no parameter and no return value.

Parameters
descdescription of the action/RPC
actionthe action to perform on an incoming notification

Implements core::ActionInterface.

Definition at line 325 of file RocketsPlugin.cpp.

◆ registerNotification() [2/2]

void core::RocketsPlugin::Impl::registerNotification ( const RpcParameterDescription desc,
const PropertyMap input,
const std::function< void(PropertyMap)> &  action 
)
inlinevirtual

Register an action with a property map as the parameter and no return value.

Parameters
descdescription of the action/RPC
inputthe acceptable property map as the parameter for the RPC
actionthe action to perform on an incoming notification

Implements core::ActionInterface.

Definition at line 312 of file RocketsPlugin.cpp.

◆ registerRequest() [1/2]

void core::RocketsPlugin::Impl::registerRequest ( const RpcDescription desc,
const PropertyMap output,
const std::function< PropertyMap()> &  action 
)
inlinevirtual

Register an action with no parameter and a property map as the return value.

Parameters
descdescription of the action/RPC
outputthe property map layout that is returned on a successful request
actionthe action to perform on an incoming request

Implements core::ActionInterface.

Definition at line 357 of file RocketsPlugin.cpp.

◆ registerRequest() [2/2]

void core::RocketsPlugin::Impl::registerRequest ( const RpcParameterDescription desc,
const PropertyMap input,
const PropertyMap output,
const std::function< PropertyMap(PropertyMap)> &  action 
)
inlinevirtual

Register an action with a property map as the parameter and a property map as the return value.

Parameters
descdescription of the action/RPC
inputthe acceptable property map as the parameter for the RPC
outputthe property map layout that is returned on a successful request
actionthe action to perform on an incoming request

Implements core::ActionInterface.

Definition at line 337 of file RocketsPlugin.cpp.

Member Data Documentation

◆ _binaryRequests

BinaryRequests core::RocketsPlugin::Impl::_binaryRequests

Definition at line 2181 of file RocketsPlugin.cpp.

◆ _cancelScheduledShutdown

bool core::RocketsPlugin::Impl::_cancelScheduledShutdown {false}

Definition at line 2195 of file RocketsPlugin.cpp.

◆ _controlledStreamingFlag

std::atomic<bool> core::RocketsPlugin::Impl::_controlledStreamingFlag {false}

Definition at line 2190 of file RocketsPlugin.cpp.

◆ _currentClientID

uintptr_t core::RocketsPlugin::Impl::_currentClientID {NO_CURRENT_CLIENT}

Definition at line 2157 of file RocketsPlugin.cpp.

◆ _delayedNotifies

std::vector<std::function<void()> > core::RocketsPlugin::Impl::_delayedNotifies

Definition at line 2154 of file RocketsPlugin.cpp.

◆ _delayedNotifiesMutex

std::mutex core::RocketsPlugin::Impl::_delayedNotifiesMutex

Definition at line 2155 of file RocketsPlugin.cpp.

◆ _endpointsRegistered

bool core::RocketsPlugin::Impl::_endpointsRegistered {false}

Definition at line 2184 of file RocketsPlugin.cpp.

◆ _engine

Engine& core::RocketsPlugin::Impl::_engine

Definition at line 2151 of file RocketsPlugin.cpp.

◆ _imageGenerator

ImageGenerator core::RocketsPlugin::Impl::_imageGenerator

Definition at line 2173 of file RocketsPlugin.cpp.

◆ _jsonrpcServer

std::unique_ptr<JsonRpcServer> core::RocketsPlugin::Impl::_jsonrpcServer

Definition at line 2169 of file RocketsPlugin.cpp.

◆ _leftover

float core::RocketsPlugin::Impl::_leftover {0.f}

Definition at line 2176 of file RocketsPlugin.cpp.

◆ _manualProcessing

bool core::RocketsPlugin::Impl::_manualProcessing {true}

Definition at line 2171 of file RocketsPlugin.cpp.

◆ _monitor

std::condition_variable core::RocketsPlugin::Impl::_monitor

Definition at line 2202 of file RocketsPlugin.cpp.

◆ _objects

std::vector<BaseObject*> core::RocketsPlugin::Impl::_objects

Definition at line 2204 of file RocketsPlugin.cpp.

◆ _parametersManager

ParametersManager& core::RocketsPlugin::Impl::_parametersManager

Definition at line 2165 of file RocketsPlugin.cpp.

◆ _rocketsServer

std::unique_ptr<rockets::Server> core::RocketsPlugin::Impl::_rocketsServer

Definition at line 2167 of file RocketsPlugin.cpp.

◆ _scheduledShutdownActive

bool core::RocketsPlugin::Impl::_scheduledShutdownActive {false}

Definition at line 2193 of file RocketsPlugin.cpp.

◆ _scheduleMutex

std::mutex core::RocketsPlugin::Impl::_scheduleMutex

Definition at line 2199 of file RocketsPlugin.cpp.

◆ _schemas

std::unordered_map<std::string, std::string> core::RocketsPlugin::Impl::_schemas

Definition at line 2163 of file RocketsPlugin.cpp.

◆ _shutDownWorker

std::unique_ptr<std::thread> core::RocketsPlugin::Impl::_shutDownWorker

Definition at line 2197 of file RocketsPlugin.cpp.

◆ _tasks

std::map<TaskPtr, std::shared_ptr<async::task<void> > > core::RocketsPlugin::Impl::_tasks

Definition at line 2178 of file RocketsPlugin.cpp.

◆ _tasksMutex

std::mutex core::RocketsPlugin::Impl::_tasksMutex

Definition at line 2179 of file RocketsPlugin.cpp.

◆ _throttle

std::unordered_map<std::string, std::pair<std::mutex, Throttle> > core::RocketsPlugin::Impl::_throttle

Definition at line 2153 of file RocketsPlugin.cpp.

◆ _timer

Timer core::RocketsPlugin::Impl::_timer

Definition at line 2175 of file RocketsPlugin.cpp.

◆ _useControlledStream

bool core::RocketsPlugin::Impl::_useControlledStream {false}

Definition at line 2188 of file RocketsPlugin.cpp.

◆ _waitLock

std::mutex core::RocketsPlugin::Impl::_waitLock

Definition at line 2201 of file RocketsPlugin.cpp.

◆ NO_CURRENT_CLIENT

constexpr uintptr_t core::RocketsPlugin::Impl::NO_CURRENT_CLIENT {0}
staticconstexpr

Definition at line 2156 of file RocketsPlugin.cpp.


The documentation for this class was generated from the following file: