All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Private Attributes | List of all members
nlohmann::detail::json_ref< BasicJsonType > Class Template Reference

#include <json.hpp>

Public Types

using value_type = BasicJsonType
 

Public Member Functions

 json_ref (value_type &&value)
 
 json_ref (const value_type &value)
 
 json_ref (std::initializer_list< json_ref > init)
 
template<class... Args, enable_if_t< std::is_constructible< value_type, Args...>::value, int > = 0>
 json_ref (Args &&...args)
 
 json_ref (json_ref &&)=default
 
 json_ref (const json_ref &)=delete
 
json_refoperator= (const json_ref &)=delete
 
json_refoperator= (json_ref &&)=delete
 
 ~json_ref ()=default
 
value_type moved_or_copied () const
 
value_type const & operator* () const
 
value_type const * operator-> () const
 

Private Attributes

value_type owned_value = nullptr
 
value_typevalue_ref = nullptr
 
const bool is_rvalue
 

Detailed Description

template<typename BasicJsonType>
class nlohmann::detail::json_ref< BasicJsonType >

Definition at line 11101 of file json.hpp.

Member Typedef Documentation

template<typename BasicJsonType>
using nlohmann::detail::json_ref< BasicJsonType >::value_type = BasicJsonType

Definition at line 11104 of file json.hpp.

Constructor & Destructor Documentation

template<typename BasicJsonType>
nlohmann::detail::json_ref< BasicJsonType >::json_ref ( value_type &&  value)
inline

Definition at line 11106 of file json.hpp.

11107  : owned_value(std::move(value)), value_ref(&owned_value), is_rvalue(true)
11108  {}
value_type * value_ref
Definition: json.hpp:11153
temporary value
template<typename BasicJsonType>
nlohmann::detail::json_ref< BasicJsonType >::json_ref ( const value_type value)
inline

Definition at line 11110 of file json.hpp.

11111  : value_ref(const_cast<value_type*>(&value)), is_rvalue(false)
11112  {}
value_type * value_ref
Definition: json.hpp:11153
temporary value
template<typename BasicJsonType>
nlohmann::detail::json_ref< BasicJsonType >::json_ref ( std::initializer_list< json_ref< BasicJsonType > >  init)
inline

Definition at line 11114 of file json.hpp.

11115  : owned_value(init), value_ref(&owned_value), is_rvalue(true)
11116  {}
value_type * value_ref
Definition: json.hpp:11153
template<typename BasicJsonType>
template<class... Args, enable_if_t< std::is_constructible< value_type, Args...>::value, int > = 0>
nlohmann::detail::json_ref< BasicJsonType >::json_ref ( Args &&...  args)
inline

Definition at line 11121 of file json.hpp.

11122  : owned_value(std::forward<Args>(args)...), value_ref(&owned_value),
11123  is_rvalue(true) {}
value_type * value_ref
Definition: json.hpp:11153
template<typename BasicJsonType>
nlohmann::detail::json_ref< BasicJsonType >::json_ref ( json_ref< BasicJsonType > &&  )
default
template<typename BasicJsonType>
nlohmann::detail::json_ref< BasicJsonType >::json_ref ( const json_ref< BasicJsonType > &  )
delete
template<typename BasicJsonType>
nlohmann::detail::json_ref< BasicJsonType >::~json_ref ( )
default

Member Function Documentation

template<typename BasicJsonType>
value_type nlohmann::detail::json_ref< BasicJsonType >::moved_or_copied ( ) const
inline

Definition at line 11132 of file json.hpp.

11133  {
11134  if (is_rvalue)
11135  {
11136  return std::move(*value_ref);
11137  }
11138  return *value_ref;
11139  }
value_type * value_ref
Definition: json.hpp:11153
template<typename BasicJsonType>
value_type const& nlohmann::detail::json_ref< BasicJsonType >::operator* ( ) const
inline

Definition at line 11141 of file json.hpp.

11142  {
11143  return *static_cast<value_type const*>(value_ref);
11144  }
value_type * value_ref
Definition: json.hpp:11153
BasicJsonType value_type
Definition: json.hpp:11104
template<typename BasicJsonType>
value_type const* nlohmann::detail::json_ref< BasicJsonType >::operator-> ( ) const
inline

Definition at line 11146 of file json.hpp.

11147  {
11148  return static_cast<value_type const*>(value_ref);
11149  }
value_type * value_ref
Definition: json.hpp:11153
BasicJsonType value_type
Definition: json.hpp:11104
template<typename BasicJsonType>
json_ref& nlohmann::detail::json_ref< BasicJsonType >::operator= ( const json_ref< BasicJsonType > &  )
delete
template<typename BasicJsonType>
json_ref& nlohmann::detail::json_ref< BasicJsonType >::operator= ( json_ref< BasicJsonType > &&  )
delete

Member Data Documentation

template<typename BasicJsonType>
const bool nlohmann::detail::json_ref< BasicJsonType >::is_rvalue
private

Definition at line 11154 of file json.hpp.

template<typename BasicJsonType>
value_type nlohmann::detail::json_ref< BasicJsonType >::owned_value = nullptr
mutableprivate

Definition at line 11152 of file json.hpp.

template<typename BasicJsonType>
value_type* nlohmann::detail::json_ref< BasicJsonType >::value_ref = nullptr
private

Definition at line 11153 of file json.hpp.


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