1
0
Fork 0

removed macro

This commit is contained in:
Jan Steemann 2014-10-16 16:28:18 +02:00
parent 968234ece4
commit 70c59a61fd
15 changed files with 47 additions and 48 deletions

View File

@ -503,7 +503,7 @@ AqlItemBlock* AqlItemBlock::concatenate (std::vector<AqlItemBlock*> const& block
/// such that actual indices start at 2
////////////////////////////////////////////////////////////////////////////////
Json AqlItemBlock::toJson (AQL_TRANSACTION_V8* trx) const {
Json AqlItemBlock::toJson (triagens::arango::AqlTransaction* trx) const {
Json json(Json::Array, 6);
json("nrItems", Json(static_cast<double>(_nrItems)))
("nrRegs", Json(static_cast<double>(_nrRegs)));

View File

@ -292,7 +292,7 @@ namespace triagens {
/// be used to recreate the AqlItemBlock via the Json constructor
////////////////////////////////////////////////////////////////////////////////
triagens::basics::Json toJson (AQL_TRANSACTION_V8* trx) const;
triagens::basics::Json toJson (triagens::arango::AqlTransaction* trx) const;
// -----------------------------------------------------------------------------
// --SECTION-- private variables

View File

@ -399,7 +399,7 @@ char const* AqlValue::toChar () const {
/// @brief construct a V8 value as input for the expression execution in V8
////////////////////////////////////////////////////////////////////////////////
v8::Handle<v8::Value> AqlValue::toV8 (AQL_TRANSACTION_V8* trx,
v8::Handle<v8::Value> AqlValue::toV8 (triagens::arango::AqlTransaction* trx,
TRI_document_collection_t const* document) const {
switch (_type) {
case JSON: {
@ -410,7 +410,7 @@ v8::Handle<v8::Value> AqlValue::toV8 (AQL_TRANSACTION_V8* trx,
case SHAPED: {
TRI_ASSERT(document != nullptr);
TRI_ASSERT(_marker != nullptr);
return TRI_WrapShapedJson<AQL_TRANSACTION_V8>(*trx, document->_info._cid, _marker);
return TRI_WrapShapedJson<triagens::arango::AqlTransaction>(*trx, document->_info._cid, _marker);
}
case DOCVEC: {
@ -465,7 +465,7 @@ v8::Handle<v8::Value> AqlValue::toV8 (AQL_TRANSACTION_V8* trx,
/// @brief toJson method
////////////////////////////////////////////////////////////////////////////////
Json AqlValue::toJson (AQL_TRANSACTION_V8* trx,
Json AqlValue::toJson (triagens::arango::AqlTransaction* trx,
TRI_document_collection_t const* document) const {
switch (_type) {
case JSON: {
@ -562,7 +562,7 @@ Json AqlValue::toJson (AQL_TRANSACTION_V8* trx,
/// this will return an empty Json if the value is not an array
////////////////////////////////////////////////////////////////////////////////
Json AqlValue::extractArrayMember (AQL_TRANSACTION_V8* trx,
Json AqlValue::extractArrayMember (triagens::arango::AqlTransaction* trx,
TRI_document_collection_t const* document,
char const* name) const {
switch (_type) {
@ -652,7 +652,7 @@ Json AqlValue::extractArrayMember (AQL_TRANSACTION_V8* trx,
/// this will return null if the value is not a list
////////////////////////////////////////////////////////////////////////////////
Json AqlValue::extractListMember (AQL_TRANSACTION_V8* trx,
Json AqlValue::extractListMember (triagens::arango::AqlTransaction* trx,
TRI_document_collection_t const* document,
int64_t position) const {
switch (_type) {
@ -726,7 +726,7 @@ Json AqlValue::extractListMember (AQL_TRANSACTION_V8* trx,
/// @brief create an AqlValue from a vector of AqlItemBlock*s
////////////////////////////////////////////////////////////////////////////////
AqlValue AqlValue::CreateFromBlocks (AQL_TRANSACTION_V8* trx,
AqlValue AqlValue::CreateFromBlocks (triagens::arango::AqlTransaction* trx,
std::vector<AqlItemBlock*> const& src,
std::vector<std::string> const& variableNames) {
size_t totalSize = 0;
@ -762,7 +762,7 @@ AqlValue AqlValue::CreateFromBlocks (AQL_TRANSACTION_V8* trx,
/// @brief 3-way comparison for AqlValue objects
////////////////////////////////////////////////////////////////////////////////
int AqlValue::Compare (AQL_TRANSACTION_V8* trx,
int AqlValue::Compare (triagens::arango::AqlTransaction* trx,
AqlValue const& left,
TRI_document_collection_t const* leftcoll,
AqlValue const& right,

View File

@ -217,14 +217,14 @@ namespace triagens {
/// @brief construct a V8 value as input for the expression execution in V8
////////////////////////////////////////////////////////////////////////////////
v8::Handle<v8::Value> toV8 (AQL_TRANSACTION_V8*,
v8::Handle<v8::Value> toV8 (triagens::arango::AqlTransaction*,
TRI_document_collection_t const*) const;
////////////////////////////////////////////////////////////////////////////////
/// @brief toJson method
////////////////////////////////////////////////////////////////////////////////
triagens::basics::Json toJson (AQL_TRANSACTION_V8*,
triagens::basics::Json toJson (triagens::arango::AqlTransaction*,
TRI_document_collection_t const*) const;
////////////////////////////////////////////////////////////////////////////////
@ -232,7 +232,7 @@ namespace triagens {
/// this will return null if the value is not an array
////////////////////////////////////////////////////////////////////////////////
triagens::basics::Json extractArrayMember (AQL_TRANSACTION_V8*,
triagens::basics::Json extractArrayMember (triagens::arango::AqlTransaction*,
TRI_document_collection_t const*,
char const*) const;
@ -241,7 +241,7 @@ namespace triagens {
/// this will return null if the value is not a list
////////////////////////////////////////////////////////////////////////////////
triagens::basics::Json extractListMember (AQL_TRANSACTION_V8*,
triagens::basics::Json extractListMember (triagens::arango::AqlTransaction*,
TRI_document_collection_t const*,
int64_t) const;
@ -249,7 +249,7 @@ namespace triagens {
/// @brief create an AqlValue from a vector of AqlItemBlock*s
////////////////////////////////////////////////////////////////////////////////
static AqlValue CreateFromBlocks (AQL_TRANSACTION_V8*,
static AqlValue CreateFromBlocks (triagens::arango::AqlTransaction*,
std::vector<AqlItemBlock*> const&,
std::vector<std::string> const&);
@ -257,7 +257,7 @@ namespace triagens {
/// @brief 3-way comparison for AqlValue objects
////////////////////////////////////////////////////////////////////////////////
static int Compare (AQL_TRANSACTION_V8*,
static int Compare (triagens::arango::AqlTransaction*,
AqlValue const&,
TRI_document_collection_t const*,
AqlValue const&,

View File

@ -304,7 +304,7 @@ namespace triagens {
/// @brief the transaction for this query
////////////////////////////////////////////////////////////////////////////////
AQL_TRANSACTION_V8* _trx;
triagens::arango::AqlTransaction* _trx;
////////////////////////////////////////////////////////////////////////////////
/// @brief our corresponding ExecutionNode node
@ -978,7 +978,7 @@ namespace triagens {
class OurLessThan {
public:
OurLessThan (AQL_TRANSACTION_V8* trx,
OurLessThan (triagens::arango::AqlTransaction* trx,
std::deque<AqlItemBlock*>& buffer,
std::vector<std::pair<RegisterId, bool>>& sortRegisters,
std::vector<TRI_document_collection_t const*>& colls)
@ -992,7 +992,7 @@ namespace triagens {
std::pair<size_t, size_t> const& b);
private:
AQL_TRANSACTION_V8* _trx;
triagens::arango::AqlTransaction* _trx;
std::deque<AqlItemBlock*>& _buffer;
std::vector<std::pair<RegisterId, bool>>& _sortRegisters;
std::vector<TRI_document_collection_t const*>& _colls;
@ -1482,7 +1482,7 @@ namespace triagens {
class OurLessThan {
public:
OurLessThan (AQL_TRANSACTION_V8* trx,
OurLessThan (triagens::arango::AqlTransaction* trx,
std::vector<std::deque<AqlItemBlock*>>& gatherBlockBuffer,
std::vector<std::pair<RegisterId, bool>>& sortRegisters,
std::vector<TRI_document_collection_t const*>& colls)
@ -1496,7 +1496,7 @@ namespace triagens {
std::pair<size_t, size_t> const& b);
private:
AQL_TRANSACTION_V8* _trx;
triagens::arango::AqlTransaction* _trx;
std::vector<std::deque<AqlItemBlock*>>& _gatherBlockBuffer;
std::vector<std::pair<RegisterId, bool>>& _sortRegisters;
std::vector<TRI_document_collection_t const*>& _colls;

View File

@ -277,7 +277,7 @@ struct CoordinatorInstanciator : public WalkerWorker<ExecutionNode> {
std::vector<ExecutionNode*> nodes;
};
std::shared_ptr<AQL_TRANSACTION_V8> trx;
std::shared_ptr<triagens::arango::AqlTransaction> trx;
Query* query;
QueryRegistry* queryRegistry;
ExecutionBlock* root;

View File

@ -107,7 +107,7 @@ std::unordered_set<Variable*> Expression::variables () const {
/// @brief execute the expression
////////////////////////////////////////////////////////////////////////////////
AqlValue Expression::execute (AQL_TRANSACTION_V8* trx,
AqlValue Expression::execute (triagens::arango::AqlTransaction* trx,
std::vector<TRI_document_collection_t const*>& docColls,
std::vector<AqlValue>& argv,
size_t startPos,
@ -213,7 +213,7 @@ void Expression::analyzeExpression () {
AqlValue Expression::executeSimpleExpression (AstNode const* node,
TRI_document_collection_t const** collection,
AQL_TRANSACTION_V8* trx,
triagens::arango::AqlTransaction* trx,
std::vector<TRI_document_collection_t const*>& docColls,
std::vector<AqlValue>& argv,
size_t startPos,

View File

@ -150,7 +150,7 @@ namespace triagens {
/// @brief execute the expression
////////////////////////////////////////////////////////////////////////////////
AqlValue execute (AQL_TRANSACTION_V8* trx,
AqlValue execute (triagens::arango::AqlTransaction* trx,
std::vector<TRI_document_collection_t const*>&,
std::vector<AqlValue>&, size_t,
std::vector<Variable*> const&,
@ -219,7 +219,7 @@ namespace triagens {
AqlValue executeSimpleExpression (AstNode const*,
TRI_document_collection_t const**,
AQL_TRANSACTION_V8*,
triagens::arango::AqlTransaction*,
std::vector<TRI_document_collection_t const*>&,
std::vector<AqlValue>&, size_t,
std::vector<Variable*> const&,

View File

@ -38,7 +38,7 @@ using Json = triagens::basics::Json;
/// @brief function IS_NULL
////////////////////////////////////////////////////////////////////////////////
AqlValue Functions::IsNull (AQL_TRANSACTION_V8* trx,
AqlValue Functions::IsNull (triagens::arango::AqlTransaction* trx,
TRI_document_collection_t const* collection,
AqlValue const parameters) {
Json j(parameters.extractListMember(trx, collection, 0));
@ -49,7 +49,7 @@ AqlValue Functions::IsNull (AQL_TRANSACTION_V8* trx,
/// @brief function IS_BOOL
////////////////////////////////////////////////////////////////////////////////
AqlValue Functions::IsBool (AQL_TRANSACTION_V8* trx,
AqlValue Functions::IsBool (triagens::arango::AqlTransaction* trx,
TRI_document_collection_t const* collection,
AqlValue const parameters) {
Json j(parameters.extractListMember(trx, collection, 0));
@ -60,7 +60,7 @@ AqlValue Functions::IsBool (AQL_TRANSACTION_V8* trx,
/// @brief function IS_NUMBER
////////////////////////////////////////////////////////////////////////////////
AqlValue Functions::IsNumber (AQL_TRANSACTION_V8* trx,
AqlValue Functions::IsNumber (triagens::arango::AqlTransaction* trx,
TRI_document_collection_t const* collection,
AqlValue const parameters) {
Json j(parameters.extractListMember(trx, collection, 0));
@ -71,7 +71,7 @@ AqlValue Functions::IsNumber (AQL_TRANSACTION_V8* trx,
/// @brief function IS_STRING
////////////////////////////////////////////////////////////////////////////////
AqlValue Functions::IsString (AQL_TRANSACTION_V8* trx,
AqlValue Functions::IsString (triagens::arango::AqlTransaction* trx,
TRI_document_collection_t const* collection,
AqlValue const parameters) {
Json j(parameters.extractListMember(trx, collection, 0));
@ -82,7 +82,7 @@ AqlValue Functions::IsString (AQL_TRANSACTION_V8* trx,
/// @brief function IS_LIST
////////////////////////////////////////////////////////////////////////////////
AqlValue Functions::IsList (AQL_TRANSACTION_V8* trx,
AqlValue Functions::IsList (triagens::arango::AqlTransaction* trx,
TRI_document_collection_t const* collection,
AqlValue const parameters) {
Json j(parameters.extractListMember(trx, collection, 0));
@ -93,7 +93,7 @@ AqlValue Functions::IsList (AQL_TRANSACTION_V8* trx,
/// @brief function IS_DOCUMENT
////////////////////////////////////////////////////////////////////////////////
AqlValue Functions::IsDocument (AQL_TRANSACTION_V8* trx,
AqlValue Functions::IsDocument (triagens::arango::AqlTransaction* trx,
TRI_document_collection_t const* collection,
AqlValue const parameters) {
Json j(parameters.extractListMember(trx, collection, 0));

View File

@ -32,13 +32,14 @@
#include "Basics/Common.h"
#include "Aql/AqlValue.h"
#include "Utils/AqlTransaction.h"
#include <functional>
namespace triagens {
namespace aql {
typedef std::function<AqlValue(AQL_TRANSACTION_V8*,
typedef std::function<AqlValue(triagens::arango::AqlTransaction*,
TRI_document_collection_t const*,
AqlValue const)> FunctionImplementation;
@ -48,12 +49,12 @@ namespace triagens {
/// @brief function IS_NULL
////////////////////////////////////////////////////////////////////////////////
static AqlValue IsNull (AQL_TRANSACTION_V8*, TRI_document_collection_t const*, AqlValue const);
static AqlValue IsBool (AQL_TRANSACTION_V8*, TRI_document_collection_t const*, AqlValue const);
static AqlValue IsNumber (AQL_TRANSACTION_V8*, TRI_document_collection_t const*, AqlValue const);
static AqlValue IsString (AQL_TRANSACTION_V8*, TRI_document_collection_t const*, AqlValue const);
static AqlValue IsList (AQL_TRANSACTION_V8*, TRI_document_collection_t const*, AqlValue const);
static AqlValue IsDocument (AQL_TRANSACTION_V8*, TRI_document_collection_t const*, AqlValue const);
static AqlValue IsNull (triagens::arango::AqlTransaction*, TRI_document_collection_t const*, AqlValue const);
static AqlValue IsBool (triagens::arango::AqlTransaction*, TRI_document_collection_t const*, AqlValue const);
static AqlValue IsNumber (triagens::arango::AqlTransaction*, TRI_document_collection_t const*, AqlValue const);
static AqlValue IsString (triagens::arango::AqlTransaction*, TRI_document_collection_t const*, AqlValue const);
static AqlValue IsList (triagens::arango::AqlTransaction*, TRI_document_collection_t const*, AqlValue const);
static AqlValue IsDocument (triagens::arango::AqlTransaction*, TRI_document_collection_t const*, AqlValue const);
};
}

View File

@ -385,7 +385,7 @@ QueryResult Query::prepare (QueryRegistry* registry) {
// std::cout << "AST: " << triagens::basics::JsonHelper::toString(parser->ast()->toJson(TRI_UNKNOWN_MEM_ZONE, false)) << "\n";
}
std::shared_ptr<AQL_TRANSACTION_V8> trx(new AQL_TRANSACTION_V8(new triagens::arango::V8TransactionContext(true), _vocbase, _collections.collections()));
std::shared_ptr<triagens::arango::AqlTransaction> trx(new triagens::arango::AqlTransaction(new triagens::arango::V8TransactionContext(true), _vocbase, _collections.collections()));
_trx = trx;
bool planRegisters;
@ -594,7 +594,7 @@ QueryResult Query::explain () {
// std::cout << "AST: " << triagens::basics::JsonHelper::toString(parser.ast()->toJson(TRI_UNKNOWN_MEM_ZONE)) << "\n";
// create the transaction object, but do not start it yet
std::shared_ptr<AQL_TRANSACTION_V8> trx(new AQL_TRANSACTION_V8(new triagens::arango::V8TransactionContext(true), _vocbase, _collections.collections()));
std::shared_ptr<triagens::arango::AqlTransaction> trx(new triagens::arango::AqlTransaction(new triagens::arango::V8TransactionContext(true), _vocbase, _collections.collections()));
_trx = trx;
// we have an AST

View File

@ -344,7 +344,7 @@ namespace triagens {
/// @brief return the transaction, if prepared
////////////////////////////////////////////////////////////////////////////////
AQL_TRANSACTION_V8* trx () {
triagens::arango::AqlTransaction* trx () {
return &*_trx;
}
@ -352,12 +352,12 @@ namespace triagens {
/// @brief set the transaction for the query
////////////////////////////////////////////////////////////////////////////////
void setTrxPtr (std::shared_ptr<AQL_TRANSACTION_V8>& trx) {
void setTrxPtr (std::shared_ptr<triagens::arango::AqlTransaction>& trx) {
TRI_ASSERT(_trx == nullptr);
_trx = trx;
}
std::shared_ptr<AQL_TRANSACTION_V8>& getTrxPtr () {
std::shared_ptr<triagens::arango::AqlTransaction>& getTrxPtr () {
return _trx;
}
////////////////////////////////////////////////////////////////////////////////
@ -517,7 +517,7 @@ namespace triagens {
/// to the HTTP API for queries.
////////////////////////////////////////////////////////////////////////////////
std::shared_ptr<AQL_TRANSACTION_V8> _trx;
std::shared_ptr<triagens::arango::AqlTransaction> _trx;
////////////////////////////////////////////////////////////////////////////////
/// @brief the ExecutionEngine object, if the query is prepared

View File

@ -67,7 +67,7 @@ V8Expression::~V8Expression () {
/// @brief execute the expression
////////////////////////////////////////////////////////////////////////////////
AqlValue V8Expression::execute (AQL_TRANSACTION_V8* trx,
AqlValue V8Expression::execute (triagens::arango::AqlTransaction* trx,
std::vector<TRI_document_collection_t const*>& docColls,
std::vector<AqlValue>& argv,
size_t startPos,

View File

@ -71,7 +71,7 @@ namespace triagens {
/// @brief execute the expression
////////////////////////////////////////////////////////////////////////////////
AqlValue execute (AQL_TRANSACTION_V8*,
AqlValue execute (triagens::arango::AqlTransaction*,
std::vector<TRI_document_collection_t const*>&,
std::vector<AqlValue>&,
size_t,

View File

@ -41,8 +41,6 @@
#include "VocBase/vocbase.h"
#include <v8.h>
#define AQL_TRANSACTION_V8 triagens::arango::AqlTransaction
namespace triagens {
namespace arango {