summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Notify/Find_Worker_T.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/Notify/Find_Worker_T.cpp')
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Find_Worker_T.cpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Find_Worker_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/Find_Worker_T.cpp
new file mode 100644
index 00000000000..1c560a73503
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Find_Worker_T.cpp
@@ -0,0 +1,47 @@
+// $Id$
+
+#ifndef TAO_NS_FIND_WORKER_T_CPP
+#define TAO_NS_FIND_WORKER_T_CPP
+
+#include "Find_Worker_T.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "Find_Worker_T.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Notify, TAO_NS_Find_Worker_T, "$id$")
+
+template<class TYPE, class INTERFACE, class INTERFACE_PTR, class EXCEPTION>
+TAO_NS_Find_Worker_T<TYPE,INTERFACE,INTERFACE_PTR,EXCEPTION>::TAO_NS_Find_Worker_T (void)
+ :id_ (0), result_ (0)
+{
+}
+
+template<class TYPE, class INTERFACE, class INTERFACE_PTR, class EXCEPTION> TYPE*
+TAO_NS_Find_Worker_T<TYPE,INTERFACE,INTERFACE_PTR,EXCEPTION>::find (TAO_NS_Object::ID id, CONTAINER& container ACE_ENV_ARG_DECL)
+{
+ this->id_ = id;
+
+ container.collection ()->for_each (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->result_;
+}
+
+template<class TYPE, class INTERFACE, class INTERFACE_PTR, class EXCEPTION> INTERFACE_PTR
+TAO_NS_Find_Worker_T<TYPE,INTERFACE,INTERFACE_PTR,EXCEPTION>::resolve (TAO_NS_Object::ID id, CONTAINER& container ACE_ENV_ARG_DECL)
+{
+ this->find (id, container ACE_ENV_ARG_PARAMETER);
+
+ if (this->result_ == 0)
+ ACE_THROW_RETURN (EXCEPTION ()
+ , INTERFACE::_nil ());
+
+ CORBA::Object_var object = this->result_->ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (INTERFACE::_nil ());
+
+ return INTERFACE::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+
+}
+
+#endif /* TAO_NS_FIND_WORKER_T_CPP */