Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
RecordRef< VAL > Class Template Reference

#include "lib/diff/record.hpp"

Description

template<typename VAL>
class lib::diff::RecordRef< VAL >

wrapped record reference.

A helper for lib::GenNode and the diff representation. RecordRef is copyable and movable, but like a reference can not be rebound. It can be used to refer to a subtree within the diff representation, without the need to copy.

Remarks
this is almost identical to std::ref, with the notable difference that it can be default-created into "bottom" state; this also implies to have a NULL check on dereferentiation.

Definition at line 617 of file record.hpp.

Public Member Functions

 RecordRef () noexcept
 by default create an invalid ("bottom") reference
 
 RecordRef (Target &o) noexcept
 create a reference bound to the given target; can not be rebound
 
 RecordRef (Target &&)=delete
 prevent moving into black hole
 
 RecordRef (RecordRef const &)=default
 
 RecordRef (RecordRef &&)=default
 
RecordRefoperator= (RecordRef const &)=delete
 references can not be reassigned
 
RecordRefoperator= (RecordRef &)=delete
 
RecordRefoperator= (RecordRef &&o)
 assignment is not allowed, but moving is
 
 operator bool () const
 
bool empty () const
 
 operator Target & () const
 target is accessed by cast
 
Targetget () const noexcept
 
 operator string () const
 

Friends

bool operator== (RecordRef const &r1, RecordRef const &r2)
 
bool operator!= (RecordRef const &r1, RecordRef const &r2)
 

Private Types

using Target = Record< VAL >
 

Private Attributes

Targetrecord_
 

Constructor & Destructor Documentation

◆ RecordRef() [1/5]

template<typename VAL >
RecordRef ( )
inlinenoexcept

by default create an invalid ("bottom") reference

Definition at line 626 of file record.hpp.

◆ RecordRef() [2/5]

template<typename VAL >
RecordRef ( Target o)
inlinenoexcept

create a reference bound to the given target; can not be rebound

Definition at line 632 of file record.hpp.

◆ RecordRef() [3/5]

template<typename VAL >
RecordRef ( Target &&  )
delete

prevent moving into black hole

◆ RecordRef() [4/5]

template<typename VAL >
RecordRef ( RecordRef< VAL > const &  )
default

◆ RecordRef() [5/5]

template<typename VAL >
RecordRef ( RecordRef< VAL > &&  )
default

Member Typedef Documentation

◆ Target

template<typename VAL >
using Target = Record<VAL>
private

Definition at line 619 of file record.hpp.

Member Function Documentation

◆ operator=() [1/3]

template<typename VAL >
RecordRef & operator= ( RecordRef< VAL > const &  )
delete

references can not be reassigned

◆ operator=() [2/3]

template<typename VAL >
RecordRef & operator= ( RecordRef< VAL > &  )
delete

◆ operator=() [3/3]

template<typename VAL >
RecordRef & operator= ( RecordRef< VAL > &&  o)
inline

assignment is not allowed, but moving is

Definition at line 648 of file record.hpp.

References RecordRef< VAL >::record_.

◆ operator bool()

template<typename VAL >
operator bool ( ) const
inlineexplicit

Definition at line 656 of file record.hpp.

References RecordRef< VAL >::record_.

◆ empty()

template<typename VAL >
bool empty ( ) const
inline

Definition at line 662 of file record.hpp.

References RecordRef< VAL >::record_.

Referenced by DataCap::matchRec(), DataCap::maybeAccessNestedRec(), RecordRef< VAL >::operator string(), and lib::diff::renderCompact().

+ Here is the caller graph for this function:

◆ operator Target &()

template<typename VAL >
operator Target & ( ) const
inline

target is accessed by cast

Exceptions
error::Logicon bottom reference

Definition at line 670 of file record.hpp.

References RecordRef< VAL >::record_.

◆ get()

template<typename VAL >
Target * get ( ) const
inlinenoexcept

Definition at line 679 of file record.hpp.

References RecordRef< VAL >::record_.

Referenced by WrappedStandardExeBuilder::invokeOriginalBuilder(), DataCap::matchRec(), DataCap::matchRec(), DataCap::maybeAccessNestedRec(), lib::diff::renderCompact(), and GenericRecord_test::wrapRef().

+ Here is the caller graph for this function:

◆ operator string()

template<typename VAL >
operator string ( ) const
inline

Definition at line 684 of file record.hpp.

References RecordRef< VAL >::empty(), and RecordRef< VAL >::record_.

+ Here is the call graph for this function:

Member Data Documentation

◆ record_

Friends And Related Symbol Documentation

◆ operator==

template<typename VAL >
bool operator== ( RecordRef< VAL > const &  r1,
RecordRef< VAL > const &  r2 
)
friend
Note
equality of references (instance pointers), not targets

Definition at line 692 of file record.hpp.

◆ operator!=

template<typename VAL >
bool operator!= ( RecordRef< VAL > const &  r1,
RecordRef< VAL > const &  r2 
)
friend

Definition at line 697 of file record.hpp.

+ Collaboration diagram for RecordRef< VAL >:

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