TokVal Class Reference

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

#include <token.h>

Collaboration diagram for TokVal:

Collaboration graph
[legend]

List of all members.

Public Member Functions

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

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.


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::TokVal (  )  [inline]

Default Constructor.

(Sets type to undefined_t)

Definition at line 37 of file token.h.

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

To set TokVal from String (C - style).

Definition at line 40 of file token.h.

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

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

Definition at line 44 of file token.h.

TokVal::TokVal ( Index  n  )  [inline]

To set TokVal from an integer.

Definition at line 48 of file token.h.

TokVal::TokVal ( Numeric  x  )  [inline]

To set TokVal from a Numeric.

Definition at line 52 of file token.h.

TokVal::TokVal ( ArrayOfString  sv  )  [inline]

To set TokVal from an array of Strings.

Definition at line 56 of file token.h.

TokVal::TokVal ( ArrayOfIndex  nv  )  [inline]

To set TokVal from an array of integers.

Definition at line 60 of file token.h.

TokVal::TokVal ( Vector  xv  )  [inline]

To set TokVal from a Vector.

Definition at line 64 of file token.h.


Member Function Documentation

TokVal::operator String (  )  const

Return String.

Definition at line 33 of file token.cc.

References ms, mtype, and String_t.

TokVal::operator Index (  )  const

Return Index.

Definition at line 38 of file token.cc.

References Index_t, mn, and mtype.

TokVal::operator Numeric (  )  const

Return Numeric.

Definition at line 43 of file token.cc.

References mtype, mx, and Numeric_t.

TokVal::operator ArrayOfString (  )  const

Return array of Strings.

Definition at line 49 of file token.cc.

References Array_String_t, msv, and mtype.

TokVal::operator ArrayOfIndex (  )  const

Return array of integers.

Definition at line 54 of file token.cc.

References Array_Index_t, mnv, and mtype.

TokVal::operator Vector (  )  const

Return Vector.

Definition at line 59 of file token.cc.

References mtype, mxv, and Vector_t.


Friends And Related Function Documentation

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

Output operator.

Definition at line 65 of file token.cc.


Member Data Documentation

String TokVal::ms [private]

Definition at line 88 of file token.h.

Referenced by operator String(), and operator<<().

Index TokVal::mn [private]

Definition at line 89 of file token.h.

Referenced by operator Index(), and operator<<().

Numeric TokVal::mx [private]

Definition at line 90 of file token.h.

Referenced by operator Numeric(), and operator<<().

Definition at line 91 of file token.h.

Referenced by operator ArrayOfString(), and operator<<().

Definition at line 92 of file token.h.

Referenced by operator ArrayOfIndex(), and operator<<().

Vector TokVal::mxv [private]

Definition at line 93 of file token.h.

Referenced by operator Vector(), and operator<<().


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

Generated on Mon Mar 23 14:07:05 2009 for ARTS by  doxygen 1.5.6