xgboost

version.h
Go to the documentation of this file.
1
4 #ifndef XGBOOST_COMMON_VERSION_H_
5 #define XGBOOST_COMMON_VERSION_H_
6
7 #include <dmlc/io.h>
8 #include <string>
9 #include <tuple>
10
11 #include "xgboost/base.h"
12
13 namespace xgboost {
14 class Json;
15 // a static class for handling version info
16 struct Version {
17 using TripletT = std::tuple<XGBoostVersionT, XGBoostVersionT, XGBoostVersionT>;
18 static const TripletT kInvalid;
19
20 // Save/Load version info to Json document
21 static TripletT Load(Json const& in, bool check = false);
22 static void Save(Json* out);
23
24 // Save/Load version info to dmlc::Stream
25 static Version::TripletT Load(dmlc::Stream* fi);
26 static void Save(dmlc::Stream* fo);
27
28 static std::string String(TripletT const& version);
29 static TripletT Self();
30
31 static bool Same(TripletT const& triplet);
32 };
33
34 } // namespace xgboost
35 #endif // XGBOOST_COMMON_VERSION_H_
xgboost::Version::Save
static void Save(Json *out)
xgboost::Version::TripletT
std::tuple< XGBoostVersionT, XGBoostVersionT, XGBoostVersionT > TripletT
Definition: version.h:17
xgboost::Version::Load
static TripletT Load(Json const &in, bool check=false)
xgboost::Version::Same
static bool Same(TripletT const &triplet)
xgboost::Version::kInvalid
static const TripletT kInvalid
Definition: version.h:18
xgboost
namespace of xgboost
Definition: base.h:102
xgboost::Version
Definition: version.h:16
base.h
defines configuration macros of xgboost.
xgboost::Json
Data structure representing JSON format.
Definition: json.h:326
xgboost::Version::Self
static TripletT Self()
xgboost::Version::String
static std::string String(TripletT const &version)