# Poco

# template < class TObj, class TArgs, bool useSender = true >

# class PriorityDelegate

Library: Foundation
Package: Events
Header: Poco/PriorityDelegate.h

## Description

Wraps a member function for use as a PriorityDelegate. Use useSender=true for callbacks that take sender as first parameter.

## Inheritance

Direct Base Classes: AbstractPriorityDelegate < TArgs >

All Base Classes: AbstractPriorityDelegate < TArgs >

## Member Summary

Member Functions: clone, disable, equals, notify, operator =

## Types Aliases

### NotifyMethod

using NotifyMethod = std::conditional_t < useSender, void (TObj::*)(const void *, TArgs &), void (TObj::*)(TArgs &)>;

## Constructors

### PriorityDelegate

PriorityDelegate() = delete;

### PriorityDelegate

PriorityDelegate(
const PriorityDelegate & delegate
);

### PriorityDelegate

PriorityDelegate(
TObj * obj,
NotifyMethod method,
int prio
);

## Destructor

### ~PriorityDelegate

~PriorityDelegate() = default;

## Member Functions

### clone

AbstractDelegate < TArgs > * clone() const;

### disable

void disable();

### equals

bool equals(
const AbstractDelegate < TArgs > & other
) const;

### notify

bool notify(
const void * sender,
TArgs & arguments
);

### operator =

PriorityDelegate & operator = (
const PriorityDelegate & delegate
);

## Variables

### _mutex

Mutex _mutex;

### _receiverMethod

NotifyMethod _receiverMethod;

### _receiverObject

TObj * _receiverObject;