NAME
ACE_Service_Repository -
Provide the abstract base class that supplies common server
repository operations.
SYNOPSIS
#include <ace/Service_Repository.h>
class ACE_Service_Repository
{
public:
enum {DEFAULT_SIZE = 50};
ACE_Service_Repository (void);
ACE_Service_Repository (int size);
int open (int size = DEFAULT_SIZE);
~ACE_Service_Repository (void);
int close (void);
int insert (const ACE_Service_Record *);
int find (
const char[],
const ACE_Service_Record ** = 0,
int ignore_suspended = 1
);
int remove (const char[]);
int resume (const char[], const ACE_Service_Record ** = 0);
int suspend (const char[], const ACE_Service_Record ** = 0);
int current_size (void);
int total_size (void);
void dump (void) const;
ACE_ALLOC_HOOK_DECLARE;
private:
int find_i (
const char service_name[],
const ACE_Service_Record ** = 0,
int ignore_suspended = 1
);
const ACE_Service_Record **service_vector_;
int current_size_;
int total_size_;
ACE_Thread_Mutex lock_;
friend class ACE_Service_Repository_Iterator;
};
Search structure operations (all acquire locks as necessary).
int insert (const ACE_Service_Record *);
Insert a new service record.
int find (
const char[],
const ACE_Service_Record ** = 0,
int ignore_suspended = 1
);
Locate an existing service record.
int remove (const char[]);
Remove an existing service record.
Liveness control
int resume (const char[], const ACE_Service_Record ** = 0);
int suspend (const char[], const ACE_Service_Record ** = 0);
Suspend a service record.
int current_size (void);
Return the current size of the repository.
int total_size (void);
Return the total size of the repository.
void dump (void) const;
Dump the state of an object.
ACE_ALLOC_HOOK_DECLARE;
Declare the dynamic allocation hooks.
AUTHOR
Doug Schmidt
LIBRARY
ace