Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

VM::VarType Struct Reference

Represents a variable type. More...

#include <vartype.h>

Collaboration diagram for VM::VarType:

Collaboration graph
[legend]
List of all members.

Public Types

enum  ID {
  Unknown = 0, Byte, Short, Int,
  Long, Flt, Dbl, Ptr
}

Public Member Functions

 VarType ()
 Construct "unknown" (non-array) var type.

 VarType (ID _id, uint8 _array)
 Construct passed var type.

 VarType (const VarType &vt)
 Copy var type.

 ~VarType ()
 Destructor: A no-op.

VarTypeoperator= (const VarType &vt)
 Assign a var type.

bool operator== (const VarType &vt) const
 Compare var types.

bool operator!= (const VarType &vt) const
 Compare var types.

bool IsPointerType () const
 Is this a pointer type (array or Ptr)?

TLString TypeString () const
 Returns string representation of type information.


Public Attributes

ID id: 8
 Type of the variable, or, if array is set, of the elems.

uint8 array
 Array? (0/1).


Detailed Description

Represents a variable type.

Author:
Wolfgang Wieser ] wwieser (a) gmx <*> de [
The ID field stores the ID of the type if array=0 and the type of the elements if array=1. I.e. an array of integers has id=Int,array=1, an array of arrays as well as an array of objects has id=Ptr,array=1, an object (pointer) has id=Ptr,array=0 and a simple integer has id=Int,array=0.

This class is C++-safe.

Definition at line 46 of file vartype.h.


Member Enumeration Documentation

enum VM::VarType::ID
 

Enumeration values:
Unknown  Should not be used (unless not yet initialized).
Byte  1 byte integer / char
Short  2 byte short integer
Int  4 byte integer
Long  8 byte long integer
Flt  4 byte floating point number
Dbl  8 byte floating point number
Ptr  Pointer type.

Definition at line 48 of file vartype.h.


Constructor & Destructor Documentation

VM::VarType::VarType  )  [inline]
 

Construct "unknown" (non-array) var type.

Definition at line 64 of file vartype.h.

VM::VarType::VarType ID  _id,
uint8  _array
[inline]
 

Construct passed var type.

Definition at line 66 of file vartype.h.

References uint8.

VM::VarType::VarType const VarType vt  )  [inline]
 

Copy var type.

Definition at line 68 of file vartype.h.

VM::VarType::~VarType  )  [inline]
 

Destructor: A no-op.

Definition at line 70 of file vartype.h.


Member Function Documentation

bool VM::VarType::IsPointerType  )  const [inline]
 

Is this a pointer type (array or Ptr)?

Definition at line 84 of file vartype.h.

Referenced by VM::VMLinker::_MergeNamespaceInfo_Recursive(), VM::AssemblerFile_Plaintext::_ParseSymbols_Class_Size(), and VM::AssemblerFile_Plaintext::_WriteSymbols_Recursive().

bool VM::VarType::operator!= const VarType vt  )  const [inline]
 

Compare var types.

Definition at line 80 of file vartype.h.

References array, and id.

VarType& VM::VarType::operator= const VarType vt  )  [inline]
 

Assign a var type.

Definition at line 73 of file vartype.h.

References array, and id.

bool VM::VarType::operator== const VarType vt  )  const [inline]
 

Compare var types.

Definition at line 77 of file vartype.h.

References array, and id.

TLString VM::VarType::TypeString  )  const
 

Returns string representation of type information.

Definition at line 23 of file vartype.cc.

References array, TLString::assign(), Byte, Dbl, Flt, id, Int, Long, Ptr, Short, and Unknown.

Referenced by VM::AssemblerFile_Plaintext::_WriteSymbols_Recursive(), VM::NamespaceInfo::DumpTree(), and VM::ClassInfo::DumpTree().


Member Data Documentation

uint8 VM::VarType::array
 

Array? (0/1).

Definition at line 61 of file vartype.h.

Referenced by VM::AssemblerFile_Plaintext::_ParseVarType(), operator!=(), operator=(), operator==(), and TypeString().

ID VM::VarType::id
 

Type of the variable, or, if array is set, of the elems.

Definition at line 60 of file vartype.h.

Referenced by VM::AssemblerFile_Plaintext::_ParseVarType(), operator!=(), operator=(), operator==(), and TypeString().


The documentation for this struct was generated from the following files:
Generated on Sat Feb 19 22:36:21 2005 for Ray by doxygen 1.3.5