xgboost
Public Types | Public Member Functions | Static Public Member Functions | List of all members
xgboost::JsonTypedArray< T, kind > Class Template Reference

Typed array for Universal Binary JSON. More...

#include <json.h>

Inheritance diagram for xgboost::JsonTypedArray< T, kind >:
Inheritance graph
Collaboration diagram for xgboost::JsonTypedArray< T, kind >:
Collaboration graph

Public Types

using Type = T
 
- Public Types inherited from xgboost::Value
enum class  ValueKind {
  kString , kNumber , kInteger , kObject ,
  kArray , kBoolean , kNull , kNumberArray ,
  kU8Array , kI32Array , kI64Array
}
 Simplified implementation of LLVM RTTI. More...
 

Public Member Functions

 JsonTypedArray ()
 
 JsonTypedArray (size_t n)
 
 JsonTypedArray (JsonTypedArray &&that) noexcept
 
bool operator== (Value const &rhs) const override
 
void Set (size_t i, T v)
 
size_t Size () const
 
void Save (JsonWriter *writer) const override
 
std::vector< T > const & GetArray () &&
 
std::vector< T > const & GetArray () const &
 
std::vector< T > & GetArray () &
 
- Public Member Functions inherited from xgboost::Value
 Value (ValueKind _kind)
 
ValueKind Type () const
 
virtual ~Value ()=default
 
virtual Jsonoperator[] (std::string const &key)
 
virtual Jsonoperator[] (int ind)
 
virtual Valueoperator= (Value const &rhs)=delete
 
std::string TypeStr () const
 

Static Public Member Functions

static bool IsClassOf (Value const *value)
 

Detailed Description

template<typename T, Value::ValueKind kind>
class xgboost::JsonTypedArray< T, kind >

Typed array for Universal Binary JSON.

Template Parameters
TThe underlying primitive type.
kindValue kind defined by JSON type.

Member Typedef Documentation

◆ Type

template<typename T , Value::ValueKind kind>
using xgboost::JsonTypedArray< T, kind >::Type = T

Constructor & Destructor Documentation

◆ JsonTypedArray() [1/3]

template<typename T , Value::ValueKind kind>
xgboost::JsonTypedArray< T, kind >::JsonTypedArray ( )
inline

◆ JsonTypedArray() [2/3]

template<typename T , Value::ValueKind kind>
xgboost::JsonTypedArray< T, kind >::JsonTypedArray ( size_t  n)
inlineexplicit

◆ JsonTypedArray() [3/3]

template<typename T , Value::ValueKind kind>
xgboost::JsonTypedArray< T, kind >::JsonTypedArray ( JsonTypedArray< T, kind > &&  that)
inlinenoexcept

Member Function Documentation

◆ GetArray() [1/3]

template<typename T , Value::ValueKind kind>
std::vector<T>& xgboost::JsonTypedArray< T, kind >::GetArray ( ) &
inline

◆ GetArray() [2/3]

template<typename T , Value::ValueKind kind>
std::vector<T> const& xgboost::JsonTypedArray< T, kind >::GetArray ( ) &&
inline

◆ GetArray() [3/3]

template<typename T , Value::ValueKind kind>
std::vector<T> const& xgboost::JsonTypedArray< T, kind >::GetArray ( ) const &
inline

◆ IsClassOf()

template<typename T , Value::ValueKind kind>
static bool xgboost::JsonTypedArray< T, kind >::IsClassOf ( Value const *  value)
inlinestatic

◆ operator==()

template<typename T , Value::ValueKind kind>
bool xgboost::JsonTypedArray< T, kind >::operator== ( Value const &  rhs) const
overridevirtual

Implements xgboost::Value.

◆ Save()

template<typename T , Value::ValueKind kind>
void xgboost::JsonTypedArray< T, kind >::Save ( JsonWriter writer) const
overridevirtual

Implements xgboost::Value.

◆ Set()

template<typename T , Value::ValueKind kind>
void xgboost::JsonTypedArray< T, kind >::Set ( size_t  i,
v 
)
inline

◆ Size()

template<typename T , Value::ValueKind kind>
size_t xgboost::JsonTypedArray< T, kind >::Size ( ) const
inline

The documentation for this class was generated from the following file: