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 value_type = T
 
- Public Types inherited from xgboost::Value
enum class  ValueKind : std::int64_t {
  kString = 0 , kNumber = 1 , kInteger = 2 , kObject = 3 ,
  kArray = 4 , kBoolean = 5 , kNull = 6 , kF32Array = 7 ,
  kF64Array = 8 , kI8Array = 9 , kU8Array = 10 , kI16Array = 11 ,
  kU16Array = 12 , kI32Array = 13 , kU32Array = 14 , kI64Array = 15 ,
  kU64Array = 16
}
 Simplified implementation of LLVM RTTI. More...
 

Public Member Functions

 JsonTypedArray ()
 
 JsonTypedArray (std::size_t n)
 
 JsonTypedArray (JsonTypedArray &&that) noexcept
 
bool operator== (Value const &rhs) const override
 
Valueoperator= (Value const &rhs) override=delete
 
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)
 
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

◆ value_type

template<typename T , Value::ValueKind kind>
using xgboost::JsonTypedArray< T, kind >::value_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 ( std::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>
Value& xgboost::JsonTypedArray< T, kind >::operator= ( Value const &  rhs)
overridevirtualdelete

Reimplemented from xgboost::Value.

◆ 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: