Loading...
Searching...
No Matches
token::compound Class Referenceabstract

Abstract base class for complex tokens. More...

#include <token.H>

Inheritance diagram for token::compound:
Collaboration diagram for token::compound:

Public Member Functions

 TypeNameNoDebug ("compound")
 Declare type-name, virtual type (without debug switch).
 declareRunTimeSelectionTable (autoPtr, compound, empty,(),())
 Declare run-time constructor selection table.
constexpr compound () noexcept
 Default construct.
virtual ~compound () noexcept=default
 Destructor.
template<class Type>
const Type * isA () const
 Attempt dynamic_cast to Type returns nullptr if cast is not possible.
bool moved () const noexcept
 Get compound transferred status.
void moved (bool b) noexcept
 Set compound transferred status.
bool pending () const noexcept
 Get compound pending-read status.
void pending (bool b) noexcept
 Set compound pending-read status.
virtual label size () const =0
 The size of the underlying content.
virtual void resize (const label n)=0
 Change the size of the underlying container content.
virtual void fill_zero ()=0
 Fill with zero values, or with default constructed.
virtual void read (Istream &is)=0
 Read from stream into the underlying content.
virtual void write (Ostream &os) const =0
 Write the underlying content.
virtual tokenType typeCode () const =0
 The token type (if any) corresponding to the contained component type (LABEL, FLOAT, DOUBLE, etc).
virtual direction nComponents () const =0
 The number of vector-space or other components of the underlying data content.
virtual direction rank () const =0
 The vector-space rank associated with the data content.
virtual const char * cdata_bytes () const =0
 Pointer to the underlying data as byte data.
virtual char * data_bytes ()=0
 Pointer to the underlying data as byte data.
virtual std::streamsize size_bytes () const =0
 Size of the (contiguous) byte data.
Public Member Functions inherited from refCount
constexpr refCount () noexcept
 Default construct, initializing count to 0.
int use_count () const noexcept
 Return the current reference count.
bool unique () const noexcept
 Return true if the reference count is zero.
void operator++ () noexcept
 Increment the reference count.
void operator++ (int) noexcept
 Increment the reference count.
void operator-- () noexcept
 Decrement the reference count.
void operator-- (int) noexcept
 Decrement the reference count.

Static Public Member Functions

static autoPtr< compoundNew (const word &compoundType)
 Default construct specified compound type.
static autoPtr< compoundNew (const word &compoundType, Istream &is, const bool readContent=true)
 Default construct specified compound type and read from stream.
static bool isCompound (const word &compoundType)
 True if a known (registered) compound type.

Protected Attributes

unsigned char state_
 The compound token state, internally used values only.

Friends

Ostreamoperator<< (Ostream &os, const compound &ct)
 Output operator.

Detailed Description

Abstract base class for complex tokens.

Definition at line 189 of file token.H.

Constructor & Destructor Documentation

◆ compound()

compound ( )
inlineconstexprnoexcept

Default construct.

Definition at line 227 of file token.H.

References Foam::noexcept, and state_.

Referenced by declareRunTimeSelectionTable(), operator<<, and ~compound().

Here is the caller graph for this function:

◆ ~compound()

virtual ~compound ( )
virtualdefaultnoexcept

Destructor.

References compound(), New(), and Foam::noexcept.

Here is the call graph for this function:

Member Function Documentation

◆ TypeNameNoDebug()

TypeNameNoDebug ( "compound" )

Declare type-name, virtual type (without debug switch).

◆ declareRunTimeSelectionTable()

declareRunTimeSelectionTable ( autoPtr ,
compound ,
empty ,
() ,
()  )

Declare run-time constructor selection table.

References compound().

Here is the call graph for this function:

◆ New() [1/2]

Foam::autoPtr< Foam::token::compound > New ( const word & compoundType)
static

Default construct specified compound type.

Definition at line 51 of file token.C.

References Foam::abort(), Foam::FatalError, and FatalErrorInLookup.

Referenced by ~compound().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ New() [2/2]

