You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
clang format apply
This commit is contained in:
@ -16,9 +16,9 @@
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/******************************************************************************************
|
||||
* $Id: messageobj.h 3495 2013-01-21 14:09:51Z rdempsey $
|
||||
*
|
||||
******************************************************************************************/
|
||||
* $Id: messageobj.h 3495 2013-01-21 14:09:51Z rdempsey $
|
||||
*
|
||||
******************************************************************************************/
|
||||
/**
|
||||
* @file
|
||||
*/
|
||||
@ -39,126 +39,123 @@ class MessageLoggingTest;
|
||||
|
||||
namespace logging
|
||||
{
|
||||
|
||||
/** @brief a message class
|
||||
*
|
||||
* Contains a message to be logged
|
||||
*/
|
||||
class Message
|
||||
{
|
||||
public:
|
||||
/** @brief the args to a formatted message
|
||||
*/
|
||||
class Args
|
||||
public:
|
||||
/** @brief the args to a formatted message
|
||||
*/
|
||||
class Args
|
||||
{
|
||||
public:
|
||||
/** @brief the args vector
|
||||
*/
|
||||
typedef std::vector<boost::any> AnyVec;
|
||||
|
||||
// default ctors & dtors okay
|
||||
|
||||
/** @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 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 args accessor
|
||||
*/
|
||||
const AnyVec& args() const
|
||||
{
|
||||
public:
|
||||
/** @brief the args vector
|
||||
*/
|
||||
typedef std::vector<boost::any> AnyVec;
|
||||
|
||||
// default ctors & dtors okay
|
||||
|
||||
/** @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 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 args accessor
|
||||
*/
|
||||
const AnyVec& args() const
|
||||
{
|
||||
return fArgs;
|
||||
}
|
||||
|
||||
/** @brief reset the args list
|
||||
*
|
||||
*/
|
||||
void reset();
|
||||
|
||||
friend class ::MessageLoggingTest;
|
||||
|
||||
private:
|
||||
AnyVec fArgs; /// the args vector
|
||||
};
|
||||
|
||||
/** @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 format message with args
|
||||
*/
|
||||
void format(const Args& args);
|
||||
|
||||
/** @brief msg accessor
|
||||
*/
|
||||
const std::string& msg() const
|
||||
{
|
||||
return fMsg;
|
||||
return fArgs;
|
||||
}
|
||||
|
||||
/** @brief swap
|
||||
*/
|
||||
void swap(Message& rhs);
|
||||
|
||||
/** @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 reset the formated string
|
||||
*
|
||||
* The original, unformated string is restored, and this Message
|
||||
* is then ready for a new call to format().
|
||||
*/
|
||||
/** @brief reset the args list
|
||||
*
|
||||
*/
|
||||
void reset();
|
||||
|
||||
/** @brief msgID accessor
|
||||
*/
|
||||
const MessageID& msgID() const
|
||||
{
|
||||
return fMsgID;
|
||||
}
|
||||
|
||||
friend class ::MessageLoggingTest;
|
||||
|
||||
private:
|
||||
//defaults okay
|
||||
//Message(const Message& rhs);
|
||||
//Message& operator=(const Message& rhs);
|
||||
private:
|
||||
AnyVec fArgs; /// the args vector
|
||||
};
|
||||
|
||||
MessageID fMsgID; /// the msgID
|
||||
std::string fMsg; /// the formated or unformated message
|
||||
config::Config* fConfig; /// config file ptr
|
||||
/** @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 format message with args
|
||||
*/
|
||||
void format(const Args& args);
|
||||
|
||||
/** @brief msg accessor
|
||||
*/
|
||||
const std::string& msg() const
|
||||
{
|
||||
return fMsg;
|
||||
}
|
||||
|
||||
/** @brief swap
|
||||
*/
|
||||
void swap(Message& rhs);
|
||||
|
||||
/** @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 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 msgID accessor
|
||||
*/
|
||||
const MessageID& msgID() const
|
||||
{
|
||||
return fMsgID;
|
||||
}
|
||||
|
||||
friend class ::MessageLoggingTest;
|
||||
|
||||
private:
|
||||
// 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
|
||||
};
|
||||
|
||||
inline void swap(logging::Message& lhs, logging::Message& rhs)
|
||||
{
|
||||
lhs.swap(rhs);
|
||||
lhs.swap(rhs);
|
||||
}
|
||||
|
||||
}//namespace logging
|
||||
|
||||
|
||||
} // namespace logging
|
||||
|
Reference in New Issue
Block a user