rippled
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Friends | List of all members
ripple::STObject::OptionalProxy< T > Class Template Reference

#include <STObject.h>

Inheritance diagram for ripple::STObject::OptionalProxy< T >:
Inheritance graph
[legend]
Collaboration diagram for ripple::STObject::OptionalProxy< T >:
Collaboration graph
[legend]

Public Member Functions

 OptionalProxy (OptionalProxy const &)=default
 
OptionalProxyoperator= (OptionalProxy const &)=delete
 
 operator bool () const noexcept
 Returns true if the field is set.
 
 operator optional_type () const
 
optional_type operator~ () const
 Explicit conversion to std::optional.
 
value_type value_or (value_type val) const
 
OptionalProxyoperator= (std::nullopt_t const &)
 
OptionalProxyoperator= (optional_type &&v)
 
OptionalProxyoperator= (optional_type const &v)
 
template<class U >
std::enable_if_t< std::is_assignable_v< T, U >, OptionalProxy & > operator= (U &&u)
 
template<class U >
std::enable_if_t< std::is_assignable_v< T, U >, STObject::OptionalProxy< T > & > operator= (U &&u)
 
value_type value () const
 
value_type operator* () const
 
T const * operator-> () const
 

Protected Member Functions

T const * find () const
 
template<class U >
void assign (U &&u)
 

Protected Attributes

STObjectst_
 
SOEStyle style_
 
TypedField< T > const * f_
 

Private Types

using value_type = typename T::value_type
 
using optional_type = std::optional< typename std::decay< value_type >::type >
 

Private Member Functions

 OptionalProxy (STObject *st, TypedField< T > const *f)
 
bool engaged () const noexcept
 
void disengage ()
 
optional_type optional_value () const
 

Friends

class STObject
 
bool operator== (OptionalProxy const &lhs, std::nullopt_t) noexcept
 
bool operator== (std::nullopt_t, OptionalProxy const &rhs) noexcept
 
bool operator== (OptionalProxy const &lhs, optional_type const &rhs) noexcept
 
bool operator== (optional_type const &lhs, OptionalProxy const &rhs) noexcept
 
bool operator== (OptionalProxy const &lhs, OptionalProxy const &rhs) noexcept
 
bool operator!= (OptionalProxy const &lhs, std::nullopt_t) noexcept
 
bool operator!= (std::nullopt_t, OptionalProxy const &rhs) noexcept
 
bool operator!= (OptionalProxy const &lhs, optional_type const &rhs) noexcept
 
bool operator!= (optional_type const &lhs, OptionalProxy const &rhs) noexcept
 
bool operator!= (OptionalProxy const &lhs, OptionalProxy const &rhs) noexcept
 

Detailed Description

template<class T>
class ripple::STObject::OptionalProxy< T >

Definition at line 570 of file STObject.h.

Member Typedef Documentation

◆ value_type

template<class T >
using ripple::STObject::OptionalProxy< T >::value_type = typename T::value_type
private

Definition at line 573 of file STObject.h.

◆ optional_type

template<class T >
using ripple::STObject::OptionalProxy< T >::optional_type = std::optional<typename std::decay<value_type>::type>
private

Definition at line 575 of file STObject.h.

Constructor & Destructor Documentation

◆ OptionalProxy() [1/2]

template<class T >
ripple::STObject::OptionalProxy< T >::OptionalProxy ( OptionalProxy< T > const &  )
default

◆ OptionalProxy() [2/2]

template<class T >
ripple::STObject::OptionalProxy< T >::OptionalProxy ( STObject st,
TypedField< T > const *  f 
)
private

Definition at line 876 of file STObject.h.

Member Function Documentation

◆ operator=() [1/6]

template<class T >
OptionalProxy & ripple::STObject::OptionalProxy< T >::operator= ( OptionalProxy< T > const &  )
delete

◆ operator bool()

template<class T >
ripple::STObject::OptionalProxy< T >::operator bool ( ) const
explicitnoexcept

Returns true if the field is set.

Fields with soeDEFAULT and set to the default value will return true

Definition at line 817 of file STObject.h.

◆ operator optional_type()

template<class T >
ripple::STObject::OptionalProxy< T >::operator optional_type ( ) const

◆ operator~()

template<class T >
STObject::OptionalProxy< T >::optional_type ripple::STObject::OptionalProxy< T >::operator~ ( ) const

Explicit conversion to std::optional.

Definition at line 831 of file STObject.h.

◆ value_or()

template<class T >
STObject::OptionalProxy< T >::value_type ripple::STObject::OptionalProxy< T >::value_or ( value_type  val) const

Definition at line 912 of file STObject.h.

◆ operator=() [2/6]

template<class T >
auto ripple::STObject::OptionalProxy< T >::operator= ( std::nullopt_t const &  )

