//////////////////////////////////////////////////////////////////////////////// /// @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" // ----------------------------------------------------------------------------- // --SECTION-- public types // ----------------------------------------------------------------------------- //////////////////////////////////////////////////////////////////////////////// /// @addtogroup V8Globals /// @{ //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /// @brief globals stored in the isolate //////////////////////////////////////////////////////////////////////////////// typedef struct TRI_v8_global_s { //////////////////////////////////////////////////////////////////////////////// /// @brief constructor //////////////////////////////////////////////////////////////////////////////// TRI_v8_global_s () : JSGeneralCursors(), JSBarriers(), ErrorTempl(), GeneralCursorTempl(), VocbaseColTempl(), VocbaseTempl(), DictionaryTempl(), CollectionQueryType(), DidKey(), FromKey(), IidKey(), OldRevKey(), RevKey(), ToKey(), BodyKey(), ContentTypeKey(), JournalSizeKey(), ParametersKey(), PathKey(), PrefixKey(), ResponseCodeKey(), SuffixKey(), UserKey(), WaitForSyncKey(), DocumentIdRegex(), IndexIdRegex() { } ~TRI_v8_global_s () { regfree(&DocumentIdRegex); regfree(&IndexIdRegex); } //////////////////////////////////////////////////////////////////////////////// /// @brief general cursor mapping for weak pointers //////////////////////////////////////////////////////////////////////////////// std::map< void*, v8::Persistent > JSGeneralCursors; //////////////////////////////////////////////////////////////////////////////// /// @brief barrier mapping for weak pointers //////////////////////////////////////////////////////////////////////////////// std::map< void*, v8::Persistent > JSBarriers; //////////////////////////////////////////////////////////////////////////////// /// @brief barrier mapping for weak pointers //////////////////////////////////////////////////////////////////////////////// std::map< void*, v8::Persistent > JSOperators; //////////////////////////////////////////////////////////////////////////////// /// @} //////////////////////////////////////////////////////////////////////////////// // ----------------------------------------------------------------------------- // --SECTION-- JAVASCRIPT OBJECT TEMPLATES // ----------------------------------------------------------------------------- //////////////////////////////////////////////////////////////////////////////// /// @addtogroup V8Globals /// @{ //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /// @brief error template //////////////////////////////////////////////////////////////////////////////// v8::Persistent ErrorTempl; //////////////////////////////////////////////////////////////////////////////// /// @brief general cursor template //////////////////////////////////////////////////////////////////////////////// v8::Persistent GeneralCursorTempl; //////////////////////////////////////////////////////////////////////////////// /// @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 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 "PATCH" function name //////////////////////////////////////////////////////////////////////////////// v8::Persistent PatchConstant; //////////////////////////////////////////////////////////////////////////////// /// @brief "POST" function name //////////////////////////////////////////////////////////////////////////////// v8::Persistent PostConstant; //////////////////////////////////////////////////////////////////////////////// /// @brief "PUT" function name //////////////////////////////////////////////////////////////////////////////// v8::Persistent PutConstant; //////////////////////////////////////////////////////////////////////////////// /// @} //////////////////////////////////////////////////////////////////////////////// // ----------------------------------------------------------------------------- // --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 "path" key name //////////////////////////////////////////////////////////////////////////////// v8::Persistent PathKey; //////////////////////////////////////////////////////////////////////////////// /// @brief "prefix" key name //////////////////////////////////////////////////////////////////////////////// v8::Persistent PrefixKey; //////////////////////////////////////////////////////////////////////////////// /// @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 "user" key name //////////////////////////////////////////////////////////////////////////////// v8::Persistent UserKey; //////////////////////////////////////////////////////////////////////////////// /// @brief "transformations" key name //////////////////////////////////////////////////////////////////////////////// v8::Persistent TransformationsKey; //////////////////////////////////////////////////////////////////////////////// /// @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\\|/// @page\\|// --SECTION--\\|/// @\\}\\)" // End: