Gecode::Kernel::FunctionBranch Class Reference

Brancher for calling a function More...

## Classes

class | Description
| Minimal brancher description storing no information. More...

## Public Member Functions

virtual bool | status (const Space &home) const
| Check status of brancher, return true if alternatives left.
virtual const Choice * | choice (Space &home)
| Return choice.
virtual const Choice * | choice (const Space &home, Archive &a)
| Return choice.
virtual ExecStatus | commit (Space &home, const Choice &ch, unsigned int a)
| Perform commit.
virtual void | print (const Space &, const Choice &, unsigned int, std::ostream &o) const
| Print explanation.
virtual Actor * | copy (Space &home)
| Copy brancher.
virtual size_t | dispose (Space &home)
| Dispose brancher.
virtual NGL * | ngl (Space &home, const Choice &c, unsigned int a) const
| Create no-good literal for choice c and alternative a.
unsigned int | id (void) const
| Return brancher id.
BrancherGroup | group (void) const
| Return group brancher belongs to.
void | group (BrancherGroup g)
| Add brancher to group g.
virtual | ~Actor (void)
| To avoid warnings.

## Static Public Member Functions

static void | post (Home home, std::function< void(Space &home)> f)
| Post brancher.
static void * | operator new (size_t s, Space &home)
| Allocate memory from space.
static void | operator delete (void *p, Space &home)
| No-op for exceptions.
static void * | operator new (size_t s)
| Not used.
static void | operator delete (void *p)
| Not used.

## Protected Member Functions

| FunctionBranch (Home home, std::function< void(Space &home)> f0)
| Construct brancher.
| FunctionBranch (Space &home, FunctionBranch &b)
| Copy constructor.
Protected Member Functions inherited from Gecode::Brancher
| Brancher (Home home)
| Constructor for creation.
| Brancher (Space &home, Brancher &b)
| Constructor for cloning b.

## Protected Attributes

SharedData< std::function< void(Space &home)> > | f
| Function to call.
bool | done
| Call function just once.

## Detailed Description

Brancher for calling a function

Definition at line 41 of file function.cpp.

## Constructor & Destructor Documentation

## FunctionBranch() [1/2]

Gecode::Kernel::FunctionBranch::FunctionBranch | ( | Home | home,
|  | std::function< void(Space &home)> | f0 )

inline protected

Construct brancher.

Definition at line 88 of file function.cpp.

## FunctionBranch() [2/2]

Gecode::Kernel::FunctionBranch::FunctionBranch | ( | Space & | home,
|  | FunctionBranch & | b )

inline protected

Copy constructor.

Definition at line 96 of file function.cpp.

## Member Function Documentation

## status()

bool Gecode::Kernel::FunctionBranch::status | ( | const Space & | home | ) | const

virtual

Check status of brancher, return true if alternatives left.

Implements Gecode::Brancher.

Definition at line 100 of file function.cpp.

## choice() [1/2]

const Choice * Gecode::Kernel::FunctionBranch::choice | ( | Space & | home | ) |

virtual

Return choice.

Implements Gecode::Brancher.

Definition at line 104 of file function.cpp.

## choice() [2/2]

const Choice * Gecode::Kernel::FunctionBranch::choice | ( | const Space & | home,
|  | Archive & | a )

virtual

Return choice.

Implements Gecode::Brancher.

Definition at line 109 of file function.cpp.

## commit()

ExecStatus Gecode::Kernel::FunctionBranch::commit | ( | Space & | home,
|  | const Choice & | ch,
|  | unsigned int | a )

virtual

Perform commit.

Implements Gecode::Brancher.

Definition at line 113 of file function.cpp.

## print()

void Gecode::Kernel::FunctionBranch::print | ( | const Space & | ,
|  | const Choice & | ,
|  | unsigned int | ,
|  | std::ostream & | o ) const

virtual

Print explanation.

Reimplemented from Gecode::Brancher.

Definition at line 120 of file function.cpp.

## copy()

Actor * Gecode::Kernel::FunctionBranch::copy | ( | Space & | home | ) |

virtual

Copy brancher.

Implements Gecode::Actor.

Definition at line 125 of file function.cpp.

## post()

void Gecode::Kernel::FunctionBranch::post | ( | Home | home,
|  | std::function< void(Space &home)> | f )

inline static

Post brancher.

Definition at line 129 of file function.cpp.

## dispose()

size_t Gecode::Kernel::FunctionBranch::dispose | ( | Space & | home | ) |

virtual

Dispose brancher.

Reimplemented from Gecode::Actor.

Definition at line 135 of file function.cpp.

## Member Data Documentation

## f

SharedData<std::function<void(Space& home)> > Gecode::Kernel::FunctionBranch::f

protected

Function to call.

Definition at line 52 of file function.cpp.

## done

bool Gecode::Kernel::FunctionBranch::done

protected

Call function just once.

Definition at line 54 of file function.cpp.

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

- gecode/kernel/branch/function.cpp