Foam::autoPtr< Foam::token::compound > New ( const word & compoundType,
Istream & is,
const bool readContent = true )
static

Default construct specified compound type and read from stream.

Definition at line 72 of file token.C.

References Foam::abort(), Foam::FatalIOError, and FatalIOErrorInLookup.

Here is the call graph for this function:

◆ isA()

template<class Type>
const Type * isA ( ) const
inline

Attempt dynamic_cast to Type returns nullptr if cast is not possible.

Definition at line 262 of file token.H.

References isA().

Referenced by isA().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isCompound()

bool isCompound ( const word & compoundType)
static

True if a known (registered) compound type.

Definition at line 104 of file token.C.

Referenced by ISstream::read(), UIPstreamBase::read(), FixedList< T, N >::writeEntry(), and UList< T >::writeEntry().

Here is the caller graph for this function:

◆ moved() [1/2]

bool moved ( ) const
inlinenoexcept

Get compound transferred status.

Definition at line 278 of file token.H.

References Foam::noexcept, and state_.

Referenced by Foam::printTokenInfo().

Here is the caller graph for this function:

◆ moved() [2/2]

void moved ( bool b)
inlinenoexcept

Set compound transferred status.

Definition at line 283 of file token.H.

References b, and state_.

◆ pending() [1/2]

bool pending ( ) const
inlinenoexcept

Get compound pending-read status.

Definition at line 291 of file token.H.

References Foam::noexcept, and state_.

Referenced by Foam::operator<<(), and Foam::printTokenInfo().

Here is the caller graph for this function:

◆ pending() [2/2]

void pending ( bool b)
inlinenoexcept

Set compound pending-read status.

Definition at line 296 of file token.H.

References b, and state_.

◆ size()

virtual label size ( ) const
pure virtual

The size of the underlying content.

Implemented in token::Compound< T >.

◆ resize()

virtual void resize ( const label n)
pure virtual

Change the size of the underlying container content.

Implemented in token::Compound< T >.

References n.

◆ fill_zero()

virtual void fill_zero ( )
pure virtual

Fill with zero values, or with default constructed.

Implemented in token::Compound< T >.

◆ read()

virtual void read ( Istream & is)
pure virtual

Read from stream into the underlying content.

Implemented in token::Compound< T >.

◆ write()

virtual void write ( Ostream & os) const
pure virtual

Write the underlying content.

Implemented in token::Compound< T >.

References os().

Referenced by Foam::operator<<().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ typeCode()

virtual tokenType typeCode ( ) const
pure virtual

The token type (if any) corresponding to the contained component type (LABEL, FLOAT, DOUBLE, etc).

Implemented in token::Compound< T >.

◆ nComponents()

virtual direction nComponents ( ) const
pure virtual

The number of vector-space or other components of the underlying data content.

Implemented in token::Compound< T >.

◆ rank()

virtual direction rank ( ) const
pure virtual

The vector-space rank associated with the data content.

Implemented in token::Compound< T >.

◆ cdata_bytes()

virtual const char * cdata_bytes ( ) const
pure virtual

Pointer to the underlying data as byte data.

Implemented in token::Compound< T >.

◆ data_bytes()

virtual char * data_bytes ( )
pure virtual

Pointer to the underlying data as byte data.

Implemented in token::Compound< T >.

◆ size_bytes()

virtual std::streamsize size_bytes ( ) const
pure virtual

Size of the (contiguous) byte data.

Implemented in token::Compound< T >.

◆ operator<<

Ostream & operator<< ( Ostream & os,
const compound & ct )
friend

Output operator.

References compound(), and os().

Member Data Documentation

◆ state_

unsigned char state_
protected

The compound token state, internally used values only.

(0: initial, 1: moved, 2: pending read...)

Definition at line 200 of file token.H.

Referenced by compound(), moved(), moved(), pending(), pending(), and token::Compound< T >::read().


The documentation for this class was generated from the following files:
  • src/OpenFOAM/db/IOstreams/token/token.H
  • src/OpenFOAM/db/IOstreams/token/token.C