xgboost/src/common/version.h
Philip Hyunsu Cho 1d22a9be1c
Revert "Reorder includes. (#5749)" (#5771)
This reverts commit d3a0efbf162f3dceaaf684109e1178c150b32de3.
2020-06-09 10:29:28 -07:00

36 lines
876 B
C++

/*!
* Copyright 2019 XGBoost contributors
*/
#ifndef XGBOOST_COMMON_VERSION_H_
#define XGBOOST_COMMON_VERSION_H_
#include <dmlc/io.h>
#include <string>
#include <tuple>
#include "xgboost/base.h"
namespace xgboost {
class Json;
// a static class for handling version info
struct Version {
using TripletT = std::tuple<XGBoostVersionT, XGBoostVersionT, XGBoostVersionT>;
static const TripletT kInvalid;
// Save/Load version info to Json document
static TripletT Load(Json const& in, bool check = false);
static void Save(Json* out);
// Save/Load version info to dmlc::Stream
static Version::TripletT Load(dmlc::Stream* fi);
static void Save(dmlc::Stream* fo);
static std::string String(TripletT const& version);
static TripletT Self();
static bool Same(TripletT const& triplet);
};
} // namespace xgboost
#endif // XGBOOST_COMMON_VERSION_H_