Generated on Mon Aug 25 11:35:53 2008 for Gecode by doxygen 1.5.6

Gecode::Reflection::Arg Class Reference
[Reflection API]

Inherited by Gecode::Reflection::ArrayArg, and Gecode::Reflection::IntArrayArg.

List of all members.


Detailed Description

Arguments for actor and variable specifications.

These arguments implement a simple term language. A term is an integer, a variable, an array of terms, an array of integers, a string, a pair, a shared object, or a reference to a shared object.

Variables are represented by integers that correspond to indices in a VarMap.

Definition at line 84 of file reflection.icc.


Public Member Functions

bool isInt (void) const
 Test if this represents an integer
int toInt (void) const
 Return the integer that this argument represents.
void initInt (int i)
 Initialize this as an int argument.
bool isVar (void) const
 Test if this represents a variable
int toVar (void) const
 Return the variable index that this argument represents.
void initVar (int i)
 Initialize this as a variable argument.
bool isArray (void) const
 Test if this represents an array
ArrayArgtoArray (void)
 Return the array that this argument represents.
const ArrayArgtoArray (void) const
 Return the array that this argument represents.
void initArray (int n)
 Initialize this as an array argument with size n.
bool isIntArray (void) const
 Test if this represents an array
IntArrayArgtoIntArray (void)
 Return the array that this argument represents.
const IntArrayArgtoIntArray (void) const
 Return the array that this argument represents.
void initIntArray (int n)
 Initialize this as an int array argument with size n.
bool isString (void) const
 Test if this represents a string
const char * toString (void) const
 Return the string that this argument represents.
void initString (const char *s)
 Initialize this as a string argument.
bool isPair (void) const
 Test if this represents a pair
Argfirst (void)
 Return the first component of the pair that this argument represents.
const Argfirst (void) const
 Return the first component of the pair that this argument represents.
Argsecond (void)
 Return the second component of the pair that this argument represents.
const Argsecond (void) const
 Return the second component of the pair that this argument represents.
void initPair (Arg *a, Arg *b)
 Initialize this as a pair argument from a and b.
bool isSharedObject (void) const
 Test if this represents a shared object
ArgtoSharedObject (void)
 Return the shared object that this argument represents.
const ArgtoSharedObject (void) const
 Return the shared object that this argument represents.
void initSharedObject (Arg *a)
 Initialize this as a shared object.
bool isSharedReference (void) const
 Test if this represents a shared object reference
int toSharedReference (void) const
 Return the shared object that this argument represents.
void initSharedReference (int ref)
 Initialize this as a reference to a shared object.
 ~Arg (void)
 Destructor.

Static Public Member Functions

static ArgnewInt (int i)
 Create new int argument.
static ArgnewVar (int i)
 Create new variable argument.
static ArrayArgnewArray (int n)
 Create new array argument with size n.
static IntArrayArgnewIntArray (int n)
 Create new integer array argument with size n.
template<class A>
static IntArrayArgnewIntArray (const A &a)
 Create new integer array argument from array a.
static ArgnewString (const char *s)
 Create new string argument.
static ArgnewPair (Arg *a, Arg *b)
 Create new pair argument from a and b.
static ArgnewSharedObject (Arg *a)
 Create new shared object.
static ArgnewSharedReference (int ref)
 Create new reference to shared object.

Protected Types

enum  argtype {
  INT_ARG, VAR_ARG, ARRAY_ARG, INT_ARRAY_ARG,
  STRING_ARG, PAIR_ARG, SHARED_OBJECT_ARG, SHARED_REF_ARG
}
 The different types of arguments. More...

Protected Member Functions

 Arg (argtype t)
 Constructor.

Protected Attributes

argtype t
 Argument type of this Arg.
