IdUniquenessStrategyUniqueFactoryImpl.cpp

Go to the documentation of this file.
00001 // $Id: IdUniquenessStrategyUniqueFactoryImpl.cpp 76551 2007-01-24 13:42:44Z johnnyw $
00002 
00003 #include "tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.h"
00004 #include "tao/PortableServer/IdUniquenessStrategyUnique.h"
00005 #include "ace/Dynamic_Service.h"
00006 
00007 ACE_RCSID (PortableServer,
00008            IdUniquenessStrategyUniqueFactoryImpl,
00009            "$Id: IdUniquenessStrategyUniqueFactoryImpl.cpp 76551 2007-01-24 13:42:44Z johnnyw $")
00010 
00011 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00012 
00013 namespace TAO
00014 {
00015   namespace Portable_Server
00016   {
00017     IdUniquenessStrategy*
00018     IdUniquenessStrategyUniqueFactoryImpl::create (
00019       ::PortableServer::IdUniquenessPolicyValue value)
00020     {
00021       IdUniquenessStrategy* strategy = 0;
00022 
00023       switch (value)
00024       {
00025         case ::PortableServer::UNIQUE_ID :
00026         {
00027           ACE_NEW_RETURN (strategy, IdUniquenessStrategyUnique, 0);
00028           break;
00029         }
00030         case ::PortableServer::MULTIPLE_ID :
00031         {
00032           ACE_ERROR ((LM_ERROR, "Incorrect type in IdUniquenessStrategyUniqueFactoryImpl"));
00033           break;
00034         }
00035       }
00036 
00037       return strategy;
00038     }
00039 
00040     void
00041     IdUniquenessStrategyUniqueFactoryImpl::destroy (
00042       IdUniquenessStrategy *strategy
00043       )
00044     {
00045       strategy->strategy_cleanup ();
00046 
00047       delete strategy;
00048     }
00049 
00050   }
00051 }
00052 
00053 TAO_END_VERSIONED_NAMESPACE_DECL
00054 
00055 ACE_STATIC_SVC_DEFINE (
00056   IdUniquenessStrategyUniqueFactoryImpl,
00057   ACE_TEXT ("IdUniquenessStrategyUniqueFactory"),
00058   ACE_SVC_OBJ_T,
00059   &ACE_SVC_NAME (IdUniquenessStrategyUniqueFactoryImpl),
00060   ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
00061   0)
00062 
00063 ACE_FACTORY_NAMESPACE_DEFINE (
00064   ACE_Local_Service,
00065   IdUniquenessStrategyUniqueFactoryImpl,
00066   TAO::Portable_Server::IdUniquenessStrategyUniqueFactoryImpl)
00067 

Generated on Tue Feb 2 17:40:54 2010 for TAO_PortableServer by  doxygen 1.4.7