ARTS  1.0.222
Public Member Functions | Private Attributes | Friends | List of all members
TokVal Class Reference

This stores arbitrary token values and remembers the type. More...

#include <token.h>

Public Member Functions

 TokVal ()
 Default Constructor. More...
 
 TokVal (const char s[])
 To set TokVal from String (C - style). More...
 
 TokVal (const String &s)
 To set TokVal from String (C++ - style). More...
 
 TokVal (Index n)
 To set TokVal from an integer. More...
 
 TokVal (Numeric x)
 To set TokVal from a Numeric. More...
 
 TokVal (ArrayOfString sv)
 To set TokVal from an array of Strings. More...
 
 TokVal (ArrayOfIndex nv)
 To set TokVal from an array of integers. More...
 
 TokVal (Vector xv)
 To set TokVal from a Vector. More...
 
 operator String () const
 Return String. More...
 
 operator Index () const
 Return Index. More...
 
 operator Numeric () const
 Return Numeric. More...
 
 operator ArrayOfString () const
 Return array of Strings. More...
 
 operator ArrayOfIndex () const
 Return array of integers. More...
 
 operator Vector () const
 Return Vector. More...
 

Private Attributes

TokValType mtype
 
String ms
 
Index mn
 
Numeric mx
 
ArrayOfString msv
 
ArrayOfIndex mnv
 
Vector mxv
 

Friends

ostream & operator<< (ostream &os, const TokVal &a)
 Output operator. More...
 

Detailed Description

This stores arbitrary token values and remembers the type.

Only the correct type can be extracted again.

Definition at line 33 of file token.h.

Constructor & Destructor Documentation

◆ TokVal() [1/8]

TokVal::TokVal ( )
inline

Default Constructor.

(Sets type to undefined_t)

Definition at line 37 of file token.h.

◆ TokVal() [2/8]

TokVal::TokVal ( const char  s[])
inline

To set TokVal from String (C - style).

Definition at line 42 of file token.h.

◆ TokVal() [3/8]

TokVal::TokVal ( const String s)
inline

To set TokVal from String (C++ - style).

Definition at line 48 of file token.h.

◆ TokVal() [4/8]

TokVal::TokVal ( Index  n)
inline

To set TokVal from an integer.

Definition at line 54 of file token.h.

◆ TokVal() [5/8]

TokVal::TokVal ( Numeric  x)
inline

To set TokVal from a Numeric.

Definition at line 60 of file token.h.

◆ TokVal() [6/8]

TokVal::TokVal ( ArrayOfString  sv)
inline

To set TokVal from an array of Strings.

Definition at line 66 of file token.h.

◆ TokVal() [7/8]

TokVal::TokVal ( ArrayOfIndex  nv)
inline

To set TokVal from an array of integers.

Definition at line 72 of file token.h.

◆ TokVal() [8/8]

TokVal::TokVal ( Vector  xv)
inline

To set TokVal from a Vector.

Definition at line 78 of file token.h.

Member Function Documentation

◆ operator ArrayOfIndex()

TokVal::operator ArrayOfIndex ( ) const

Return array of integers.

Definition at line 54 of file token.cc.

◆ operator ArrayOfString()

TokVal::operator ArrayOfString ( ) const

Return array of Strings.

Definition at line 49 of file token.cc.

◆ operator Index()

TokVal::operator Index ( ) const

Return Index.

Definition at line 38 of file token.cc.

◆ operator Numeric()

TokVal::operator Numeric ( ) const

Return Numeric.

Definition at line 43 of file token.cc.

◆ operator String()

TokVal::operator String ( ) const

Return String.

Definition at line 33 of file token.cc.

◆ operator Vector()

TokVal::operator Vector ( ) const

Return Vector.

Definition at line 59 of file token.cc.

Friends And Related Function Documentation

◆ operator<<

ostream& operator<< ( ostream &  os,
const TokVal a 
)
friend

Output operator.

Definition at line 65 of file token.cc.

Member Data Documentation

◆ mn

Index TokVal::mn
private

Definition at line 105 of file token.h.

◆ mnv

ArrayOfIndex TokVal::mnv
private

Definition at line 108 of file token.h.

◆ ms

String TokVal::ms
private

Definition at line 104 of file token.h.

◆ msv

ArrayOfString TokVal::msv
private

Definition at line 107 of file token.h.

◆ mtype

TokValType TokVal::mtype
private

Definition at line 103 of file token.h.

◆ mx

Numeric TokVal::mx
private

Definition at line 106 of file token.h.

◆ mxv

Vector TokVal::mxv
private

Definition at line 109 of file token.h.


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