1
0
Fork 0
arangodb/arangod/Aql/Function.h

167 lines
6.5 KiB
C++

////////////////////////////////////////////////////////////////////////////////
/// @brief Aql, built-in AQL function
///
/// @file
///
/// DISCLAIMER
///
/// Copyright 2014 ArangoDB GmbH, Cologne, Germany
/// Copyright 2004-2014 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 ArangoDB GmbH, Cologne, Germany
///
/// @author Jan Steemann
/// @author Copyright 2014, ArangoDB GmbH, Cologne, Germany
/// @author Copyright 2012-2013, triAGENS GmbH, Cologne, Germany
////////////////////////////////////////////////////////////////////////////////
#ifndef ARANGODB_AQL_FUNCTION_H
#define ARANGODB_AQL_FUNCTION_H 1
#include "Basics/Common.h"
namespace triagens {
namespace aql {
struct Function {
// -----------------------------------------------------------------------------
// --SECTION-- constructors / destructors
// -----------------------------------------------------------------------------
Function () = delete;
////////////////////////////////////////////////////////////////////////////////
/// @brief create the function
////////////////////////////////////////////////////////////////////////////////
Function (std::string const&,
std::string const&,
std::string const&,
bool,
bool);
////////////////////////////////////////////////////////////////////////////////
/// @brief destroy the function
////////////////////////////////////////////////////////////////////////////////
~Function ();
// -----------------------------------------------------------------------------
// --SECTION-- public methods
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @brief checks if the function has been deprecated
////////////////////////////////////////////////////////////////////////////////
inline bool isDeprecated () const {
// currently there are no deprecated functions
return false;
}
////////////////////////////////////////////////////////////////////////////////
/// @brief return the number of required arguments
////////////////////////////////////////////////////////////////////////////////
inline std::pair<size_t, size_t> numArguments () const {
return std::make_pair(minRequiredArguments, maxRequiredArguments);
}
////////////////////////////////////////////////////////////////////////////////
/// @brief whether or not a positional argument needs to be converted from a
/// collection parameter to a collection name parameter
////////////////////////////////////////////////////////////////////////////////
bool mustConvertArgument (size_t) const;
////////////////////////////////////////////////////////////////////////////////
/// @brief parse the argument list and set the minimum and maximum number of
/// arguments
////////////////////////////////////////////////////////////////////////////////
void initArguments ();
// -----------------------------------------------------------------------------
// --SECTION-- public variables
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @brief function name
////////////////////////////////////////////////////////////////////////////////
std::string const internalName;
std::string const externalName;
////////////////////////////////////////////////////////////////////////////////
/// @brief function arguments
////////////////////////////////////////////////////////////////////////////////
std::string const arguments;
////////////////////////////////////////////////////////////////////////////////
/// @brief whether or not the function is deterministic (i.e. its results are
/// identical when called repeatedly with the same input values)
////////////////////////////////////////////////////////////////////////////////
bool const isDeterministic;
////////////////////////////////////////////////////////////////////////////////
/// @brief whether or not the function may throw a runtime exception
////////////////////////////////////////////////////////////////////////////////
bool const canThrow;
////////////////////////////////////////////////////////////////////////////////
/// @brief whether or not the function contains a collection parameter that
/// will cause some special conversion during function calls
////////////////////////////////////////////////////////////////////////////////
bool containsCollectionParameter;
////////////////////////////////////////////////////////////////////////////////
/// @brief minimum number of required arguments
////////////////////////////////////////////////////////////////////////////////
size_t minRequiredArguments;
////////////////////////////////////////////////////////////////////////////////
/// @brief maximum number of required arguments
////////////////////////////////////////////////////////////////////////////////
size_t maxRequiredArguments;
////////////////////////////////////////////////////////////////////////////////
/// @brief maximum number of function arguments that can be used
////////////////////////////////////////////////////////////////////////////////
static size_t const MaxArguments = 1024;
};
}
}
#endif
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// Local Variables:
// mode: outline-minor
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @page\\|// --SECTION--\\|/// @\\}"
// End: