1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +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

View File

@ -20,7 +20,7 @@
*
*****************************************************************************/
/** @file
/** @file
* class DBRM
*/
@ -38,7 +38,8 @@
#define EXPORT
#endif
namespace BRM {
namespace BRM
{
/** @brief Trace beginning and end of a call.
*
@ -46,98 +47,99 @@ namespace BRM {
* It keeps track of integral, string and boolean inputs, and integral and boolean outputs.
* If it should print a message immediately from the constructor, call it with the final parameter,
* writeNow, true (default). If input and output parameters need to be added, call it with
* writeNow false. Then writeBegin() must be called explicitely.
* writeNow false. Then writeBegin() must be called explicitely.
*
* Input parameters are added with addInput, output with addOutput.
*
* On end, if debug is set, an end message is printed with the output parameters.
*
* On end, if debug is set, an end message is printed with the output parameters.
*/
class Tracer {
public:
/** @brief Tracer Constructor
*
* @param file (in string) the file name.
* @param line (in int ) the line number.
* @param msg (in string) the message that will be printed at the begin and end.
* @param debug (in bool) if information should be printed
* @param writeNow (in bool) whether to print the begin message from the constructor
* (printed if debug is true.)
*/
EXPORT Tracer(const std::string& file, int line, const std::string& msg, bool debug, bool writeNow = true);
class Tracer
{
public:
/** @brief Tracer Constructor
*
* @param file (in string) the file name.
* @param line (in int ) the line number.
* @param msg (in string) the message that will be printed at the begin and end.
* @param debug (in bool) if information should be printed
* @param writeNow (in bool) whether to print the begin message from the constructor
* (printed if debug is true.)
*/
EXPORT Tracer(const std::string& file, int line, const std::string& msg, bool debug, bool writeNow = true);
/** @brief Tracer destructor
*
* Prints the output message if debug is true.
*/
EXPORT ~Tracer();
/** @brief Tracer destructor
*
* Prints the output message if debug is true.
*/
EXPORT ~Tracer();
/** @brief writeBegin
*
* Prints the begin message in form:
* file@line number begin - followed by the input parameters:
* name: (value)
*/
EXPORT void writeBegin();
/** @brief writeBegin
*
* Prints the begin message in form:
* file@line number begin - followed by the input parameters:
* name: (value)
*/
EXPORT void writeBegin();
/** @brief writeEnd
*
* Prints the end message in form:
* file@line number begin - followed by the output parameters:
* name: (value)
*/
EXPORT void writeEnd();
/** @brief writeEnd
*
* Prints the end message in form:
* file@line number begin - followed by the output parameters:
* name: (value)
*/
EXPORT void writeEnd();
/** @brief writeDirect
*
* Prints specified string immediately (directly) to the brm log.
* Different than the addInput and addOutput functions that
* accumulate the data for later printing to the brm log.
* @param msg String to be printed to the brm log
*/
void writeDirect(const std::string& msg);
/** @brief writeDirect
*
* Prints specified string immediately (directly) to the brm log.
* Different than the addInput and addOutput functions that
* accumulate the data for later printing to the brm log.
* @param msg String to be printed to the brm log
*/
void writeDirect(const std::string& msg);
/** @brief addInput
*
* @param name (in string) the variable name.
* @param value (in int* or string* or bool* ) the variable
*/
EXPORT void addInput(const std::string& name, const int* value);
EXPORT void addInput(const std::string& name, const std::string* value);
EXPORT void addInput(const std::string& name, const bool* value);
EXPORT void addInput(const std::string& name, const short* value);
EXPORT void addInput(const std::string& name, const int64_t* value);
/** @brief addInput
*
* @param name (in string) the variable name.
* @param value (in int* or string* or bool* ) the variable
*/
EXPORT void addInput(const std::string& name, const int* value);
EXPORT void addInput(const std::string& name, const std::string* value);
EXPORT void addInput(const std::string& name, const bool* value);
EXPORT void addInput(const std::string& name, const short* value);
EXPORT void addInput(const std::string& name, const int64_t* value);
/** @brief addOutput
*
* @param name (in string) the variable name.
* @param value (in int* or bool* ) the variable
*/
EXPORT void addOutput(const std::string& name, const int* value);
EXPORT void addOutput(const std::string& name, const bool* value);
EXPORT void addOutput(const std::string& name, const short* value);
EXPORT void addOutput(const std::string& name, const int64_t* value);
/** @brief addOutput
*
* @param name (in string) the variable name.
* @param value (in int* or bool* ) the variable
*/
EXPORT void addOutput(const std::string& name, const int* value);
EXPORT void addOutput(const std::string& name, const bool* value);
EXPORT void addOutput(const std::string& name, const short* value);
EXPORT void addOutput(const std::string& name, const int64_t* value);
private:
std::string timeStamp();
typedef std::vector<std::pair <std::string, const int*> > ValuesVec;
typedef std::vector<std::pair <std::string, const std::string*> > ValuesStrVec;
typedef std::vector<std::pair <std::string, const bool*> > ValuesBoolVec;
typedef std::vector<std::pair <std::string, const short*> > ValuesShortVec;
typedef std::vector<std::pair <std::string, const int64_t*> > ValuesInt64Vec;
std::string fFileName;
int fLine;
std::string fMsg;
bool fDebug;
ValuesVec fInputs;
ValuesStrVec fStrInputs;
ValuesBoolVec fBoolInputs;
ValuesShortVec fShortInputs;
ValuesInt64Vec fInt64Inputs;
ValuesVec fOutputs;
ValuesBoolVec fBoolOutputs;
ValuesShortVec fShortOutputs;
ValuesInt64Vec fInt64Outputs;
pid_t fpid;
private:
std::string timeStamp();
typedef std::vector<std::pair <std::string, const int*> > ValuesVec;
typedef std::vector<std::pair <std::string, const std::string*> > ValuesStrVec;
typedef std::vector<std::pair <std::string, const bool*> > ValuesBoolVec;
typedef std::vector<std::pair <std::string, const short*> > ValuesShortVec;
typedef std::vector<std::pair <std::string, const int64_t*> > ValuesInt64Vec;
std::string fFileName;
int fLine;
std::string fMsg;
bool fDebug;
ValuesVec fInputs;
ValuesStrVec fStrInputs;
ValuesBoolVec fBoolInputs;
ValuesShortVec fShortInputs;
ValuesInt64Vec fInt64Inputs;
ValuesVec fOutputs;
ValuesBoolVec fBoolOutputs;
ValuesShortVec fShortOutputs;
ValuesInt64Vec fInt64Outputs;
pid_t fpid;
};
/** @brief tracer macros
@ -147,46 +149,46 @@ class Tracer {
#define TRACER_WRITENOW(a)\
Tracer tracer(__FILE__, __LINE__, a, fDebug);
Tracer tracer(__FILE__, __LINE__, a, fDebug);
#define TRACER_WRITELATER(a)\
Tracer tracer(__FILE__, __LINE__, a, fDebug, false);
Tracer tracer(__FILE__, __LINE__, a, fDebug, false);
#define TRACER_ADDINPUT(a)\
tracer.addInput((std::string)#a, (int*)&a);
tracer.addInput((std::string)#a, (int*)&a);
#define TRACER_ADDSTRINPUT(a)\
tracer.addInput((std::string)#a, &a);
tracer.addInput((std::string)#a, &a);
#define TRACER_ADDBOOLINPUT(a)\
tracer.addInput((std::string)#a, &a);
tracer.addInput((std::string)#a, &a);
#define TRACER_ADDSHORTINPUT(a)\
tracer.addInput((std::string)#a, (short*)&a);
tracer.addInput((std::string)#a, (short*)&a);
#define TRACER_ADDINT64INPUT(a)\
tracer.addInput((std::string)#a, (int64_t*)&a);
tracer.addInput((std::string)#a, (int64_t*)&a);
#define TRACER_ADDOUTPUT(a)\
tracer.addOutput((std::string)#a, (int*)&a);
tracer.addOutput((std::string)#a, (int*)&a);
#define TRACER_ADDBOOLOUTPUT(a)\
tracer.addOutput((std::string)#a, &a);
tracer.addOutput((std::string)#a, &a);
#define TRACER_ADDSHORTOUTPUT(a)\
tracer.addOutput((std::string)#a, (short*)&a);
tracer.addOutput((std::string)#a, (short*)&a);
#define TRACER_ADDINT64OUTPUT(a)\
tracer.addOutput((std::string)#a, (int64_t*)&a);
tracer.addOutput((std::string)#a, (int64_t*)&a);
#define TRACER_WRITE\
tracer.writeBegin();
tracer.writeBegin();
#define TRACER_WRITEDIRECT(msg)\
tracer.writeDirect(msg);
tracer.writeDirect(msg);
}
#undef EXPORT
#endif
#endif