mirror of https://gitee.com/bigwinds/arangodb
Add RootPlan.
This commit is contained in:
parent
c9026aa176
commit
325dfb007b
|
@ -199,6 +199,31 @@ Json CalculationPlan::toJson (TRI_memory_zone_t* zone) {
|
|||
return json;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- methods of RootPlan
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief toJson, for RootPlan
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Json RootPlan::toJson (TRI_memory_zone_t* zone) {
|
||||
Json json(ExecutionPlan::toJson(zone)); // call base class method
|
||||
if (json.isEmpty()) {
|
||||
return json;
|
||||
}
|
||||
// Now put info about ...
|
||||
try {
|
||||
// TODO: add specific stuff
|
||||
}
|
||||
catch (std::exception& e) {
|
||||
return Json();
|
||||
}
|
||||
|
||||
// And return it:
|
||||
return json;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief test function
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -475,6 +475,70 @@ namespace triagens {
|
|||
AqlExpression* _aqlExpression;
|
||||
|
||||
};
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- class RootPlan
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief class RootPlan, derived from ExecutionPlan
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class RootPlan : public ExecutionPlan {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief constructors for various arguments, always with offset and limit
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public:
|
||||
|
||||
RootPlan ()
|
||||
: ExecutionPlan(), dummy(0) {
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief return the type of the node
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
virtual NodeType getType () {
|
||||
return ROOT;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief return the type of the node as a string
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
virtual std::string getTypeString () {
|
||||
return std::string("RootPlan");
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief export to JSON
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
virtual triagens::basics::Json toJson (
|
||||
TRI_memory_zone_t* zone = TRI_UNKNOWN_MEM_ZONE);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief clone execution plan recursively
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
virtual ExecutionPlan* clone () {
|
||||
auto c = new RootPlan();
|
||||
cloneDependencies(c);
|
||||
return static_cast<ExecutionPlan*>(c);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief we need to know the offset and limit
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private:
|
||||
|
||||
int dummy;
|
||||
|
||||
};
|
||||
} // namespace triagens::aql
|
||||
} // namespace triagens
|
||||
|
||||
|
|
Loading…
Reference in New Issue