ACE_Singleton_Strategy(3)

ACE_Singleton_Strategy3

Defines the interface for specifying a creation strategy for a svc_handler that always returns the same svc_handler (i.e., it's a singleton).

Usage

#include <ace/ACE_Strategies_T.h>
template<class SVC_HANDLER>
class ACE_Singleton_Strategy : 
  public ACE_Creation_Strategy<SVC_HANDLER>
{
  public:
    ACE_Singleton_Strategy (
        SVC_HANDLER * = 0,
        ACE_Thread_Manager * = 0
        );
    int open (SVC_HANDLER *, ACE_Thread_Manager * = 0);
    virtual ~ACE_Singleton_Strategy (void);
    virtual int make_svc_handler (SVC_HANDLER *&);
    void dump (void) const;
    ACE_ALLOC_HOOK_DECLARE;
  protected:
    SVC_HANDLER *svc_handler_;
    int delete_svc_handler_;
};

Overview

Note that this class takes over the ownership of the SVC_HANDLER passed into it as a parameter and it becomes responsible for deleting this object.

Initialization and termination methods.

ACE_Singleton_Strategy (SVC_HANDLER * = 0, ACE_Thread_Manager * = 0);
int open (SVC_HANDLER *, ACE_Thread_Manager * = 0);
virtual ~ACE_Singleton_Strategy (void);

Factory method.

virtual int make_svc_handler (SVC_HANDLER *&);

Create a Singleton SVC_HANDLER by always returning the same SVC_HANDLER. Returns -1 on failure, else 0.

void dump (void) const;

Dump the state of an object.

ACE_ALLOC_HOOK_DECLARE;

Declare the dynamic allocation hooks.

Library

ace

Author

Doug Schmidt

From libace-doc 5.0.7-4 in Debian 2.2 (Potato). Parsed by carta from the page's man source.