FRAMES NO FRAMES

Macro ILCANYPREDICATE0

Definition file: ilsolver/ilcany.h
ILCANYPREDICATE0(name)
ILCANYPREDICATE1(name, type1, nameArg1)
ILCANYPREDICATE2(name, type1, nameArg1, type2, nameArg2)
ILCANYPREDICATE3(name, type1, nameArg1, type2, nameArg2, type3, nameArg3)
ILCANYPREDICATE4(name, type1, nameArg1, type2, nameArg2, type3, nameArg3, type4, nameArg4)
ILCANYPREDICATE5(name, type1, nameArg1, type2, nameArg2, type3, nameArg3, type4, nameArg4, type5, nameArg5)
ILCANYPREDICATE6(name, type1, nameArg1, type2, nameArg2, type3, nameArg3, type4, nameArg4, type5, nameArg5, type6, nameArg6)

This macro defines a predicate class named nameI with n data members. When n is greater than 0, the types and names of the data members must be supplied as arguments to the macro. Each data member is defined by its type Ti and a name datai. The call to the macro must be followed immediately by the body of the isTrue member function of the predicate class being defined. Besides the definition of the class nameI, this macro also defines a function named name that creates an instance of the class nameI and that returns an instance of the class IlcAnyPredicate that points to it.

Solver does not check the arity of the predicate that you defined. It assumes that the size of the array (an instance of IlcAnyArray) passed as an argument to the member function IlcAnyPredicate::isTrue will always be the same. It also assumes that the name of the array passed as an argument is val. That is, you must use that name to define a predicate.

You are not obliged to use this macro to define predicates on arbitrary objects. When the macro seems too restrictive for your purposes, we recommend that you define a predicate class directly by subclassing IlcAnyPredicateI.

Since the argument name is used to name the predicate class, it is not possible to use the same name for several predicate definitions.

For an example of how to use a similar macro, see the macro ILCINTPREDICATE0.

See Also: