Granada  1.54.0
Structured layer on top of C++ REST SDK for building server applications in C++. Granada implements sessions, server side plug-in framework, C++ OAuth 2.0 server, data storage access, server script running, server browsing.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Member Functions | List of all members
granada::plugin::SpidermonkeyPlugin Class Reference

#include <spidermonkey_plugin.h>

Inheritance diagram for granada::plugin::SpidermonkeyPlugin:
granada::plugin::Plugin granada::plugin::MapSpidermonkeyPlugin granada::plugin::RedisSpidermonkeyPlugin

Public Member Functions

 SpidermonkeyPlugin ()
 
 SpidermonkeyPlugin (granada::plugin::PluginHandler *plugin_handler, const std::string id)
 
 SpidermonkeyPlugin (granada::plugin::PluginHandler *plugin_handler, const web::json::value header, const web::json::value configuration, const std::string script)
 
- Public Member Functions inherited from granada::plugin::Plugin
 Plugin ()
 
 Plugin (granada::plugin::PluginHandler *plugin_handler, const std::string id)
 
 Plugin (granada::plugin::PluginHandler *plugin_handler, const web::json::value header, const web::json::value configuration, const std::string script)
 
virtual ~Plugin ()
 
virtual bool Exists ()
 
virtual void IsExtended (bool extended)
 
virtual const bool IsExtended ()
 
virtual const std::string GetId ()
 
virtual void SetId (const std::string id)
 
virtual const web::json::value & GetHeader ()
 
virtual void SetHeader (const web::json::value header)
 
virtual std::string GetScript ()
 
virtual void SetScript (const std::string script)
 
virtual const web::json::value & GetConfiguration ()
 
virtual const web::json::value & SetConfiguration (const web::json::value configuration)
 
const bool & IsRunnable ()
 
void IsRunnable (bool runnable)
 

Additional Inherited Members

- Protected Member Functions inherited from granada::plugin::Plugin
virtual void LoadProperties ()
 
virtual
granada::plugin::PluginHandler
plugin_handler ()
 
- Protected Attributes inherited from granada::plugin::Plugin
std::string id_
 
web::json::value header_
 
std::string script_
 
web::json::value configuration_
 
bool runnable_ = true
 
- Static Protected Attributes inherited from granada::plugin::Plugin
static std::once_flag properties_flag_
 

Detailed Description

Extension of the server application. Plug-ins can also extend other plug-ins. Not all of them may be executed, some can just have useful functions or wait to be extended by others. They can communicate.

Constructor & Destructor Documentation

granada::plugin::SpidermonkeyPlugin::SpidermonkeyPlugin ( )
inline

Constructor, load plug-in properties.

granada::plugin::SpidermonkeyPlugin::SpidermonkeyPlugin ( granada::plugin::PluginHandler plugin_handler,
const std::string  id 
)
inline

Constructor, set Plug-in Handler id and plug-in id and load properties.

Parameters
plugin_handlerPlug-in Handler.
idId of the Plug-in.
granada::plugin::SpidermonkeyPlugin::SpidermonkeyPlugin ( granada::plugin::PluginHandler plugin_handler,
const web::json::value  header,
const web::json::value  configuration,
const std::string  script 
)
inline

Constructor, set Plug-in header, Plug-in configuration, Plug-in Handler id and plug-in id and load properties.

Parameters
headerPlug-in header. JSON object with the plug-in header, header contains information such as the plug-in id, the events the plug-in must listen to, the plug-ins the plug-in has to extend, if the plug-in is active or not and the way the plug-in has to be loaded.

Example of header:

{

"id" : "math.sum",

"events" : ["calculate"],

"extends" : ["math.calculus"],

"active" : true,

"loader" : {

           "events"  : ["init-ph-after"]

         }

}

Parameters
configurationA JSON object shared with the client-side plug-ins used to configure the plug-in.

Example of configuration:

{

"mainContainerId"   :   {

                          "value" : "demo-container",

                          "editor"  :   "text"

                         }

}

Parameters
plugin_handlerPlug-in Handler.
scriptScript or path to script/executable.

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