1
0
Fork 0

Add RootPlan.

This commit is contained in:
Max Neunhoeffer 2014-07-28 15:51:36 +02:00
parent c9026aa176
commit 325dfb007b
2 changed files with 89 additions and 0 deletions

View File

@ -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
////////////////////////////////////////////////////////////////////////////////

View File

@ -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