---
name: "ACE_Select_Reactor_Handler_Repository"
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_Handler_Repository"
---

# ACE\_Select\_Reactor\_Handler\_Repository(3)

Used to map ACE\_HANDLEs onto the appropriate ACE\_Event\_Handler \*.

## NAME

ACE\_Select\_Reactor\_Handler\_Repository -  Used to map ACE\_HANDLEs onto the appropriate ACE\_Event\_Handler \*.

## SYNOPSIS

```
#include <ace/Select_Reactor_Base.h>
class ACE_Select_Reactor_Handler_Repository
{
  public:
    friend class ACE_Select_Reactor_Handler_Repository_Iterator;
    ACE_Select_Reactor_Handler_Repository (ACE_Select_Reactor_Impl &);
    ~ACE_Select_Reactor_Handler_Repository (void);
    int open (size_t size);
    int close (void);
    ACE_Event_Handler *find (ACE_HANDLE handle, size_t *index_p = 0);
    int bind (ACE_HANDLE, ACE_Event_Handler *, ACE_Reactor_Mask);
    int unbind (ACE_HANDLE, ACE_Reactor_Mask mask);
    int unbind_all (void);
    int invalid_handle (ACE_HANDLE handle);
    int handle_in_range (ACE_HANDLE handle);
    size_t size (void);
    size_t max_handlep1 (void);
    void dump (void) const;
    ACE_ALLOC_HOOK_DECLARE;
  private:
    ACE_Select_Reactor_Impl &select_reactor_;
    ssize_t max_size_;
    int max_handlep1_;
    ACE_Event_Tuple *event_handlers_;
    ACE_Event_Handler **event_handlers_;
};
```

## DESCRIPTION

This class is necessary to shield differences between UNIX and Win32.  In UNIX, ACE\_HANDLE is an int, whereas in Win32 it's a void \*.  This class hides all these details from the bulk of the ACE\_Select\_Reactor code.  All of these methods are called with the main Select\_Reactor token lock held.

## Initialization and termination methods.

```
ACE_Select_Reactor_Handler_Repository (ACE_Select_Reactor_Impl &);
```

Default "do-nothing" constructor.

```
~ACE_Select_Reactor_Handler_Repository (void);
```

dtor.

```
int open (size_t size);
```

Initialize a repository of the appropriate size.

```
int close (void);
```

Close down the repository.

## Search structure operations.

```
ACE_Event_Handler *find (ACE_HANDLE handle, size_t *index_p = 0);
```

Return the ACE\_Event\_Handler \* associated with ACE\_HANDLE. If index\_p is non-0, then return the index location of the handle, if found.

```
int bind (ACE_HANDLE, ACE_Event_Handler *, ACE_Reactor_Mask);
```

Bind the ACE\_Event\_Handler \* to the ACE\_HANDLE with the appropriate ACE\_Reactor\_Mask settings.

```
int unbind (ACE_HANDLE, ACE_Reactor_Mask mask);
```

Remove the binding of ACE\_HANDLE in accordance with the mask.

```
int unbind_all (void);
```

Remove all the ACE\_HANDLE, ACE\_Event\_Handler tuples.

## Sanity checking.

Check the handle to make sure it's a valid ACE\_HANDLE that within the range of legal handles (i.e., = 0 &&  max\_size\_).

```
int invalid_handle (ACE_HANDLE handle);
```

Check the handle to make sure it's a valid ACE\_HANDLE that within the range of currently registered handles (i.e., = 0 &&  max\_handlep1\_).

```
int handle_in_range (ACE_HANDLE handle);
```

## Accessors.

```
size_t size (void);
```

Returns the current table size.

```
size_t max_handlep1 (void);
```

Maximum ACE\_HANDLE value, plus 1.

```
void dump (void) const;
```

Dump the state of an object.

```
ACE_ALLOC_HOOK_DECLARE;
```

Declare the dynamic allocation hooks.

## AUTHOR

Doug Schmidt

## LIBRARY

ace
