NullObject Class Reference

Singleton null-object class and instance. More...

Collaboration diagram for NullObject:

Public Member Functions

const void * pointer () const noexcept
 A nullptr pointer content. More...
 
unsigned long value () const noexcept
 Zero valued integer content. More...
 
bool empty () const noexcept
 No elements. More...
 
label size () const noexcept
 Zero elements. More...
 
const NullObjecttoc () const noexcept
 No-op method (for HashTable replacement) More...
 
const NullObjectsortedToc () const noexcept
 No-op method (for HashTable replacement) More...
 
template<class T >
const NullObjectoperator= (const T &) const noexcept
 Swallow assignment (cf, std::ignore) More...
 

Static Public Attributes

static const NullObject nullObject
 A unique null object. More...
 

Detailed Description

Singleton null-object class and instance.

Its contents occupy enough space to also be reinterpreted as another class with a null pointer or zero long for its first member, with additional zero parameters for safe casting to List etc.

Source files

Definition at line 56 of file nullObject.H.

Member Function Documentation

◆ pointer()

const void* pointer ( ) const
inlinenoexcept

A nullptr pointer content.

Definition at line 114 of file nullObject.H.

◆ value()

unsigned long value ( ) const
inlinenoexcept

Zero valued integer content.

Definition at line 122 of file nullObject.H.

◆ empty()

bool empty ( ) const
inlinenoexcept

No elements.

Definition at line 130 of file nullObject.H.

◆ size()

label size ( ) const
inlinenoexcept

Zero elements.

Definition at line 138 of file nullObject.H.

◆ toc()

const NullObject& toc ( ) const
inlinenoexcept

No-op method (for HashTable replacement)

Definition at line 146 of file nullObject.H.

◆ sortedToc()

const NullObject& sortedToc ( ) const
inlinenoexcept

No-op method (for HashTable replacement)

Definition at line 154 of file nullObject.H.

◆ operator=()

const NullObject& operator= ( const T ) const
inlinenoexcept

Swallow assignment (cf, std::ignore)

Definition at line 166 of file nullObject.H.

Member Data Documentation

◆ nullObject

const Foam::NullObject nullObject
static

A unique null object.

Definition at line 106 of file nullObject.H.


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