Medial Code Documentation
Loading...
Searching...
No Matches
version.h
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
13namespace xgboost {
14class Json;
15// a static class for handling version info
16struct 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);
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_
interface of stream I/O for serialization
Definition io.h:30
Definition json.h:87
Data structure representing JSON format.
Definition json.h:357
defines serializable interface of dmlc
Copyright 2015-2023 by XGBoost Contributors.
namespace of xgboost
Definition base.h:90
Definition version.h:16