Gecode::Reflection::Arg Class Reference
[Reflection API]
Inherited by Gecode::Reflection::ArrayArg, and Gecode::Reflection::IntArrayArg.
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 | |
| ArrayArg * | toArray (void) |
| Return the array that this argument represents. | |
| const ArrayArg * | toArray (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 | |
| IntArrayArg * | toIntArray (void) |
| Return the array that this argument represents. | |
| const IntArrayArg * | toIntArray (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 | |
| Arg * | first (void) |
| Return the first component of the pair that this argument represents. | |
| const Arg * | first (void) const |
| Return the first component of the pair that this argument represents. | |
| Arg * | second (void) |
| Return the second component of the pair that this argument represents. | |
| const Arg * | second (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 | |
| Arg * | toSharedObject (void) |
| Return the shared object that this argument represents. | |
| const Arg * | toSharedObject (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 Arg * | newInt (int i) |
| Create new int argument. | |
| static Arg * | newVar (int i) |
| Create new variable argument. | |
| static ArrayArg * | newArray (int n) |
| Create new array argument with size n. | |
| static IntArrayArg * | newIntArray (int n) |
| Create new integer array argument with size n. | |
| template<class A> | |
| static IntArrayArg * | newIntArray (const A &a) |
| Create new integer array argument from array a. | |
| static Arg * | newString (const char *s) |
| Create new string argument. | |
| static Arg * | newPair (Arg *a, Arg *b) |
| Create new pair argument from a and b. | |
| static Arg * | newSharedObject (Arg *a) |
| Create new shared object. | |
| static Arg * | newSharedReference (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
enum Gecode::Reflection::Arg::argtype [protected] |
The different types of arguments.
- Enumerator:
Definition at line 87 of file reflection.icc.
Constructor & Destructor Documentation
| Gecode::Reflection::Arg::Arg | ( | argtype | t | ) | [protected] |
| Gecode::Reflection::Arg::~Arg | ( | void | ) |
Member Function Documentation
| bool Gecode::Reflection::Arg::isInt | ( | void | ) | const |
| int Gecode::Reflection::Arg::toInt | ( | void | ) | const |
| Arg * Gecode::Reflection::Arg::newInt | ( | int | i | ) | [static] |
| void Gecode::Reflection::Arg::initInt | ( | int | i | ) |
| bool Gecode::Reflection::Arg::isVar | ( | void | ) | const |
| 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] |
| void Gecode::Reflection::Arg::initVar | ( | int | i | ) |
| bool Gecode::Reflection::Arg::isArray | ( | void | ) | const |
| ArrayArg * Gecode::Reflection::Arg::toArray | ( | void | ) |
| const ArrayArg * Gecode::Reflection::Arg::toArray | ( | void | ) | const |
| ArrayArg * Gecode::Reflection::Arg::newArray | ( | int | n | ) | [static] |
| void Gecode::Reflection::Arg::initArray | ( | int | n | ) |
| bool Gecode::Reflection::Arg::isIntArray | ( | void | ) | const |
| IntArrayArg * Gecode::Reflection::Arg::toIntArray | ( | void | ) |
| const IntArrayArg * Gecode::Reflection::Arg::toIntArray | ( | void | ) | const |
| IntArrayArg * Gecode::Reflection::Arg::newIntArray | ( | int | n | ) | [static] |
| IntArrayArg * Gecode::Reflection::Arg::newIntArray | ( | const A & | a | ) | [inline, static] |
| void Gecode::Reflection::Arg::initIntArray | ( | int | n | ) |
| bool Gecode::Reflection::Arg::isString | ( | void | ) | const |
| const char * Gecode::Reflection::Arg::toString | ( | void | ) | const |
| Arg * Gecode::Reflection::Arg::newString | ( | const char * | s | ) | [static] |
| void Gecode::Reflection::Arg::initString | ( | const char * | s | ) |
| bool Gecode::Reflection::Arg::isPair | ( | void | ) | const |
| Arg* Gecode::Reflection::Arg::first | ( | void | ) |
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.
| Arg* Gecode::Reflection::Arg::second | ( | void | ) |
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.
| bool Gecode::Reflection::Arg::isSharedObject | ( | void | ) | const |
| 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.
| void Gecode::Reflection::Arg::initSharedObject | ( | Arg * | a | ) |
| bool Gecode::Reflection::Arg::isSharedReference | ( | void | ) | const |
| 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] |
| void Gecode::Reflection::Arg::initSharedReference | ( | int | ref | ) |
Member Data Documentation
argtype Gecode::Reflection::Arg::t [protected] |
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.
| const Arg * Gecode::Reflection::Arg::first |
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] |
| const Arg * Gecode::Reflection::Arg::second |
union { ... } Gecode::Reflection::Arg::arg2 [protected] |
The documentation for this class was generated from the following files:
- gecode/kernel/reflection.icc (Revision: 7297)
- gecode/kernel/reflection.cc (Revision: 7297)
