Loading...
Searching...
No Matches
token::Compound< T > Class Template Reference

A templated class for holding compound tokens. The underlying container is normally a List of values, it must have a value_type typedef as well as size(), resize(), cdata_bytes(), data_bytes(), size_bytes() methods. More...

#include <token.H>

Inheritance diagram for token::Compound< T >:
Collaboration diagram for token::Compound< T >:

Public Types

typedef T::value_type value_type
 The type of values held by the compound.

Public Member Functions

 TypeNameNoDebug ("Compound<T>")
 Declare type-name, virtual type (without debug switch).
 Compound (const Compound< T > &)=delete
 No copy construct.
void operator= (const Compound< T > &)=delete
 No copy assignment.
 Compound ()=default
 Default construct.
 Compound (const T &content)
 Copy construct from base content.
 Compound (T &&content)
 Move construct from base content.
 Compound (Istream &is)
 Read construct from Istream.
virtual label size () const
 The size of the underlying content.
virtual void resize (const label n)
 Change the size of the underlying content.
virtual void fill_zero ()
 Fill with zero value or with default value initialized.
virtual void read (Istream &is)
 Redirect read to underlying content.
virtual void write (Ostream &os) const
 Redirect write to underlying content.
virtual tokenType typeCode () const
 The token type (if any) corresponding to the contained component type (LABEL, FLOAT, DOUBLE, etc).
virtual direction nComponents () const
 The number of vector-space or other components of the underlying data content.
virtual direction rank () const
 The vector-space rank associated with the data content.
virtual const char * cdata_bytes () const
 Pointer to the underlying data as byte data.
virtual char * data_bytes ()
 Pointer to the underlying data as byte data.
virtual std::streamsize size_bytes () const
 Size of the (contiguous) byte data.
const::Foam::word typeName ("List<edge>")
Public Member Functions inherited from token::compound
 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.
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

template<class... Args>
static autoPtr< compoundNew (Args &&... args)
 Construct autoPtr compound with forwarding arguments.
Static Public Member Functions inherited from token::compound
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.

Additional Inherited Members

Protected Attributes inherited from token::compound
unsigned char state_
 The compound token state, internally used values only.

Detailed Description

template<class T>
class Foam::token::Compound< T >

A templated class for holding compound tokens. The underlying container is normally a List of values, it must have a value_type typedef as well as size(), resize(), cdata_bytes(), data_bytes(), size_bytes() methods.

Definition at line 378 of file token.H.

Member Typedef Documentation

◆ value_type

template<class T>
typedef T::value_type value_type

The type of values held by the compound.

Definition at line 408 of file token.H.

Constructor & Destructor Documentation

◆ Compound() [1/5]

template<class T>
Compound ( const Compound< T > & )
delete

No copy construct.

References Compound().

Referenced by Compound(), New(), and operator=().

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

◆ Compound() [2/5]

template<class T>
Compound ( )
default

Default construct.

◆ Compound() [3/5]

template<class T>
Compound ( const T & content)
inlineexplicit

Copy construct from base content.

Definition at line 435 of file token.H.

References Foam::T().

Here is the call graph for this function:

◆ Compound() [4/5]

template<class T>
Compound ( T && content)
inlineexplicit

Move construct from base content.

Definition at line 443 of file token.H.

References Foam::T().

Here is the call graph for this function:

◆ Compound() [5/5]

template<class T>
Compound ( Istream & is)
inlineexplicit

Read construct from Istream.

Definition at line 451 of file token.H.

References Foam::T().

Here is the call graph for this function:

Member Function Documentation

◆ TypeNameNoDebug()

template<class T>
TypeNameNoDebug ( "Compound<T>" )

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

◆ operator=()

template<class T>
void operator= ( const Compound< T > & )
delete

No copy assignment.

References Compound().

Here is the call graph for this function:

◆ New()

template<class T>
template<class... Args>
autoPtr< compound > New ( Args &&... args)
inlinestatic

Construct autoPtr compound with forwarding arguments.

The return type is compound, not Compound since that is what the token interface requires.

Definition at line 466 of file token.H.

References args, Compound(), and T.

Here is the call graph for this function:

◆ size()

template<class T>
virtual label size ( ) const
inlinevirtual

The size of the underlying content.

Implements token::compound.

Definition at line 480 of file token.H.

◆ resize()

template<class T>
virtual void resize ( const label n)
inlinevirtual

Change the size of the underlying content.

Implements token::compound.

Definition at line 488 of file token.H.

References n.

◆ fill_zero()

template<class T>
virtual void fill_zero ( )
inlinevirtual

Fill with zero value or with default value initialized.

Implements token::compound.

Definition at line 496 of file token.H.

◆ read()

template<class T>
virtual void read ( Istream & is)
inlinevirtual

Redirect read to underlying content.

Implements token::compound.

Definition at line 501 of file token.H.

References Foam::operator>>(), token::compound::state_, and Foam::T().

Here is the call graph for this function:

◆ write()

template<class T>
virtual void write ( Ostream & os) const
inlinevirtual

Redirect write to underlying content.

Implements token::compound.

Definition at line 510 of file token.H.

References os().

Here is the call graph for this function:

◆ typeCode()

template<class T>
Foam::token::tokenType typeCode ( ) const
virtual

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

Implements token::compound.

Definition at line 1182 of file tokenI.H.

References token::BOOL, token::DOUBLE, token::FLOAT, token::INTEGER_32, token::INTEGER_64, token::PUNCTUATION, and token::UNDEFINED.

◆ nComponents()

template<class T>
virtual direction nComponents ( ) const
inlinevirtual

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

Implements token::compound.

Definition at line 528 of file token.H.

◆ rank()

template<class T>
virtual direction rank ( ) const
inlinevirtual

The vector-space rank associated with the data content.

Implements token::compound.

Definition at line 536 of file token.H.

◆ cdata_bytes()

template<class T>
virtual const char * cdata_bytes ( ) const
inlinevirtual

Pointer to the underlying data as byte data.

Implements token::compound.

Definition at line 544 of file token.H.

◆ data_bytes()

template<class T>
virtual char * data_bytes ( )
inlinevirtual

Pointer to the underlying data as byte data.

Implements token::compound.

Definition at line 552 of file token.H.

◆ size_bytes()

template<class T>
virtual std::streamsize size_bytes ( ) const
inlinevirtual

Size of the (contiguous) byte data.

Implements token::compound.

Definition at line 560 of file token.H.

◆ typeName()

const::Foam::word typeName ( "List<edge>" )

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