PackedList< Width >::reference Class Reference

A reference supporting read/write access to an entry. More...

Inheritance diagram for PackedList< Width >::reference:
[legend]

Public Member Functions

 reference (const reference &)=default
 Copy construct. More...
 
 reference (reference &&)=default
 Move construct. More...
 
void operator= (const reference &other)
 Value assignment. More...
 
void operator= (const unsigned int val)
 Value assignment. More...
 
 operator unsigned int () const
 Conversion operator. More...
 

Protected Member Functions

void operator& ()=delete
 
 reference (PackedList *parent, const label index)
 
unsigned int get () const
 Get value as unsigned, no range-checking. More...
 
bool set (unsigned int val)
 Set value, returning true if changed, no range-checking. More...
 

Protected Attributes

block_typeref_
 Reference to the block. More...
 
unsigned shift_
 The bit shift to access the given sub-portion. More...
 

Friends

class PackedList
 

Detailed Description

template<unsigned Width>
class Foam::PackedList< Width >::reference

A reference supporting read/write access to an entry.

Definition at line 450 of file PackedList.H.

Constructor & Destructor Documentation

◆ reference() [1/3]

reference ( PackedList parent,
const label  index 
)
inlineprotected

Construct by taking reference of block from within the list and the specified index.

◆ reference() [2/3]

reference ( const reference )
default

Copy construct.

◆ reference() [3/3]

reference ( reference &&  )
default

Move construct.

Member Function Documentation

◆ operator&()

void operator& ( )
protecteddelete

◆ get()

unsigned int get ( ) const
inlineprotected

Get value as unsigned, no range-checking.

Definition at line 291 of file PackedListI.H.

References PackedList< Width >::max_value, PackedList< Width >::reference::ref_, and PackedList< Width >::reference::shift_.

◆ set()

bool set ( unsigned int  val)
inlineprotected

Set value, returning true if changed, no range-checking.

Definition at line 298 of file PackedListI.H.

References PackedList< Width >::max_value.

◆ operator=() [1/2]

void operator= ( const reference other)
inline

Value assignment.

Definition at line 319 of file PackedListI.H.

References PackedList< Width >::set().

Here is the call graph for this function:

◆ operator=() [2/2]

void operator= ( const unsigned int  val)
inline

Value assignment.

Definition at line 330 of file PackedListI.H.

References PackedList< Width >::set().

Here is the call graph for this function:

◆ operator unsigned int()

operator unsigned int ( ) const
inline

Conversion operator.

Definition at line 339 of file PackedListI.H.

References PackedList< Width >::get().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ PackedList

friend class PackedList
friend

Definition at line 454 of file PackedList.H.

Member Data Documentation

◆ ref_

block_type& ref_
protected

Reference to the block.

Definition at line 458 of file PackedList.H.

Referenced by bitSet::reference::flip(), and PackedList< Width >::reference::get().

◆ shift_

unsigned shift_
protected

The bit shift to access the given sub-portion.

Definition at line 461 of file PackedList.H.

Referenced by bitSet::reference::flip(), and PackedList< Width >::reference::get().


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