libfoedus-core
FOEDUS Core Library
log_type.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2015, Hewlett-Packard Development Company, LP.
3  * This program is free software; you can redistribute it and/or modify it
4  * under the terms of the GNU General Public License as published by the Free
5  * Software Foundation; either version 2 of the License, or (at your option)
6  * any later version.
7  *
8  * This program is distributed in the hope that it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11  * more details. You should have received a copy of the GNU General Public
12  * License along with this program; if not, write to the Free Software
13  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
14  *
15  * HP designates this particular file as subject to the "Classpath" exception
16  * as provided by HP in the LICENSE.txt file that accompanied this code.
17  */
18 #include "foedus/log/log_type.hpp"
19 
20 #include <iostream>
21 
22 namespace foedus {
23 namespace log {
24 // A bit tricky to get "a" from a in C macro.
25 #define X_QUOTE(str) #str
26 #define X_EXPAND_AND_QUOTE(str) X_QUOTE(str)
27 #define X(a, b, c) case a: return X_EXPAND_AND_QUOTE(a);
28 const char* get_log_type_name(LogCode code) {
29  switch (code) {
30  case kLogCodeInvalid: return "kLogCodeInvalid";
31 #include "foedus/log/log_type.xmacro" // NOLINT
32  default: return "UNKNOWN";
33  }
34 }
35 #undef X
36 #undef X_EXPAND_AND_QUOTE
37 #undef X_QUOTE
38 
39 } // namespace log
40 } // namespace foedus
LogCode
A unique identifier of all log types.
Definition: log_type.hpp:87
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
Definition: assert_nd.hpp:44
const char * get_log_type_name(LogCode code)
Returns the names of LogCode enum defined in log_type.xmacro.
Definition: log_type.cpp:28
0 is reserved as a non-existing log type.
Definition: log_type.hpp:89