//////////////////////////////////////////////////////////////////////////////// /// @brief V8-vocbase bridge /// /// @file /// /// DISCLAIMER /// /// Copyright 2010-2011 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, triagens GmbH, Cologne, Germany //////////////////////////////////////////////////////////////////////////////// #ifndef TRIAGENS_DURHAM_V8_V8_GLOBALS_H #define TRIAGENS_DURHAM_V8_V8_GLOBALS_H 1 #include #include #include #include #include #include // ----------------------------------------------------------------------------- // --SECTION-- public types // ----------------------------------------------------------------------------- //////////////////////////////////////////////////////////////////////////////// /// @addtogroup V8Globals /// @{ //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /// @brief globals stored in the isolate //////////////////////////////////////////////////////////////////////////////// typedef struct TRI_v8_global_s { //////////////////////////////////////////////////////////////////////////////// /// @brief constructor //////////////////////////////////////////////////////////////////////////////// TRI_v8_global_s () : JSQueries(), JSResultSets(), Actions(), ActionsLock(), EdgesTempl(), EdgesColTempl(), QueryTempl(), VocbaseColTempl(), VocbaseTempl(), OutputFuncName(), PrintFuncName(), ToStringFuncName(), CollectionQueryType(), ContentType(), BodyKey(), DidKey(), FromKey(), JournalSizeKey(), ParametersKey(), ResponseCodeKey(), SyncAfterBytesKey(), SyncAfterObjectsKey(), SyncAfterTimeKey(), ToKey(), DocumentIdRegex() { } //////////////////////////////////////////////////////////////////////////////// /// @brief query mapping for weak pointers //////////////////////////////////////////////////////////////////////////////// std::map< TRI_query_t*, v8::Persistent > JSQueries; //////////////////////////////////////////////////////////////////////////////// /// @brief result set mapping for weak pointers //////////////////////////////////////////////////////////////////////////////// std::map< TRI_result_set_t*, v8::Persistent > JSResultSets; //////////////////////////////////////////////////////////////////////////////// /// @brief map of callbacks for an action //////////////////////////////////////////////////////////////////////////////// std::map Actions; //////////////////////////////////////////////////////////////////////////////// /// @brief lock for the actions //////////////////////////////////////////////////////////////////////////////// triagens::basics::ReadWriteLock ActionsLock; // ----------------------------------------------------------------------------- // --SECTION-- JAVASCRIPT OBJECT TEMPLATES // ----------------------------------------------------------------------------- //////////////////////////////////////////////////////////////////////////////// /// @brief TRI_vocbase_t template for edges //////////////////////////////////////////////////////////////////////////////// v8::Persistent EdgesTempl; //////////////////////////////////////////////////////////////////////////////// /// @brief TRI_vocbase_col_t template for edges //////////////////////////////////////////////////////////////////////////////// v8::Persistent EdgesColTempl; //////////////////////////////////////////////////////////////////////////////// /// @brief query template //////////////////////////////////////////////////////////////////////////////// v8::Persistent QueryTempl; //////////////////////////////////////////////////////////////////////////////// /// @brief TRI_vocbase_col_t template //////////////////////////////////////////////////////////////////////////////// v8::Persistent VocbaseColTempl; //////////////////////////////////////////////////////////////////////////////// /// @brief TRI_vocbase_t template //////////////////////////////////////////////////////////////////////////////// v8::Persistent VocbaseTempl; // ----------------------------------------------------------------------------- // --SECTION-- JAVASCRIPT FUNCTION NAMES // ----------------------------------------------------------------------------- //////////////////////////////////////////////////////////////////////////////// /// @brief "output" function name //////////////////////////////////////////////////////////////////////////////// v8::Persistent OutputFuncName; //////////////////////////////////////////////////////////////////////////////// /// @brief "print" function name //////////////////////////////////////////////////////////////////////////////// v8::Persistent PrintFuncName; //////////////////////////////////////////////////////////////////////////////// /// @brief "toString" function name //////////////////////////////////////////////////////////////////////////////// v8::Persistent ToStringFuncName; // ----------------------------------------------------------------------------- // --SECTION-- JAVASCRIPT KEY NAMES // ----------------------------------------------------------------------------- //////////////////////////////////////////////////////////////////////////////// /// @brief "collection" query type //////////////////////////////////////////////////////////////////////////////// v8::Persistent CollectionQueryType; //////////////////////////////////////////////////////////////////////////////// /// @brief "contentType" key name //////////////////////////////////////////////////////////////////////////////// v8::Persistent ContentType; //////////////////////////////////////////////////////////////////////////////// /// @brief "body" key name //////////////////////////////////////////////////////////////////////////////// v8::Persistent BodyKey; //////////////////////////////////////////////////////////////////////////////// /// @brief "_id" key name //////////////////////////////////////////////////////////////////////////////// v8::Persistent DidKey; //////////////////////////////////////////////////////////////////////////////// /// @brief "_from" key name //////////////////////////////////////////////////////////////////////////////// v8::Persistent FromKey; //////////////////////////////////////////////////////////////////////////////// /// @brief "journalSize" key name //////////////////////////////////////////////////////////////////////////////// v8::Persistent JournalSizeKey; //////////////////////////////////////////////////////////////////////////////// /// @brief "parameters" key name //////////////////////////////////////////////////////////////////////////////// v8::Persistent ParametersKey; //////////////////////////////////////////////////////////////////////////////// /// @brief "responseCode" key name //////////////////////////////////////////////////////////////////////////////// v8::Persistent ResponseCodeKey; //////////////////////////////////////////////////////////////////////////////// /// @brief "syncAfterBytes" key name //////////////////////////////////////////////////////////////////////////////// v8::Persistent SyncAfterBytesKey; //////////////////////////////////////////////////////////////////////////////// /// @brief "syncAfterObjects" key name //////////////////////////////////////////////////////////////////////////////// v8::Persistent SyncAfterObjectsKey; //////////////////////////////////////////////////////////////////////////////// /// @brief "syncAfterTime" key name //////////////////////////////////////////////////////////////////////////////// v8::Persistent SyncAfterTimeKey; //////////////////////////////////////////////////////////////////////////////// /// @brief "_to" key name //////////////////////////////////////////////////////////////////////////////// v8::Persistent ToKey; // ----------------------------------------------------------------------------- // --SECTION-- REGULAR EXPRESSIONS // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- // --SECTION-- private variables // ----------------------------------------------------------------------------- //////////////////////////////////////////////////////////////////////////////// /// @brief document identifier as collection-id:document-id //////////////////////////////////////////////////////////////////////////////// regex_t DocumentIdRegex; } TRI_v8_global_t; //////////////////////////////////////////////////////////////////////////////// /// @} //////////////////////////////////////////////////////////////////////////////// #endif // Local Variables: // mode: outline-minor // outline-regexp: "^\\(/// @brief\\|/// @addtogroup\\|// --SECTION--\\)" // End: