Gecode::Support::Runnable Class Referenceabstract
Common functionality » Support algorithms and datastructures » Simple thread and synchronization support

An interface for objects that can be run by a thread. More...

`#include <thread.hpp>`

## Public Member Functions

| Runnable (bool d=true)
| Initialize, d defines whether object is deleted when terminated.
void | todelete (bool d)
| Set whether to delete upon termination.
bool | todelete (void) const
| Return whether to be deleted upon termination.
virtual Terminator * | terminator (void) const
| Return terminator object.
virtual void | run (void)=0
| The function that is executed when the thread starts.
virtual | ~Runnable (void)
| Destructor.

## Static Public Member Functions

static void * | operator new (size_t s)
| Allocate memory from heap.
static void | operator delete (void *p)
| Free memory allocated from heap.

## Detailed Description

An interface for objects that can be run by a thread.

Definition at line 264 of file thread.hpp.

## Constructor & Destructor Documentation

## Runnable()

Gecode::Support::Runnable::Runnable | ( | bool | d = true | ) |

inline

Initialize, d defines whether object is deleted when terminated.

Definition at line 40 of file thread.hpp.

## ~Runnable()

virtual Gecode::Support::Runnable::~Runnable | ( | void |  | ) |

inline virtual

Destructor.

Definition at line 280 of file thread.hpp.

## Member Function Documentation

## todelete() [1/2]

void Gecode::Support::Runnable::todelete | ( | bool | d | ) |

inline

Set whether to delete upon termination.

Definition at line 43 of file thread.hpp.

## todelete() [2/2]

bool Gecode::Support::Runnable::todelete | ( | void |  | ) | const

inline

Return whether to be deleted upon termination.

Definition at line 47 of file thread.hpp.

## terminator()

virtual Terminator * Gecode::Support::Runnable::terminator | ( | void |  | ) | const

inline virtual

Return terminator object.

Reimplemented in Gecode::Search::Par::Engine< Tracer >::Worker.

Definition at line 276 of file thread.hpp.

## run()

virtual void Gecode::Support::Runnable::run | ( | void |  | ) |

pure virtual

The function that is executed when the thread starts.

Implemented in Gecode::Search::Par::BAB< Tracer >::Worker, Gecode::Search::Par::DFS< Tracer >::Worker, Gecode::Search::Par::Slave< Collect >, Gecode::Search::Par::Slave< Gecode::Search::Par::CollectBest >, Gecode::Support::RunJobs< Jobs, RetType >::Deleter, and Gecode::Support::RunJobs< Jobs, RetType >::Worker.

## operator new()

void * Gecode::Support::Runnable::operator new | ( | size_t | s | ) |

inline static

Allocate memory from heap.

Definition at line 55 of file thread.hpp.

## operator delete()

void Gecode::Support::Runnable::operator delete | ( | void * | p | ) |

inline static

Free memory allocated from heap.

Definition at line 51 of file thread.hpp.

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

- gecode/support/thread.hpp
- gecode/support/thread/thread.hpp