You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-05 15:41:14 +03:00
Reformat all code to coding standard
This commit is contained in:
@ -38,7 +38,8 @@ class Config;
|
||||
|
||||
class MessageLoggingTest;
|
||||
|
||||
namespace logging {
|
||||
namespace logging
|
||||
{
|
||||
|
||||
/** @brief a message class
|
||||
*
|
||||
@ -47,112 +48,121 @@ namespace logging {
|
||||
class Message
|
||||
{
|
||||
public:
|
||||
/** @brief the args to a formatted message
|
||||
*/
|
||||
class Args
|
||||
{
|
||||
public:
|
||||
/** @brief the args vector
|
||||
*/
|
||||
typedef std::vector<boost::any> AnyVec;
|
||||
/** @brief the args to a formatted message
|
||||
*/
|
||||
class Args
|
||||
{
|
||||
public:
|
||||
/** @brief the args vector
|
||||
*/
|
||||
typedef std::vector<boost::any> AnyVec;
|
||||
|
||||
// default ctors & dtors okay
|
||||
// default ctors & dtors okay
|
||||
|
||||
/** @brief add an int arg to the message
|
||||
*/
|
||||
void add(int i);
|
||||
/** @brief add an int arg to the message
|
||||
*/
|
||||
void add(int i);
|
||||
|
||||
/** @brief add an unsigned 64 bit int arg to the message
|
||||
*/
|
||||
void add(uint64_t i);
|
||||
/** @brief add an unsigned 64 bit int arg to the message
|
||||
*/
|
||||
void add(uint64_t i);
|
||||
|
||||
/** @brief add a float arg to the message
|
||||
*/
|
||||
void add(double d);
|
||||
/** @brief add a float arg to the message
|
||||
*/
|
||||
void add(double d);
|
||||
|
||||
/** @brief add a string arg to the message
|
||||
*/
|
||||
void add(const std::string& s);
|
||||
/** @brief add a string arg to the message
|
||||
*/
|
||||
void add(const std::string& s);
|
||||
|
||||
/** @brief args accessor
|
||||
*/
|
||||
const AnyVec& args() const { return fArgs; }
|
||||
/** @brief args accessor
|
||||
*/
|
||||
const AnyVec& args() const
|
||||
{
|
||||
return fArgs;
|
||||
}
|
||||
|
||||
/** @brief reset the args list
|
||||
*
|
||||
*/
|
||||
void reset();
|
||||
/** @brief reset the args list
|
||||
*
|
||||
*/
|
||||
void reset();
|
||||
|
||||
friend class ::MessageLoggingTest;
|
||||
friend class ::MessageLoggingTest;
|
||||
|
||||
private:
|
||||
AnyVec fArgs; /// the args vector
|
||||
};
|
||||
private:
|
||||
AnyVec fArgs; /// the args vector
|
||||
};
|
||||
|
||||
/** @brief the MessageID type
|
||||
*/
|
||||
typedef unsigned MessageID;
|
||||
/** @brief the MessageID type
|
||||
*/
|
||||
typedef unsigned MessageID;
|
||||
|
||||
/** @brief default ctor
|
||||
*/
|
||||
explicit Message(const MessageID msgid=0);
|
||||
|
||||
/** @brief ctor turn a message string to a Message
|
||||
*
|
||||
* For error handling framework use to log error
|
||||
*/
|
||||
Message(const std::string msg);
|
||||
/** @brief default ctor
|
||||
*/
|
||||
explicit Message(const MessageID msgid = 0);
|
||||
|
||||
/** @brief format message with args
|
||||
*/
|
||||
void format(const Args& args);
|
||||
/** @brief ctor turn a message string to a Message
|
||||
*
|
||||
* For error handling framework use to log error
|
||||
*/
|
||||
Message(const std::string msg);
|
||||
|
||||
/** @brief msg accessor
|
||||
*/
|
||||
const std::string& msg() const { return fMsg; }
|
||||
/** @brief format message with args
|
||||
*/
|
||||
void format(const Args& args);
|
||||
|
||||
/** @brief swap
|
||||
*/
|
||||
void swap(Message& rhs);
|
||||
/** @brief msg accessor
|
||||
*/
|
||||
const std::string& msg() const
|
||||
{
|
||||
return fMsg;
|
||||
}
|
||||
|
||||
/** @brief lookup the message format string
|
||||
*
|
||||
* looks up the message format string for msgid. Returns a reasonable
|
||||
* default if one can't be found.
|
||||
*/
|
||||
static const std::string lookupMessage(const MessageID& msgid);
|
||||
/** @brief swap
|
||||
*/
|
||||
void swap(Message& rhs);
|
||||
|
||||
/** @brief reset the formated string
|
||||
*
|
||||
* The original, unformated string is restored, and this Message
|
||||
* is then ready for a new call to format().
|
||||
*/
|
||||
void reset();
|
||||
/** @brief lookup the message format string
|
||||
*
|
||||
* looks up the message format string for msgid. Returns a reasonable
|
||||
* default if one can't be found.
|
||||
*/
|
||||
static const std::string lookupMessage(const MessageID& msgid);
|
||||
|
||||
/** @brief msgID accessor
|
||||
*/
|
||||
const MessageID& msgID() const { return fMsgID; }
|
||||
/** @brief reset the formated string
|
||||
*
|
||||
* The original, unformated string is restored, and this Message
|
||||
* is then ready for a new call to format().
|
||||
*/
|
||||
void reset();
|
||||
|
||||
friend class ::MessageLoggingTest;
|
||||
/** @brief msgID accessor
|
||||
*/
|
||||
const MessageID& msgID() const
|
||||
{
|
||||
return fMsgID;
|
||||
}
|
||||
|
||||
friend class ::MessageLoggingTest;
|
||||
|
||||
private:
|
||||
//defaults okay
|
||||
//Message(const Message& rhs);
|
||||
//Message& operator=(const Message& rhs);
|
||||
//defaults okay
|
||||
//Message(const Message& rhs);
|
||||
//Message& operator=(const Message& rhs);
|
||||
|
||||
MessageID fMsgID; /// the msgID
|
||||
std::string fMsg; /// the formated or unformated message
|
||||
config::Config* fConfig; /// config file ptr
|
||||
MessageID fMsgID; /// the msgID
|
||||
std::string fMsg; /// the formated or unformated message
|
||||
config::Config* fConfig; /// config file ptr
|
||||
};
|
||||
|
||||
}//namespace logging
|
||||
|
||||
namespace std
|
||||
{
|
||||
template<> inline void swap<logging::Message>(logging::Message& lhs, logging::Message&rhs)
|
||||
{
|
||||
lhs.swap(rhs);
|
||||
}
|
||||
template<> inline void swap<logging::Message>(logging::Message& lhs, logging::Message& rhs)
|
||||
{
|
||||
lhs.swap(rhs);
|
||||
}
|
||||
}//namespace std
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user