# Poco

# template < class C >

# class RunnableAdapter

Library: Foundation
Package: Threading
Header: Poco/RunnableAdapter.h

## Description

This adapter simplifies using ordinary methods as targets for threads. Usage:

    RunnableAdapter<MyClass> ra(myObject, &MyObject::doSomething));
    Thread thr;
    thr.start(ra);

For using a freestanding or static member function as a thread target, please see the ThreadTarget class.

## Inheritance

Direct Base Classes: Runnable

All Base Classes: Runnable

## Member Summary

Member Functions: operator =, run

Inherited Functions: run

## Types Aliases

### Callback

using Callback = void (C::*)();

## Constructors

### RunnableAdapter

RunnableAdapter() = delete;

### RunnableAdapter

RunnableAdapter(
const RunnableAdapter & ra
);

### RunnableAdapter

RunnableAdapter(
C & object,
Callback method
);

## Destructor

### ~RunnableAdapter

~RunnableAdapter() override = default;

## Member Functions

### operator =

RunnableAdapter & operator = (
const RunnableAdapter & ra
);

### run

void run() override;

See also: Poco::Runnable::run()