summaryrefslogtreecommitdiff
path: root/TAO/tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.cpp
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2005-02-18 09:07:14 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2005-02-18 09:07:14 +0000
commit685cbd31f0c2b28e550cff1226b6dea3f3150136 (patch)
tree91ba7fc4584511f31379702bdcf543da966f7f78 /TAO/tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.cpp
parent872553f0d5680b863cd6b1948c68ca20a7269e46 (diff)
downloadATCD-685cbd31f0c2b28e550cff1226b6dea3f3150136.tar.gz
ChangeLogTag: Fri Feb 18 17:04:12 UTC 2005 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'TAO/tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.cpp')
-rw-r--r--TAO/tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.cpp75
1 files changed, 75 insertions, 0 deletions
diff --git a/TAO/tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.cpp b/TAO/tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.cpp
new file mode 100644
index 00000000000..adf34ab10bd
--- /dev/null
+++ b/TAO/tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.cpp
@@ -0,0 +1,75 @@
+// $Id$
+
+#include "IdUniquenessStrategyUniqueFactoryImpl.h"
+#include "IdUniquenessStrategyUnique.h"
+#include "ace/Dynamic_Service.h"
+
+ACE_RCSID (PortableServer,
+ IdUniquenessStrategyUniqueFactoryImpl,
+ "$Id$")
+
+namespace TAO
+{
+ namespace Portable_Server
+ {
+ IdUniquenessStrategyUniqueFactoryImpl::~IdUniquenessStrategyUniqueFactoryImpl (void)
+ {
+ }
+
+ IdUniquenessStrategy*
+ IdUniquenessStrategyUniqueFactoryImpl::create (
+ ::PortableServer::IdUniquenessPolicyValue value)
+ {
+ IdUniquenessStrategy* strategy = 0;
+
+ switch (value)
+ {
+ case ::PortableServer::UNIQUE_ID :
+ {
+ ACE_NEW_RETURN (strategy, IdUniquenessStrategyUnique, 0);
+ break;
+ }
+ case ::PortableServer::MULTIPLE_ID :
+ {
+ ACE_ERROR ((LM_ERROR, "Incorrect type in IdUniquenessStrategyUniqueFactoryImpl"));
+ break;
+ }
+ }
+
+ return strategy;
+ }
+
+ void
+ IdUniquenessStrategyUniqueFactoryImpl::destroy (
+ IdUniquenessStrategy *strategy
+ ACE_ENV_ARG_DECL)
+ {
+ strategy->strategy_cleanup (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ delete strategy;
+ }
+
+ ACE_STATIC_SVC_DEFINE (
+ IdUniquenessStrategyUniqueFactoryImpl,
+ ACE_TEXT ("IdUniquenessStrategyUniqueFactory"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (IdUniquenessStrategyUniqueFactoryImpl),
+ ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
+ 0
+ )
+
+ ACE_FACTORY_DEFINE (TAO_PortableServer, IdUniquenessStrategyUniqueFactoryImpl)
+
+ #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
+
+ template class ACE_Dynamic_Service<IdUniquenessStrategyUniqueFactoryImpl>;
+
+ #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
+
+ #pragma instantiate ACE_Dynamic_Service<IdUniquenessStrategyUniqueFactoryImpl>
+
+ #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
+ }
+}
+