---
name: "ACE_Select_Reactor_Impl"
section: "3"
platform: "linux"
package: "libace-doc"
version: "5.0.7-4"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/ACE_Select_Reactor_Impl"
---

# ACE\_Select\_Reactor\_Impl(3)

This class simply defines how Select\_Reactor's basic interface functions should look like and provides a common base class for Select\_Reactor using various locking mechanism.

## NAME

ACE\_Select\_Reactor\_Impl -  This class simply defines how Select\_Reactor's basic interface functions should look like and provides a common base class for Select\_Reactor using various locking mechanism.

## SYNOPSIS

```
#include <ace/Select_Reactor_Base.h>
class ACE_Select_Reactor_Impl : public ACE_Reactor_Impl
{
  public:
    enum{ DEFAULT_SIZE = ACE_DEFAULT_SELECT_REACTOR_SIZE };
    ACE_Select_Reactor_Impl (void);
    friend class ACE_Select_Reactor_Notify;
    friend class ACE_Select_Reactor_Handler_Repository;
  protected:
    virtual int bit_ops (
        ACE_HANDLE handle,
        ACE_Reactor_Mask mask,
        ACE_Select_Reactor_Handle_Set &wait_Set,
        int ops
        );
    virtual void renew (void) = 0;
    ACE_Select_Reactor_Handler_Repository handler_rep_;
    ACE_Select_Reactor_Handle_Set wait_set_;
    ACE_Select_Reactor_Handle_Set suspend_set_;
    ACE_Select_Reactor_Handle_Set ready_set_;
    ACE_Timer_Queue *timer_queue_;
    int delete_timer_queue_;
    ACE_Sig_Handler *signal_handler_;
    int delete_signal_handler_;
    ACE_Reactor_Notify *notify_handler_;
    int delete_notify_handler_;
    int restart_;
    int requeue_position_;
    int initialized_;
    ACE_thread_t owner_;
    int state_changed_;
    int supress_notify_renew (void);
    void supress_notify_renew (int sr);
  private:
    int supress_renew_;
    ACE_Select_Reactor_Impl (const ACE_Select_Reactor_Impl &);
    ACE_Select_Reactor_Impl &operator = (
        const ACE_Select_Reactor_Impl &
        );
};
```

## PUBLIC MEMBERS

```
ACE_Select_Reactor_Impl (void);
```

Constructor.

```
friend class ACE_Select_Reactor_Notify;
```

```
friend class ACE_Select_Reactor_Handler_Repository;
```

## PROTECTED MEMBERS

```
virtual int bit_ops (
    ACE_HANDLE handle,
    ACE_Reactor_Mask mask,
    ACE_Select_Reactor_Handle_Set &wait_Set,
    int ops
    );
```

Allow manipulation of the wait\_set\_ mask and ready\_set\_ mask.

```
virtual void renew (void) = 0;
```

Enqueue ourselves into the list of waiting threads at the appropriate point specified by requeue\_position\_.

```
ACE_Select_Reactor_Handler_Repository handler_rep_;
```

Table that maps ACE\_HANDLEs to ACE\_Event\_Handler \*'s.

```
ACE_Select_Reactor_Handle_Set wait_set_;
```

Tracks handles that are waited for by select.

```
ACE_Select_Reactor_Handle_Set suspend_set_;
```

Tracks handles that are currently suspended.

```
ACE_Select_Reactor_Handle_Set ready_set_;
```

Track HANDLES we are interested in for various events that must be dispatched \*without\* going through select.

```
ACE_Timer_Queue *timer_queue_;
```

Defined as a pointer to allow overriding by derived classes...

```
int delete_timer_queue_;
```

Keeps track of whether we should delete the timer queue (if we didn't create it, then we don't delete it).

```
ACE_Sig_Handler *signal_handler_;
```

Handle signals without requiring global/static variables.

```
int delete_signal_handler_;
```

Keeps track of whether we should delete the signal handler (if we didn't create it, then we don't delete it).

```
ACE_Reactor_Notify *notify_handler_;
```

Callback object that unblocks the ACE\_Select\_Reactor if it's sleeping.

```
int delete_notify_handler_;
```

Keeps track of whether we need to delete the notify handler (if we didn't create it, then we don't delete it).

```
int restart_;
```

Restart the handle\_events event-loop method automatically when select is interrupted via EINTR.

```
int requeue_position_;
```

Position that the main ACE\_Select\_Reactor thread is requeued in the list of waiters during a notify callback.  If this value == -1 we are requeued at the end of the list.  Else if it's 0 then we are requeued at the front of the list.  Else if it's  1 then that indicates the number of waiters to skip over.

```
int initialized_;
```

True if we've been initialized yet...

```
ACE_thread_t owner_;
```

The original thread that created this Select\_Reactor.

```
int state_changed_;
```

True if state has changed during dispatching of ACE\_Event\_Handlers, else false.  This is used to determine whether we need to make another trip through the Select\_Reactor's wait\_for\_multiple\_events loop.

```
int supress_notify_renew (void);
```

```
void supress_notify_renew (int sr);
```

Controls/access whether the notify handler should renew the Select\_Reactor's token or not.

## PRIVATE MEMBERS

```
int supress_renew_;
```

Determine whether we should renew Select\_Reactor's token after handling the notification message.

```
ACE_Select_Reactor_Impl (const ACE_Select_Reactor_Impl &);
```

```
ACE_Select_Reactor_Impl &operator = (const ACE_Select_Reactor_Impl &);
```

Deny access since member-wise won't work...

## AUTHOR

Doug Schmidt

## LIBRARY

ace
