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

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

Public Member Functions

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

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

Additional Inherited Members

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

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

Member Typedef Documentation

◆ value_type

typedef T::value_type value_type

The type of values held by the compound.

Definition at line 391 of file token.H.

Constructor & Destructor Documentation

◆ Compound() [1/5]

Compound ( const Compound< T > &  )
delete

No copy construct.

◆ Compound() [2/5]

Compound ( )
default

Default construct.

◆ Compound() [3/5]

Compound ( const T content)
inlineexplicit

Copy construct from base content.

Definition at line 418 of file token.H.

◆ Compound() [4/5]

Compound ( T &&  content)
inlineexplicit

Move construct from base content.

Definition at line 426 of file token.H.

◆ Compound() [5/5]

Compound ( Istream is)
inlineexplicit

Read construct from Istream.

Definition at line 434 of file token.H.

Member Function Documentation

◆ TypeNameNoDebug()

TypeNameNoDebug ( "Compound<T>"  )

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

◆ operator=()

Compound<T>& operator= ( const Compound< T > &  )
delete

No copy assignment.

◆ New()

static autoPtr<Compound<T> > New ( Args &&...  args)
inlinestatic

Construct autoPtr compound type with forwarding arguments.

Definition at line 446 of file token.H.

References args, and Foam::T().

Here is the call graph for this function:

◆ size()

virtual label size ( ) const
inlinevirtual

The size of the underlying content.

Implements token::compound.

Definition at line 460 of file token.H.

◆ resize()

virtual void resize ( const label  n)
inlinevirtual

Change the size of the underlying container content.

Implements token::compound.

Definition at line 468 of file token.H.

References n, and resize().

Here is the call graph for this function:

◆ fill_zero()

virtual void fill_zero ( )
inlinevirtual

Fill with zero value or with default value initialized.

Implements token::compound.

Definition at line 476 of file token.H.

◆ read()

virtual void read ( Istream is)
inlinevirtual

Redirect read to underlying content.

Implements token::compound.

Definition at line 481 of file token.H.

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

Here is the call graph for this function:

◆ write()

virtual void write ( Ostream os) const
inlinevirtual

Redirect write to underlying content.

Implements token::compound.

Definition at line 490 of file token.H.

◆ typeCode()

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 872 of file tokenI.H.

◆ nComponents()

virtual direction nComponents ( ) const
inlinevirtual

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

Implements token::compound.

Definition at line 508 of file token.H.

◆ cdata_bytes()

virtual const char* cdata_bytes ( ) const
inlinevirtual

Pointer to the underlying data as byte data.

Implements token::compound.

Definition at line 516 of file token.H.

◆ data_bytes()

virtual char* data_bytes ( )
inlinevirtual

Pointer to the underlying data as byte data.

Implements token::compound.

Definition at line 524 of file token.H.

◆ size_bytes()

virtual std::streamsize size_bytes ( ) const
inlinevirtual

Size of the (contiguous) byte data.

Implements token::compound.

Definition at line 532 of file token.H.


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