Definition at line 838 of file STObject.h.

◆ operator=() [3/6]

template<class T >
auto ripple::STObject::OptionalProxy< T >::operator= ( optional_type &&  v)

Definition at line 846 of file STObject.h.

◆ operator=() [4/6]

template<class T >
auto ripple::STObject::OptionalProxy< T >::operator= ( optional_type const &  v)

Definition at line 857 of file STObject.h.

◆ operator=() [5/6]

template<class T >
template<class U >
std::enable_if_t< std::is_assignable_v< T, U >, OptionalProxy & > ripple::STObject::OptionalProxy< T >::operator= ( U &&  u)

◆ engaged()

template<class T >
bool ripple::STObject::OptionalProxy< T >::engaged ( ) const
privatenoexcept

Definition at line 883 of file STObject.h.

◆ disengage()

template<class T >
void ripple::STObject::OptionalProxy< T >::disengage ( )
private

Definition at line 890 of file STObject.h.

◆ optional_value()

template<class T >
auto ripple::STObject::OptionalProxy< T >::optional_value ( ) const
private

Definition at line 903 of file STObject.h.

◆ operator=() [6/6]

template<class T >
template<class U >
std::enable_if_t< std::is_assignable_v< T, U >, STObject::OptionalProxy< T > & > ripple::STObject::OptionalProxy< T >::operator= ( U &&  u)

Definition at line 869 of file STObject.h.

◆ value()

template<class T >
auto ripple::STObject::Proxy< T >::value ( ) const
inherited

Definition at line 716 of file STObject.h.

◆ operator*()

template<class T >
auto ripple::STObject::Proxy< T >::operator* ( ) const
inherited

Definition at line 735 of file STObject.h.

◆ operator->()

template<class T >
T const * ripple::STObject::Proxy< T >::operator-> ( ) const
inherited

Definition at line 742 of file STObject.h.

◆ find()

template<class T >
T const * ripple::STObject::Proxy< T >::find ( ) const
protectedinherited

Definition at line 749 of file STObject.h.

◆ assign()

template<class T >
template<class U >
void ripple::STObject::Proxy< T >::assign ( U &&  u)
protectedinherited

Definition at line 757 of file STObject.h.

Friends And Related Symbol Documentation

◆ STObject

template<class T >
friend class STObject
friend

Definition at line 678 of file STObject.h.

◆ operator== [1/5]

template<class T >
bool operator== ( OptionalProxy< T > const &  lhs,
std::nullopt_t   
)
friend

Definition at line 597 of file STObject.h.

◆ operator== [2/5]

template<class T >
bool operator== ( std::nullopt_t  ,
OptionalProxy< T > const &  rhs 
)
friend

Definition at line 603 of file STObject.h.

◆ operator== [3/5]

template<class T >
bool operator== ( OptionalProxy< T > const &  lhs,
optional_type const &  rhs 
)
friend

Definition at line 609 of file STObject.h.

◆ operator== [4/5]

template<class T >
bool operator== ( optional_type const &  lhs,
OptionalProxy< T > const &  rhs 
)
friend

Definition at line 619 of file STObject.h.

◆ operator== [5/5]

template<class T >
bool operator== ( OptionalProxy< T > const &  lhs,
OptionalProxy< T > const &  rhs 
)
friend

Definition at line 625 of file STObject.h.

◆ operator!= [1/5]

template<class T >
bool operator!= ( OptionalProxy< T > const &  lhs,
std::nullopt_t   
)
friend

Definition at line 633 of file STObject.h.

◆ operator!= [2/5]

template<class T >
bool operator!= ( std::nullopt_t  ,
OptionalProxy< T > const &  rhs 
)
friend

Definition at line 639 of file STObject.h.

◆ operator!= [3/5]

template<class T >
bool operator!= ( OptionalProxy< T > const &  lhs,
optional_type const &  rhs 
)
friend

Definition at line 645 of file STObject.h.

◆ operator!= [4/5]

template<class T >
bool operator!= ( optional_type const &  lhs,
OptionalProxy< T > const &  rhs 
)
friend

Definition at line 651 of file STObject.h.

◆ operator!= [5/5]

template<class T >
bool operator!= ( OptionalProxy< T > const &  lhs,
OptionalProxy< T > const &  rhs 
)
friend

Definition at line 657 of file STObject.h.

Member Data Documentation

◆ st_

template<class T >
STObject* ripple::STObject::Proxy< T >::st_
protectedinherited

Definition at line 508 of file STObject.h.

◆ style_

template<class T >
SOEStyle ripple::STObject::Proxy< T >::style_
protectedinherited

Definition at line 509 of file STObject.h.

◆ f_

template<class T >
TypedField<T> const* ripple::STObject::Proxy< T >::f_
protectedinherited

Definition at line 510 of file STObject.h.