Generic Variable. More...

#include <rprgvar.h>

Inheritance diagram for RPrgVar:
[legend]
Collaboration diagram for RPrgVar:
[legend]

Public Member Functions

virtual void Assign (const void *data)
 
int Compare (const RPrgVar &v) const
 
int Compare (const RString &v) const
 
RString GetName (void) const
 
RString GetType (void) const
 
virtual RString GetValue (RInterpreter *prg)
 
 RPrgVar (const RString &name, const RString &type)
 
 RPrgVar (const RPrgVar &var)
 
virtual ~RPrgVar (void)
 

Protected Attributes

RString Name
 
RString Type
 

Detailed Description

Generic Variable.

The RPrgVar provides a class for a generic variable of a given type.

Constructor & Destructor Documentation

RPrgVar ( const RString name,
const RString type 
)

Constructor of a variable.

Parameters
nameName.
typeType of the variable.
RPrgVar ( const RPrgVar var)

Constructor of a variable.

Parameters
varVariable.
virtual ~RPrgVar ( void  )
virtual

Destruct the variable.

Member Function Documentation

int Compare ( const RPrgVar v) const

This methods compares two variables using their names and works like the "strcpy" function of the ANSI C/C++ library.

See also
R::RContainer.
Parameters
vPointer to a variable.
Returns
int
int Compare ( const RString v) const

This methods compares the name of a variable with a string and works like the "strcpy" function of the ANSI C/C++ library.

See also
R::RContainer.
Parameters
vString representing the name of the variable.
Returns
int
virtual void Assign ( const void *  data)
virtual

Assign some data to the variable.

Parameters
dataData.

Reimplemented in RPrgVarInst, RPrgVarString, RPrgVarRef, and RPrgVarLiteral.

virtual RString GetValue ( RInterpreter prg)
virtual

Get the value of the variable.

Parameters
prgProgram.

Reimplemented in RPrgVarInst, RPrgVarString, RPrgVarRef, and RPrgVarLiteral.

RString GetType ( void  ) const

Get the type of the variable.

RString GetName ( void  ) const

Get the name of the variable.

Member Data Documentation

RString Name
protected

Name of the variable.

RString Type
protected

Type of the variable.