//////////////////////////////////////////////////////////////////////////////// /// @brief V8-vocbase bridge /// /// @file /// /// DISCLAIMER /// /// Copyright 2004-2012 triagens GmbH, Cologne, Germany /// /// Licensed under the Apache License, Version 2.0 (the "License"); /// you may not use this file except in compliance with the License. /// You may obtain a copy of the License at /// /// http://www.apache.org/licenses/LICENSE-2.0 /// /// Unless required by applicable law or agreed to in writing, software /// distributed under the License is distributed on an "AS IS" BASIS, /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. /// See the License for the specific language governing permissions and /// limitations under the License. /// /// Copyright holder is triAGENS GmbH, Cologne, Germany /// /// @author Dr. Frank Celler /// @author Copyright 2011-2012, triAGENS GmbH, Cologne, Germany //////////////////////////////////////////////////////////////////////////////// #ifndef TRIAGENS_V8_V8_GLOBALS_H #define TRIAGENS_V8_V8_GLOBALS_H 1 #include "BasicsC/common.h" #include #include #include #include #include #include #include "Basics/ReadWriteLock.h" #include "VocBase/vocbase.h" // ----------------------------------------------------------------------------- // --SECTION-- public types // ----------------------------------------------------------------------------- //////////////////////////////////////////////////////////////////////////////// /// @addtogroup V8Globals /// @{ //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /// @brief globals stored in the isolate //////////////////////////////////////////////////////////////////////////////// typedef struct TRI_v8_global_s { //////////////////////////////////////////////////////////////////////////////// /// @brief constructor //////////////////////////////////////////////////////////////////////////////// TRI_v8_global_s () : JSFluentQueries(), JSQueryCursors(), JSQueries(), // DEPRECATED JSCursors(), // DEPRECATED JSWheres(), // DEPRECATED JSResultSets(), JSBarriers(), Actions(), ActionsLock(), EdgesTempl(), EdgesColTempl(), ErrorTempl(), FluentQueryTempl(), QueryCursorTempl(), QueryErrorTempl(), QueryTempl(), // DEPRECATED CursorTempl(), // DEPRECATED WhereTempl(), VocbaseColTempl(), VocbaseTempl(), SLOperatorTempl(), DictionaryTempl(), CollectionQueryType(), OutputFuncName(), PrintFuncName(), DidKey(), FromKey(), IidKey(), OldRevKey(), RevKey(), ToKey(), BodyKey(), ContentTypeKey(), JournalSizeKey(), ParametersKey(), ResponseCodeKey(), WaitForSyncKey(), DocumentIdRegex(), IndexIdRegex() { } //////////////////////////////////////////////////////////////////////////////// /// @brief fluent query mapping for weak pointers //////////////////////////////////////////////////////////////////////////////// std::map< void*, v8::Persistent > JSFluentQueries; //////////////////////////////////////////////////////////////////////////////// /// @brief cursor mapping for weak pointers //////////////////////////////////////////////////////////////////////////////// std::map< void*, v8::Persistent > JSQueryCursors; //////////////////////////////////////////////////////////////////////////////// /// @brief query mapping for weak pointers - DEPRECATED //////////////////////////////////////////////////////////////////////////////// std::map< void*, v8::Persistent > JSQueries; //////////////////////////////////////////////////////////////////////////////// /// @brief cursor mapping for weak pointers - DEPRECATED //////////////////////////////////////////////////////////////////////////////// std::map< void*, v8::Persistent > JSCursors; //////////////////////////////////////////////////////////////////////////////// /// @brief where clause mapping for weak pointers - DEPRECATED //////////////////////////////////////////////////////////////////////////////// std::map< void*, v8::Persistent > JSWheres; //////////////////////////////////////////////////////////////////////////////// /// @brief result set mapping for weak pointers //////////////////////////////////////////////////////////////////////////////// std::map< void*, v8::Persistent > JSResultSets; //////////////////////////////////////////////////////////////////////////////// /// @brief barrier mapping for weak pointers //////////////////////////////////////////////////////////////////////////////// std::map< void*, v8::Persistent > JSBarriers; //////////////////////////////////////////////////////////////////////////////// /// @brief barrier mapping for weak pointers //////////////////////////////////////////////////////////////////////////////// std::map< void*, v8::Persistent > JSOperators; //////////////////////////////////////////////////////////////////////////////// /// @brief map of callbacks for actions //////////////////////////////////////////////////////////////////////////////// std::map< std::string, v8::Persistent > Actions; //////////////////////////////////////////////////////////////////////////////// /// @brief map of callbacks for system actions //////////////////////////////////////////////////////////////////////////////// std::map SystemActions; //////////////////////////////////////////////////////////////////////////////// /// @brief lock for the actions //////////////////////////////////////////////////////////////////////////////// triagens::basics::ReadWriteLock ActionsLock; //////////////////////////////////////////////////////////////////////////////// /// @} //////////////////////////////////////////////////////////////////////////////// // ----------------------------------------------------------------------------- // --SECTION-- JAVASCRIPT OBJECT TEMPLATES // ----------------------------------------------------------------------------- //////////////////////////////////////////////////////////////////////////////// /// @addtogroup V8Globals /// @{ //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /// @brief TRI_vocbase_t template for edges //////////////////////////////////////////////////////////////////////////////// v8::Persistent EdgesTempl; //////////////////////////////////////////////////////////////////////////////// /// @brief TRI_vocbase_col_t template for edges //////////////////////////////////////////////////////////////////////////////// v8::Persistent EdgesColTempl; //////////////////////////////////////////////////////////////////////////////// /// @brief error template //////////////////////////////////////////////////////////////////////////////// v8::Persistent ErrorTempl; //////////////////////////////////////////////////////////////////////////////// /// @brief fluent query template //////////////////////////////////////////////////////////////////////////////// v8::Persistent FluentQueryTempl; //////////////////////////////////////////////////////////////////////////////// /// @brief cursor template //////////////////////////////////////////////////////////////////////////////// v8::Persistent QueryCursorTempl; //////////////////////////////////////////////////////////////////////////////// /// @brief query error template //////////////////////////////////////////////////////////////////////////////// v8::Persistent QueryErrorTempl; //////////////////////////////////////////////////////////////////////////////// /// @brief query template //////////////////////////////////////////////////////////////////////////////// v8::Persistent QueryTempl; //////////////////////////////////////////////////////////////////////////////// /// @brief cursor template - DEPRECATED //////////////////////////////////////////////////////////////////////////////// v8::Persistent CursorTempl; //////////////////////////////////////////////////////////////////////////////// /// @brief where clause template //////////////////////////////////////////////////////////////////////////////// v8::Persistent WhereTempl; //////////////////////////////////////////////////////////////////////////////// /// @brief TRI_vocbase_col_t template //////////////////////////////////////////////////////////////////////////////// v8::Persistent VocbaseColTempl; //////////////////////////////////////////////////////////////////////////////// /// @brief TRI_vocbase_t template //////////////////////////////////////////////////////////////////////////////// v8::Persistent VocbaseTempl; //////////////////////////////////////////////////////////////////////////////// /// @brief TRI_shaped_json_t template //////////////////////////////////////////////////////////////////////////////// v8::Persistent ShapedJsonTempl; //////////////////////////////////////////////////////////////////////////////// /// @brief skiplistoperator template //////////////////////////////////////////////////////////////////////////////// v8::Persistent SLOperatorTempl; //////////////////////////////////////////////////////////////////////////////// /// @brief dictionary template //////////////////////////////////////////////////////////////////////////////// v8::Persistent DictionaryTempl; //////////////////////////////////////////////////////////////////////////////// /// @} //////////////////////////////////////////////////////////////////////////////// // ----------------------------------------------------------------------------- // --SECTION-- JAVASCRIPT CONSTANTS // ----------------------------------------------------------------------------- //////////////////////////////////////////////////////////////////////////////// /// @addtogroup V8Globals /// @{ //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /// @brief "collection" query type //////////////////////////////////////////////////////////////////////////////// v8::Persistent CollectionQueryType; //////////////////////////////////////////////////////////////////////////////// /// @brief "DELETE" function name //////////////////////////////////////////////////////////////////////////////// v8::Persistent DeleteConstant; //////////////////////////////////////////////////////////////////////////////// /// @brief "GET" function name //////////////////////////////////////////////////////////////////////////////// v8::Persistent GetConstant; //////////////////////////////////////////////////////////////////////////////// /// @brief "HEAD" function name //////////////////////////////////////////////////////////////////////////////// v8::Persistent HeadConstant; //////////////////////////////////////////////////////////////////////////////// /// @brief "POST" function name //////////////////////////////////////////////////////////////////////////////// v8::Persistent PostConstant; //////////////////////////////////////////////////////////////////////////////// /// @brief "PUT" function name //////////////////////////////////////////////////////////////////////////////// v8::Persistent PutConstant; //////////////////////////////////////////////////////////////////////////////// /// @} //////////////////////////////////////////////////////////////////////////////// // ----------------------------------------------------------------------------- // --SECTION-- JAVASCRIPT FUNCTION NAMES // ----------------------------------------------------------------------------- //////////////////////////////////////////////////////////////////////////////// /// @addtogroup V8Globals /// @{ //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /// @brief "output" function name //////////////////////////////////////////////////////////////////////////////// v8::Persistent OutputFuncName; //////////////////////////////////////////////////////////////////////////////// /// @brief "print" function name //////////////////////////////////////////////////////////////////////////////// v8::Persistent PrintFuncName; //////////////////////////////////////////////////////////////////////////////// /// @} //////////////////////////////////////////////////////////////////////////////// // ----------------------------------------------------------------------------- // --SECTION-- JAVASCRIPT KEY NAMES // ----------------------------------------------------------------------------- //////////////////////////////////////////////////////////////////////////////// /// @addtogroup V8Globals /// @{ //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /// @brief "_id" key name //////////////////////////////////////////////////////////////////////////////// v8::Persistent DidKey; //////////////////////////////////////////////////////////////////////////////// /// @brief "_from" key name //////////////////////////////////////////////////////////////////////////////// v8::Persistent FromKey; //////////////////////////////////////////////////////////////////////////////// /// @brief "id" key name //////////////////////////////////////////////////////////////////////////////// v8::Persistent IidKey; //////////////////////////////////////////////////////////////////////////////// /// @brief "_oldRev" key name //////////////////////////////////////////////////////////////////////////////// v8::Persistent OldRevKey; //////////////////////////////////////////////////////////////////////////////// /// @brief "_rev" key name //////////////////////////////////////////////////////////////////////////////// v8::Persistent RevKey; //////////////////////////////////////////////////////////////////////////////// /// @brief "_to" key name //////////////////////////////////////////////////////////////////////////////// v8::Persistent ToKey; //////////////////////////////////////////////////////////////////////////////// /// @brief "body" key name //////////////////////////////////////////////////////////////////////////////// v8::Persistent BodyKey; //////////////////////////////////////////////////////////////////////////////// /// @brief "contentType" key name //////////////////////////////////////////////////////////////////////////////// v8::Persistent ContentTypeKey; //////////////////////////////////////////////////////////////////////////////// /// @brief "headers" key name //////////////////////////////////////////////////////////////////////////////// v8::Persistent HeadersKey; //////////////////////////////////////////////////////////////////////////////// /// @brief "journalSize" key name //////////////////////////////////////////////////////////////////////////////// v8::Persistent JournalSizeKey; //////////////////////////////////////////////////////////////////////////////// /// @brief "parameters" key name //////////////////////////////////////////////////////////////////////////////// v8::Persistent ParametersKey; //////////////////////////////////////////////////////////////////////////////// /// @brief "requestBody" key name //////////////////////////////////////////////////////////////////////////////// v8::Persistent RequestBodyKey; //////////////////////////////////////////////////////////////////////////////// /// @brief "requestType" key name //////////////////////////////////////////////////////////////////////////////// v8::Persistent RequestTypeKey; //////////////////////////////////////////////////////////////////////////////// /// @brief "responseCode" key name //////////////////////////////////////////////////////////////////////////////// v8::Persistent ResponseCodeKey; //////////////////////////////////////////////////////////////////////////////// /// @brief "suffix" key name //////////////////////////////////////////////////////////////////////////////// v8::Persistent SuffixKey; //////////////////////////////////////////////////////////////////////////////// /// @brief "waitForSync" key name //////////////////////////////////////////////////////////////////////////////// v8::Persistent WaitForSyncKey; //////////////////////////////////////////////////////////////////////////////// /// @} //////////////////////////////////////////////////////////////////////////////// // ----------------------------------------------------------------------------- // --SECTION-- REGULAR EXPRESSIONS // ----------------------------------------------------------------------------- //////////////////////////////////////////////////////////////////////////////// /// @addtogroup V8Globals /// @{ //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /// @brief document identifier as collection-id:document-id //////////////////////////////////////////////////////////////////////////////// regex_t DocumentIdRegex; //////////////////////////////////////////////////////////////////////////////// /// @brief index identifier as collection-id:index-id //////////////////////////////////////////////////////////////////////////////// regex_t IndexIdRegex; } TRI_v8_global_t; //////////////////////////////////////////////////////////////////////////////// /// @} //////////////////////////////////////////////////////////////////////////////// #endif // Local Variables: // mode: outline-minor // outline-regexp: "^\\(/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|// --SECTION--\\|/// @\\}\\)" // End: