libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
Loading...
Searching...
No Matches
gbl::ReadWriteIndexable< CRTP, Key, Value, Writable >::SubscriptProxy Class Reference

Public Types

using ThisType = SubscriptProxy
 
using DerivedPtrType = std::conditional_t< ReadWrite, CRTP *, const CRTP * >
 

Public Member Functions

 SubscriptProxy (DerivedPtrType pObject, Key key)
 
 operator Value () const
 
ThisTypeoperator= (Value value)
 
template<typename RValue >
requires ReadWrite
ThisTypeoperator= (RValue &&rhs)
 

Data Fields

DerivedPtrType pObject_
 
Key key_
 

Static Public Attributes

static constexpr bool ReadWrite
 

Detailed Description

template<typename CRTP, typename Key, typename Value, bool Writable>
class gbl::ReadWriteIndexable< CRTP, Key, Value, Writable >::SubscriptProxy

Definition at line 13 of file gimbal_generics.hpp.

Member Typedef Documentation

◆ ThisType

template<typename CRTP , typename Key , typename Value , bool Writable>
using gbl::ReadWriteIndexable< CRTP, Key, Value, Writable >::SubscriptProxy::ThisType = SubscriptProxy

Definition at line 15 of file gimbal_generics.hpp.

◆ DerivedPtrType

template<typename CRTP , typename Key , typename Value , bool Writable>
using gbl::ReadWriteIndexable< CRTP, Key, Value, Writable >::SubscriptProxy::DerivedPtrType = std::conditional_t<ReadWrite, CRTP*, const CRTP*>

Definition at line 17 of file gimbal_generics.hpp.

Constructor & Destructor Documentation

◆ SubscriptProxy()

template<typename CRTP , typename Key , typename Value , bool Writable>
gbl::ReadWriteIndexable< CRTP, Key, Value, Writable >::SubscriptProxy::SubscriptProxy ( DerivedPtrType  pObject,
Key  key 
)
inline

Definition at line 22 of file gimbal_generics.hpp.

22 :
23 pObject_(pObject), key_(std::move(key)) {}

Member Function Documentation

◆ operator Value()

template<typename CRTP , typename Key , typename Value , bool Writable>
gbl::ReadWriteIndexable< CRTP, Key, Value, Writable >::SubscriptProxy::operator Value ( ) const
inline

Definition at line 25 of file gimbal_generics.hpp.

25 {
26 return pObject_->getElement_(key_);
27 }

◆ operator=() [1/2]

template<typename CRTP , typename Key , typename Value , bool Writable>
ThisType & gbl::ReadWriteIndexable< CRTP, Key, Value, Writable >::SubscriptProxy::operator= ( Value  value)
inline

Definition at line 29 of file gimbal_generics.hpp.

29 {
30 pObject_->setElement_(key_, std::move(value));
31 return *this;
32 }

◆ operator=() [2/2]

template<typename CRTP , typename Key , typename Value , bool Writable>
template<typename RValue >
requires ReadWrite
ThisType & gbl::ReadWriteIndexable< CRTP, Key, Value, Writable >::SubscriptProxy::operator= ( RValue &&  rhs)
inline

Definition at line 36 of file gimbal_generics.hpp.

36 {
37 pObject_->setElement_(key_, std::forward<RValue>(rhs));
38 return *this;
39 }

Field Documentation

◆ ReadWrite

template<typename CRTP , typename Key , typename Value , bool Writable>
constexpr bool gbl::ReadWriteIndexable< CRTP, Key, Value, Writable >::SubscriptProxy::ReadWrite
staticconstexpr

Definition at line 16 of file gimbal_generics.hpp.

◆ pObject_

template<typename CRTP , typename Key , typename Value , bool Writable>
DerivedPtrType gbl::ReadWriteIndexable< CRTP, Key, Value, Writable >::SubscriptProxy::pObject_

Definition at line 19 of file gimbal_generics.hpp.

19{};

◆ key_

template<typename CRTP , typename Key , typename Value , bool Writable>
Key gbl::ReadWriteIndexable< CRTP, Key, Value, Writable >::SubscriptProxy::key_

Definition at line 20 of file gimbal_generics.hpp.

20{};

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