## NAME

ACE_Creation_Strategy - Defines the interface for specifying a creation strategy for a SVC_HANDLER.

## SYNOPSIS

    #include <ace/ACE_Strategies_T.h>

    template<class SVC_HANDLER>
    class ACE_Creation_Strategy
    {
      public:
        ACE_Creation_Strategy (ACE_Thread_Manager * = 0);
        int open (ACE_Thread_Manager * = 0);
        virtual ~ACE_Creation_Strategy (void);
        virtual int make_svc_handler (SVC_HANDLER *&sh);
        void dump (void) const;
        ACE_ALLOC_HOOK_DECLARE;
      protected:
        ACE_Thread_Manager *thr_mgr_;
    };

## DESCRIPTION

The default behavior is to make a new SVC_HANDLER. However, subclasses can override this strategy to perform SVC_HANDLER creation in any way that they like (such as creating subclass instances of SVC_HANDLER, using a singleton, dynamically linking the handler, etc.).

## Initialization and termination methods.

    ACE_Creation_Strategy (ACE_Thread_Manager * = 0);

Default constructor.

    int open (ACE_Thread_Manager * = 0);

A `Thread_Manager` is useful when creating active objects.

    virtual ~ACE_Creation_Strategy (void);

## Factory method.

    virtual int make_svc_handler (SVC_HANDLER *&sh);

Create a SVC_HANDLER with the appropriate creation strategy. The default behavior of this method is to make a new `SVC_HANDLER` if `sh` == 0 (passing in the `Thread_Manager`), else `sh` is unchanged. 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.

## AUTHOR

Doug Schmidt

## LIBRARY

ace