*Backed out changeset 3be01fb200a5
--HG-- branch : trunk
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
// -*- C++ -*-
|
||||
|
||||
//=============================================================================
|
||||
/**
|
||||
* @file Handle_Gobbler.h
|
||||
@@ -10,14 +11,19 @@
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
|
||||
#ifndef ACE_HANDLE_GOBBLER_H
|
||||
#define ACE_HANDLE_GOBBLER_H
|
||||
#include /**/ "ace/pre.h"
|
||||
|
||||
#include "ace/Handle_Set.h"
|
||||
|
||||
#if !defined (ACE_LACKS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif /* ACE_LACKS_PRAGMA_ONCE */
|
||||
|
||||
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
|
||||
|
||||
/**
|
||||
* @class ACE_Handle_Gobbler
|
||||
*
|
||||
@@ -30,25 +36,34 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
|
||||
class ACE_Handle_Gobbler
|
||||
{
|
||||
public:
|
||||
|
||||
/// Destructor. Cleans up any remaining handles.
|
||||
inline ~ACE_Handle_Gobbler (void);
|
||||
|
||||
/**
|
||||
* Handles are opened continously until the process runs out of
|
||||
* them, and then <n_handles_to_keep_available> handles are closed
|
||||
* (freed) thereby making them usable in the future.
|
||||
*/
|
||||
inline int consume_handles (size_t n_handles_to_keep_available);
|
||||
|
||||
/// Free up @a n_handles.
|
||||
inline int free_handles (size_t n_handles);
|
||||
|
||||
/// All remaining handles are closed.
|
||||
inline void close_remaining_handles (void);
|
||||
|
||||
private:
|
||||
typedef ACE_Handle_Set HANDLE_SET;
|
||||
|
||||
/// The container which holds the open descriptors.
|
||||
HANDLE_SET handle_set_;
|
||||
};
|
||||
|
||||
ACE_END_VERSIONED_NAMESPACE_DECL
|
||||
|
||||
#include "ace/Handle_Gobbler.inl"
|
||||
|
||||
#include /**/ "ace/post.h"
|
||||
#endif /* ACE_HANDLE_GOBBLER_H */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user