8#ifndef META_OCEAN_INTERACTION_JS_OCEAN_H
9#define META_OCEAN_INTERACTION_JS_OCEAN_H
162 static void functionInfo(
const v8::FunctionCallbackInfo<v8::Value>& info);
235 template <
bool tActive>
273template <
bool tActive>
276 ocean_assert(info.Length() > 0);
280 for (
int n = 0; n < info.Length(); n++)
285 messageObject << message;
unsigned int EventId
Definition of an event id.
Definition ApplicationInterface.h:37
Strings StringVector
Definition of a vector holding strings.
Definition ApplicationInterface.h:52
This class implements an application or module configuration toolkit using files as input or output.
Definition FileConfig.h:29
This class implements the base class for all JavaScript wrappers.
Definition JSBase.h:34
static std::string toAString(const v8::Local< v8::String > &value)
Returns the std string of a given JavaScript string object.
static void function(const v8::FunctionCallbackInfo< v8::Value > &info)
The callback function for all JavaScript functions of wrapped C++ objects.
Definition JSBase.h:489
static const v8::Local< v8::Context > & currentContext()
Returns the current JavaScript context object.
Definition JSContext.h:337
This class holds a global ocean object.
Definition JSOcean.h:43
static std::vector< v8::Local< v8::Value > > parameter(const ApplicationInterface::EventId eventId, const bool state)
Creates JavaScript parameters of one given values.
std::pair< std::weak_ptr< JSContext >, std::string > ContextFunctionPair
Definition of a pair combining a JSContext object with a function name.
Definition JSOcean.h:51
void addContentAddedEventFunction(const v8::Local< v8::Function > &function)
Adds a new content added event function.
Lock lock_
Lock object.
Definition JSOcean.h:123
void release()
Releases all event callback functions.
void addContentRemovedEventFunction(const v8::Local< v8::Function > &function)
Adds a new content removed event function.
virtual ~OceanContainer()
Destructs the global ocean object.
IO::FileConfig containerFileConfig
File config object.
Definition JSOcean.h:120
ContextFunctionPairs contentRemovedEventFunctions_
Functions for content removed events.
Definition JSOcean.h:117
void onContentEvent(const ApplicationInterface::EventId eventId, const bool value, const bool state)
On content event function.
ContextFunctionPairs contentAddedEventFunctions_
Functions for content added events.
Definition JSOcean.h:114
void removeContentRemovedEventFunction(const v8::Local< v8::Function > &function)
Removes a new content removed event function.
void removeContentAddedEventFunction(const v8::Local< v8::Function > &function)
Removes a new content added event function.
std::vector< ContextFunctionPair > ContextFunctionPairs
Definition of a vector holding ContextFunctionPair objects.
Definition JSOcean.h:56
This class implements the JavaScript Ocean objevct.
Definition JSOcean.h:34
static void functionRemoveContent(const v8::FunctionCallbackInfo< v8::Value > &info)
Callback function for 'removeContent()' function.
static ApplicationInterface::StringVector resolveFilenames(const v8::FunctionCallbackInfo< v8::Value > &info)
Resolves the filenames from a given java script argument.
static void functionCompilerVersion(const v8::FunctionCallbackInfo< v8::Value > &info)
Callback function for 'compilerVersion()' function.
friend class JSLibrary
Definition JSOcean.h:35
static void pushMessage(MessageObject< tActive > &messageObject, const v8::FunctionCallbackInfo< v8::Value > &info)
Pushes information into a message object.
Definition JSOcean.h:274
static void functionError(const v8::FunctionCallbackInfo< v8::Value > &info)
Callback function for 'error()' function.
static void functionWarning(const v8::FunctionCallbackInfo< v8::Value > &info)
Callback function for 'warning()' function.
static void functionSetContentAddedEventFunction(const v8::FunctionCallbackInfo< v8::Value > &info)
Callback function for 'setContentAddedEventFunction()' function.
static const char * objectName()
Returns the JavaScript name of this object.
Definition JSOcean.h:251
static void functionTimestamp(const v8::FunctionCallbackInfo< v8::Value > &info)
Callback function for 'timestamp()' function.
static v8::Local< v8::ObjectTemplate > objectTemplate()
Returns the object template for this object.
Definition JSOcean.h:256
static void functionInfo(const v8::FunctionCallbackInfo< v8::Value > &info)
Callback function for 'info()' function.
static void createObjectTemplate()
Creates the function object template for this object.
static v8::Persistent< v8::ObjectTemplate > objectTemplate_
Object template for the Vector2 object.
Definition JSOcean.h:248
static void release()
Releases the function and object template for this object.
Definition JSOcean.h:267
static void functionPlatformType(const v8::FunctionCallbackInfo< v8::Value > &info)
Callback function for 'platformType()' function.
static void functionSetContentRemovedEventFunction(const v8::FunctionCallbackInfo< v8::Value > &info)
Callback function for 'setContentRemovedEventFunction()' function.
static void functionAddContent(const v8::FunctionCallbackInfo< v8::Value > &info)
Callback function for 'addContent()' function.
static void functionReleaseType(const v8::FunctionCallbackInfo< v8::Value > &info)
Callback function for 'releaseType()' function.
static void functionDebug(const v8::FunctionCallbackInfo< v8::Value > &info)
Callback function for 'debug()' function.
static void functionArchitectureType(const v8::FunctionCallbackInfo< v8::Value > &info)
Callback function for 'architectureType()' function.
This class implements a recursive lock object.
Definition Lock.h:31
Messenger object, one object for each message.
Definition Messenger.h:448
Namespace of the Interaction JavaScript library.
Definition JavaScript.h:24
Namespace of the Interaction library.
Definition Empty.h:19
The namespace covering the entire Ocean framework.
Definition Accessor.h:15