token::compound Class Referenceabstract

Abstract base class for complex tokens. More...

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

Public Member Functions

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

Static Public Member Functions

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

Protected Attributes

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

Friends

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

Detailed Description

Abstract base class for complex tokens.

Definition at line 176 of file token.H.

Constructor & Destructor Documentation

◆ compound()

constexpr compound ( )
inlinenoexcept

Default construct.

Definition at line 214 of file token.H.

◆ ~compound()

virtual ~compound ( )
virtualdefaultnoexcept

Destructor.

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.

◆ New() [1/2]

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

Default construct specified compound type.

Definition at line 52 of file token.C.

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

Here is the call 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 73 of file token.C.

References Foam::abort(), Foam::FatalIOError, FatalIOErrorInLookup, and token::compound::read().

Here is the call graph for this function:

◆ isA()

const Type* isA ( ) const
inline

Check if dynamic_cast to Type is possible.

Definition at line 248 of file token.H.

◆ isCompound()

bool isCompound ( const word compoundType)
static

True if a known (registered) compound type.

Definition at line 104 of file token.C.

Referenced by UIPstreamBase::read(), and ISstream::read().

Here is the caller graph for this function:

◆ moved() [1/2]

bool moved ( ) const
inlinenoexcept

Get compound transferred status.

Definition at line 264 of file token.H.

References token::compound::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 269 of file token.H.

References Foam::constant::physicoChemical::b, and token::compound::state_.

◆ pending() [1/2]

bool pending ( ) const
inlinenoexcept

Get compound pending-read status.

Definition at line 277 of file token.H.

References token::compound::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 282 of file token.H.

References Foam::constant::physicoChemical::b, and token::compound::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 >.

◆ 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 >.

Referenced by token::compound::New(), and token::readCompoundToken().

Here is the caller graph for this function:

◆ write()

virtual void write ( Ostream os) const
pure virtual

Write the underlying content.

Implemented in token::Compound< T >.

Referenced by Foam::operator<<().

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 >.

◆ 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 >.

Friends And Related Function Documentation

◆ operator<<

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

Output operator.

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 187 of file token.H.

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


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