1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

Reformat all code to coding standard

This commit is contained in:
Andrew Hutchings
2017-10-26 17:18:17 +01:00
parent 4985f3456e
commit 01446d1e22
1296 changed files with 403852 additions and 353747 deletions

209
dbcon/execplan/objectreader.h Executable file → Normal file
View File

@ -20,7 +20,7 @@
*
*****************************************************************************/
/** @file
/** @file
* class ObjectReader interface
*/
@ -31,134 +31,139 @@
#include <string>
#include <stdint.h>
namespace messageqcpp {
namespace messageqcpp
{
class ByteStream;
}
namespace execplan {
namespace execplan
{
class TreeNode;
class ParseTree;
class CalpontExecutionPlan;
class TreeNode;
class ParseTree;
class CalpontExecutionPlan;
/** @brief A class for creating execplan classes from ByteStreams.
*
* A class currently used for recreating execplan polymorphic classes
* and dynamic objects from ByteStreams.
*/
class ObjectReader {
class ObjectReader
{
public:
class UnserializeException : public std::exception {
public:
UnserializeException(std::string) throw();
virtual ~UnserializeException() throw();
virtual const char* what() const throw();
private:
std::string fWhat;
};
class UnserializeException : public std::exception
{
public:
UnserializeException(std::string) throw();
virtual ~UnserializeException() throw();
virtual const char* what() const throw();
private:
std::string fWhat;
};
/** @brief Enumerates classes supporting serialization
*
* This defines one constant for each class that supports
* serialization.
*/
enum CLASSID {
ZERO, // an appropriate initializer
NULL_CLASS, // to denote that some member is NULL
/** @brief Enumerates classes supporting serialization
*
* This defines one constant for each class that supports
* serialization.
*/
enum CLASSID
{
ZERO, // an appropriate initializer
NULL_CLASS, // to denote that some member is NULL
/**** TreeNodes */
TREENODE,
TREENODEIMPL,
RETURNEDCOLUMN,
AGGREGATECOLUMN,
GROUPCONCATCOLUMN,
ARITHMETICCOLUMN,
CONSTANTCOLUMN,
FUNCTIONCOLUMN,
ROWCOLUMN,
WINDOWFUNCTIONCOLUMN,
PSEUDOCOLUMN,
/**** TreeNodes */
TREENODE,
TREENODEIMPL,
RETURNEDCOLUMN,
AGGREGATECOLUMN,
GROUPCONCATCOLUMN,
ARITHMETICCOLUMN,
CONSTANTCOLUMN,
FUNCTIONCOLUMN,
ROWCOLUMN,
WINDOWFUNCTIONCOLUMN,
PSEUDOCOLUMN,
SIMPLECOLUMN,
SIMPLECOLUMN_INT1,
SIMPLECOLUMN_INT2,
SIMPLECOLUMN_INT4,
SIMPLECOLUMN_INT8,
SIMPLECOLUMN_UINT1,
SIMPLECOLUMN_UINT2,
SIMPLECOLUMN_UINT4,
SIMPLECOLUMN_UINT8,
SIMPLECOLUMN_DECIMAL1,
SIMPLECOLUMN_DECIMAL2,
SIMPLECOLUMN_DECIMAL4,
SIMPLECOLUMN_DECIMAL8,
SIMPLECOLUMN,
SIMPLECOLUMN_INT1,
SIMPLECOLUMN_INT2,
SIMPLECOLUMN_INT4,
SIMPLECOLUMN_INT8,
SIMPLECOLUMN_UINT1,
SIMPLECOLUMN_UINT2,
SIMPLECOLUMN_UINT4,
SIMPLECOLUMN_UINT8,
SIMPLECOLUMN_DECIMAL1,
SIMPLECOLUMN_DECIMAL2,
SIMPLECOLUMN_DECIMAL4,
SIMPLECOLUMN_DECIMAL8,
FILTER,
CONDITIONFILTER,
EXISTSFILTER,
SELECTFILTER,
SIMPLEFILTER,
SIMPLESCALARFILTER,
FILTER,
CONDITIONFILTER,
EXISTSFILTER,
SELECTFILTER,
SIMPLEFILTER,
SIMPLESCALARFILTER,
OPERATOR,
ARITHMETICOPERATOR,
PREDICATEOPERATOR,
LOGICOPERATOR,
OPERATOR,
ARITHMETICOPERATOR,
PREDICATEOPERATOR,
LOGICOPERATOR,
/**** /TreeNodes */
/**** /TreeNodes */
PARSETREE,
CALPONTSELECTEXECUTIONPLAN,
CONSTANTFILTER,
OUTERJOINONFILTER,
PARSETREE,
CALPONTSELECTEXECUTIONPLAN,
CONSTANTFILTER,
OUTERJOINONFILTER,
/** UDAF SDK */
MCSV1_CONTEXT,
UDAFCOLUMN,
};
/** UDAF SDK */
MCSV1_CONTEXT,
UDAFCOLUMN,
};
typedef uint8_t id_t; //expand as necessary
typedef uint8_t id_t; //expand as necessary
/** @brief Creates a new TreeNode object from the ByteStream
*
* @param b The ByteStream to create it from
* @return A newly allocated TreeNode
*/
static TreeNode* createTreeNode(messageqcpp::ByteStream& b);
/** @brief Creates a new TreeNode object from the ByteStream
*
* @param b The ByteStream to create it from
* @return A newly allocated TreeNode
*/
static TreeNode* createTreeNode(messageqcpp::ByteStream& b);
/** @brief Creates a new ParseTree from the ByteStream
*
* @param b The ByteStream to create it from
* @return A newly allocated ParseTree
*/
static ParseTree* createParseTree(messageqcpp::ByteStream& b);
/** @brief Creates a new ParseTree from the ByteStream
*
* @param b The ByteStream to create it from
* @return A newly allocated ParseTree
*/
static ParseTree* createParseTree(messageqcpp::ByteStream& b);
/** @brief Creates a new CalpontExecutionPlan from the ByteStream
*
* @param b The ByteStream to create it from
* @return A newly allocated CalpontExecutionPlan
*/
static CalpontExecutionPlan* createExecutionPlan(messageqcpp::ByteStream& b);
/** @brief Creates a new CalpontExecutionPlan from the ByteStream
*
* @param b The ByteStream to create it from
* @return A newly allocated CalpontExecutionPlan
*/
static CalpontExecutionPlan* createExecutionPlan(messageqcpp::ByteStream& b);
/** @brief Serialize() for ParseTrees
*
* This function effectively serializes a ParseTree.
* @param tree The ParseTree to write out
* @param b The ByteStream to write tree to
*/
static void writeParseTree(const ParseTree* tree,
messageqcpp::ByteStream& b);
/** @brief Serialize() for ParseTrees
*
* This function effectively serializes a ParseTree.
* @param tree The ParseTree to write out
* @param b The ByteStream to write tree to
*/
static void writeParseTree(const ParseTree* tree,
messageqcpp::ByteStream& b);
/** @brief Verify the type of the next object in the ByteStream
*
* @param b The ByteStream to read from
* @param type The type it should be
* @throw UnserializeException if the type does not match; this is a fatal error.
*/
static void checkType(messageqcpp::ByteStream &b, const CLASSID type);
/** @brief Verify the type of the next object in the ByteStream
*
* @param b The ByteStream to read from
* @param type The type it should be
* @throw UnserializeException if the type does not match; this is a fatal error.
*/
static void checkType(messageqcpp::ByteStream& b, const CLASSID type);
};
}