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_
static void Save(Json *out)
std::tuple< XGBoostVersionT, XGBoostVersionT, XGBoostVersionT > TripletT
Definition: version.h:17
static TripletT Load(Json const &in, bool check=false)
static bool Same(TripletT const &triplet)
static const TripletT kInvalid
Definition: version.h:18
namespace of xgboost
Definition: base.h:102
Definition: version.h:16
defines configuration macros of xgboost.
Data structure representing JSON format.
Definition: json.h:326
static TripletT Self()
static std::string String(TripletT const &version)