libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
Loading...
Searching...
No Matches
gimbal::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 gimbal::ReadWriteIndexable< CRTP, Key, Value, Writable >::SubscriptProxy

Definition at line 14 of file gimbal_generics.hpp.

Member Typedef Documentation

◆ ThisType

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

Definition at line 16 of file gimbal_generics.hpp.

◆ DerivedPtrType

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

Definition at line 18 of file gimbal_generics.hpp.

Constructor & Destructor Documentation

◆ SubscriptProxy()

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

Definition at line 23 of file gimbal_generics.hpp.

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

Member Function Documentation

◆ operator Value()

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

Definition at line 26 of file gimbal_generics.hpp.

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

◆ operator=() [1/2]

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

Definition at line 30 of file gimbal_generics.hpp.

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

◆ operator=() [2/2]

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

Definition at line 37 of file gimbal_generics.hpp.

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

Field Documentation

◆ ReadWrite

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

Definition at line 17 of file gimbal_generics.hpp.

◆ pObject_

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

Definition at line 20 of file gimbal_generics.hpp.

◆ key_

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

Definition at line 21 of file gimbal_generics.hpp.


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