union {
   int   i
 The integer of an INT_ARG, the index of a VAR_ARG or SHARED_REF_ARG, or the size of an ARRAY_ARG or INT_ARRAY_ARG.
   char *   s
 The string of a STRING_ARG.
   Arg *   first
 The first argument of a PAIR_ARG, or the object of a SHARED_OBJECT_ARG.
arg1
union {
   Arg *   second
 The second argument of a PAIR_ARG.
   Arg **   aa
 The array of an ARRAY_ARG.
   int *   ia
 The array of an INT_ARRAY_ARG.
arg2

Member Enumeration Documentation

The different types of arguments.

Enumerator:
INT_ARG  Integer argument.
VAR_ARG  Variable argument.
ARRAY_ARG  Array argument.
INT_ARRAY_ARG  Integer array argument.
STRING_ARG  String argument.
PAIR_ARG  Pair argument.
SHARED_OBJECT_ARG  Shared object argument.
SHARED_REF_ARG  Reference to shared object argument.

Definition at line 87 of file reflection.icc.


Constructor & Destructor Documentation

Gecode::Reflection::Arg::Arg ( argtype  t  )  [protected]

Constructor.

Definition at line 166 of file reflection.cc.

Gecode::Reflection::Arg::~Arg ( void   ) 

Destructor.

Definition at line 401 of file reflection.cc.


Member Function Documentation

bool Gecode::Reflection::Arg::isInt ( void   )  const

Test if this represents an integer

Definition at line 169 of file reflection.cc.

int Gecode::Reflection::Arg::toInt ( void   )  const

Return the integer that this argument represents.

Definition at line 173 of file reflection.cc.

Arg * Gecode::Reflection::Arg::newInt ( int  i  )  [static]

Create new int argument.

Definition at line 179 of file reflection.cc.

void Gecode::Reflection::Arg::initInt ( int  i  ) 

Initialize this as an int argument.

Definition at line 185 of file reflection.cc.

bool Gecode::Reflection::Arg::isVar ( void   )  const

Test if this represents a variable

Definition at line 191 of file reflection.cc.

int Gecode::Reflection::Arg::toVar ( void   )  const

Return the variable index that this argument represents.

Definition at line 195 of file reflection.cc.

Arg * Gecode::Reflection::Arg::newVar ( int  i  )  [static]

Create new variable argument.

Definition at line 201 of file reflection.cc.

void Gecode::Reflection::Arg::initVar ( int  i  ) 

Initialize this as a variable argument.

Definition at line 207 of file reflection.cc.

bool Gecode::Reflection::Arg::isArray ( void   )  const

Test if this represents an array

Definition at line 213 of file reflection.cc.

ArrayArg * Gecode::Reflection::Arg::toArray ( void   ) 

Return the array that this argument represents.

Definition at line 217 of file reflection.cc.

const ArrayArg * Gecode::Reflection::Arg::toArray ( void   )  const

Return the array that this argument represents.

Definition at line 223 of file reflection.cc.

ArrayArg * Gecode::Reflection::Arg::newArray ( int  n  )  [static]

Create new array argument with size n.

Definition at line 229 of file reflection.cc.

void Gecode::Reflection::Arg::initArray ( int  n  ) 

Initialize this as an array argument with size n.

Definition at line 239 of file reflection.cc.

bool Gecode::Reflection::Arg::isIntArray ( void   )  const

Test if this represents an array

Definition at line 246 of file reflection.cc.

IntArrayArg * Gecode::Reflection::Arg::toIntArray ( void   ) 

Return the array that this argument represents.

Definition at line 250 of file reflection.cc.

const IntArrayArg * Gecode::Reflection::Arg::toIntArray ( void   )  const

Return the array that this argument represents.

Definition at line 256 of file reflection.cc.

IntArrayArg * Gecode::Reflection::Arg::newIntArray ( int  n  )  [static]

Create new integer array argument with size n.

Definition at line 262 of file reflection.cc.

template<class A>
IntArrayArg * Gecode::Reflection::Arg::newIntArray ( const A &  a  )  [inline, static]

Create new integer array argument from array a.

Definition at line 828 of file reflection.icc.

void Gecode::Reflection::Arg::initIntArray ( int  n  ) 

Initialize this as an int array argument with size n.

Definition at line 272 of file reflection.cc.

bool Gecode::Reflection::Arg::isString ( void   )  const

Test if this represents a string

Definition at line 279 of file reflection.cc.

const char * Gecode::Reflection::Arg::toString ( void   )  const

Return the string that this argument represents.

Definition at line 283 of file reflection.cc.

Arg * Gecode::Reflection::Arg::newString ( const char *  s  )  [static]

Create new string argument.

Definition at line 294 of file reflection.cc.

void Gecode::Reflection::Arg::initString ( const char *  s  ) 

Initialize this as a string argument.

Definition at line 300 of file reflection.cc.

bool Gecode::Reflection::Arg::isPair ( void   )  const

Test if this represents a pair

Definition at line 310 of file reflection.cc.

Return the first component of the pair that this argument represents.

const Arg* Gecode::Reflection::Arg::first ( void   )  const

Return the first component of the pair that this argument represents.

Return the second component of the pair that this argument represents.

const Arg* Gecode::Reflection::Arg::second ( void   )  const

Return the second component of the pair that this argument represents.

Arg * Gecode::Reflection::Arg::newPair ( Arg a,
Arg b 
) [static]

Create new pair argument from a and b.

Definition at line 338 of file reflection.cc.

void Gecode::Reflection::Arg::initPair ( Arg a,
Arg b 
)

Initialize this as a pair argument from a and b.

Definition at line 345 of file reflection.cc.

bool Gecode::Reflection::Arg::isSharedObject ( void   )  const

Test if this represents a shared object

Definition at line 352 of file reflection.cc.

Arg * Gecode::Reflection::Arg::toSharedObject ( void   ) 

Return the shared object that this argument represents.

Definition at line 356 of file reflection.cc.

const Arg * Gecode::Reflection::Arg::toSharedObject ( void   )  const

Return the shared object that this argument represents.

Definition at line 362 of file reflection.cc.

Arg * Gecode::Reflection::Arg::newSharedObject ( Arg a  )  [static]

Create new shared object.

Definition at line 368 of file reflection.cc.

void Gecode::Reflection::Arg::initSharedObject ( Arg a  ) 

Initialize this as a shared object.

Definition at line 374 of file reflection.cc.

bool Gecode::Reflection::Arg::isSharedReference ( void   )  const

Test if this represents a shared object reference

Definition at line 380 of file reflection.cc.

int Gecode::Reflection::Arg::toSharedReference ( void   )  const

Return the shared object that this argument represents.

Definition at line 384 of file reflection.cc.

Arg * Gecode::Reflection::Arg::newSharedReference ( int  ref  )  [static]

Create new reference to shared object.

Definition at line 390 of file reflection.cc.

void Gecode::Reflection::Arg::initSharedReference ( int  ref  ) 

Initialize this as a reference to a shared object.

Definition at line 396 of file reflection.cc.


Member Data Documentation

Argument type of this Arg.

Definition at line 99 of file reflection.icc.

The integer of an INT_ARG, the index of a VAR_ARG or SHARED_REF_ARG, or the size of an ARRAY_ARG or INT_ARRAY_ARG.

Definition at line 103 of file reflection.icc.

The string of a STRING_ARG.

Definition at line 105 of file reflection.icc.

The first argument of a PAIR_ARG, or the object of a SHARED_OBJECT_ARG.

Definition at line 107 of file reflection.icc.

union { ... } Gecode::Reflection::Arg::arg1 [protected]

The second argument of a PAIR_ARG.

Definition at line 112 of file reflection.icc.

The array of an ARRAY_ARG.

Definition at line 114 of file reflection.icc.

The array of an INT_ARRAY_ARG.

Definition at line 116 of file reflection.icc.

union { ... } Gecode::Reflection::Arg::arg2 [protected]


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