#include <Service_Repository.h>
Collaboration diagram for ACE_Service_Repository:
Public Types | |
DEFAULT_SIZE = ACE_DEFAULT_SERVICE_REPOSITORY_SIZE | |
enum | { DEFAULT_SIZE = ACE_DEFAULT_SERVICE_REPOSITORY_SIZE } |
Public Member Functions | |
ACE_Service_Repository (void) | |
Initialize the repository. | |
ACE_Service_Repository (size_t size) | |
Initialize the repository. | |
int | open (size_t size=DEFAULT_SIZE) |
Initialize the repository. | |
~ACE_Service_Repository (void) | |
int | close (void) |
int | fini (void) |
int | insert (const ACE_Service_Type *) |
int | find (const ACE_TCHAR name[], const ACE_Service_Type **srp=0, int ignore_suspended=1) const |
int | remove (const ACE_TCHAR[], ACE_Service_Type **sr=0) |
Completely remove a <name> entry from the Repository and dynamically unlink it if it was originally dynamically linked. | |
int | resume (const ACE_TCHAR[], const ACE_Service_Type **=0) |
Resume a service record. | |
int | suspend (const ACE_TCHAR[], const ACE_Service_Type **=0) |
Suspend a service record. | |
size_t | current_size (void) const |
Return the current size of the repository. | |
size_t | total_size (void) const |
Return the total size of the repository. | |
void | dump (void) const |
Dump the state of an object. | |
Static Public Member Functions | |
static ACE_Service_Repository * | instance (size_t size=ACE_Service_Repository::DEFAULT_SIZE) |
Get pointer to a process-wide ACE_Service_Repository. | |
static ACE_Service_Repository * | instance (ACE_Service_Repository *) |
static void | close_singleton (void) |
Delete the dynamically allocated Singleton. | |
Public Attributes | |
ACE_ALLOC_HOOK_DECLARE | |
Declare the dynamic allocation hooks. | |
Private Member Functions | |
int | find_i (const ACE_TCHAR service_name[], const ACE_Service_Type **=0, int ignore_suspended=1) const |
Private Attributes | |
const ACE_Service_Type ** | service_vector_ |
Contains all the configured services. | |
size_t | current_size_ |
Current number of services. | |
size_t | total_size_ |
Maximum number of services. | |
Static Private Attributes | |
static ACE_Service_Repository * | svc_rep_ = 0 |
Pointer to a process-wide ACE_Service_Repository. | |
static int | delete_svc_rep_ = 0 |
Must delete the <svc_rep_> if non-0. | |
Friends | |
class | ACE_Service_Repository_Iterator |
This class contains a vector of <ACE_Service_Types> *'s and allows an administrative entity to centrally manage and control the behavior of application services. Note that if services are removed from the middle of the repository the order won't necessarily be maintained since the <remove> method performs compaction. However, the common case is not to remove services, so typically they are deleted in the reverse order that they were added originally.
ACE_Service_Repository::ACE_Service_Repository | ( | void | ) |
Initialize the repository.
ACE_Service_Repository::ACE_Service_Repository | ( | size_t | size | ) |
Initialize the repository.
ACE_Service_Repository::~ACE_Service_Repository | ( | void | ) |
Close down the repository and free up dynamically allocated resources.
int ACE_Service_Repository::close | ( | void | ) |
Close down the repository and free up dynamically allocated resources.
void ACE_Service_Repository::close_singleton | ( | void | ) | [static] |
Delete the dynamically allocated Singleton.
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE size_t ACE_Service_Repository::current_size | ( | void | ) | const |
Return the current size of the repository.
void ACE_Service_Repository::dump | ( | void | ) | const |
Dump the state of an object.
int ACE_Service_Repository::find | ( | const ACE_TCHAR | name[], | |
const ACE_Service_Type ** | srp = 0 , |
|||
int | ignore_suspended = 1 | |||
) | const |
Locate an entry with <name> in the table. If <ignore_suspended> is set then only consider services marked as resumed. If the caller wants the located entry, pass back a pointer to the located entry via <srp>. If <name> is not found, -1 is returned. If <name> is found, but it is suspended and the caller wants to ignore suspended services a -2 is returned.
int ACE_Service_Repository::find_i | ( | const ACE_TCHAR | service_name[], | |
const ACE_Service_Type ** | = 0 , |
|||
int | ignore_suspended = 1 | |||
) | const [private] |
Locates <service_name>. Must be called without locks being held...
int ACE_Service_Repository::fini | ( | void | ) |
Finalize all the services by calling <fini> and deleting dynamically allocated services.
int ACE_Service_Repository::insert | ( | const ACE_Service_Type * | ) |
Insert a new service record. Returns -1 when the service repository is full and 0 on success.
ACE_Service_Repository * ACE_Service_Repository::instance | ( | ACE_Service_Repository * | ) | [static] |
Set pointer to a process-wide ACE_Service_Repository and return existing pointer.
ACE_Service_Repository * ACE_Service_Repository::instance | ( | size_t | size = ACE_Service_Repository::DEFAULT_SIZE |
) | [static] |
Get pointer to a process-wide ACE_Service_Repository.
int ACE_Service_Repository::open | ( | size_t | size = DEFAULT_SIZE |
) |
Initialize the repository.
int ACE_Service_Repository::remove | ( | const | ACE_TCHAR[], | |
ACE_Service_Type ** | sr = 0 | |||
) |
Completely remove a <name> entry from the Repository and dynamically unlink it if it was originally dynamically linked.
Remove an existing service record. If sr == 0, the service record is deleted before control is returned to the caller. If sr != 0, the service's record is removed from the repository, but not deleted; sr receives the service record pointer and the caller is responsible for properly disposing of it.
int ACE_Service_Repository::resume | ( | const | ACE_TCHAR[], | |
const ACE_Service_Type ** | = 0 | |||
) |
Resume a service record.
int ACE_Service_Repository::suspend | ( | const | ACE_TCHAR[], | |
const ACE_Service_Type ** | = 0 | |||
) |
Suspend a service record.
ACE_INLINE size_t ACE_Service_Repository::total_size | ( | void | ) | const |
Return the total size of the repository.
friend class ACE_Service_Repository_Iterator [friend] |
Declare the dynamic allocation hooks.
size_t ACE_Service_Repository::current_size_ [private] |
Current number of services.
int ACE_Service_Repository::delete_svc_rep_ = 0 [static, private] |
Must delete the <svc_rep_> if non-0.
const ACE_Service_Type** ACE_Service_Repository::service_vector_ [private] |
Contains all the configured services.
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_Service_Repository * ACE_Service_Repository::svc_rep_ = 0 [static, private] |
Pointer to a process-wide ACE_Service_Repository.
size_t ACE_Service_Repository::total_size_ [private] |
Maximum number of services.