summaryrefslogtreecommitdiff
path: root/TAO/tests/Cubit/TAO/IDL_Cubit/cubit_i.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tests/Cubit/TAO/IDL_Cubit/cubit_i.cpp')
-rw-r--r--TAO/tests/Cubit/TAO/IDL_Cubit/cubit_i.cpp50
1 files changed, 10 insertions, 40 deletions
diff --git a/TAO/tests/Cubit/TAO/IDL_Cubit/cubit_i.cpp b/TAO/tests/Cubit/TAO/IDL_Cubit/cubit_i.cpp
index 0e057ae5815..5092f41b31e 100644
--- a/TAO/tests/Cubit/TAO/IDL_Cubit/cubit_i.cpp
+++ b/TAO/tests/Cubit/TAO/IDL_Cubit/cubit_i.cpp
@@ -14,61 +14,31 @@
// ============================================================================
#include "tao/corba.h"
+#include "ace/Auto_Ptr.h"
#include "cubit_i.h"
// Constructor
-Cubit_Factory_i::Cubit_Factory_i (const char *key, int numobjs)
- : POA_Cubit_Factory (key)
+Cubit_Factory_i::Cubit_Factory_i (void)
{
- // Create implementation object with user specified key.
-
- this->numobjs_ = numobjs;
- this->my_cubit_ = new Cubit_i_ptr [this->numobjs_];
-
- static char obj_str [MAXNAMELEN];
-
- for (u_int i = 0; i < this->numobjs_; i++)
- {
- ACE_OS::memset (obj_str, '\0', MAXNAMELEN);
- ACE_OS::sprintf (obj_str, "key%d", i);
-
- my_cubit_[i] = new Cubit_i (obj_str);
-
- if (my_cubit_[i] == 0)
- ACE_ERROR ((LM_ERROR,
- " (%P|%t) Unable to create implementation object%d\n",
- i));
-
- }
}
// Destructor
Cubit_Factory_i::~Cubit_Factory_i (void)
{
- delete [] this->my_cubit_;
}
Cubit_ptr
-Cubit_Factory_i::make_cubit (const char *key, CORBA::Environment &env)
+Cubit_Factory_i::make_cubit (const char *,
+ CORBA::Environment &env)
{
- for (size_t i = 0; i < this->numobjs_; i++)
- {
- const char *obj_str = this->my_cubit_[i]->_get_name (env);
-
- // Keys matched.
- if (!ACE_OS::strcmp (obj_str, key))
- return Cubit::_duplicate (this->my_cubit_ [i]);
- }
-
- return Cubit::_nil ();
+ return my_cubit_._this (env);
}
// Constructor
-Cubit_i::Cubit_i (const char *obj_name)
- : POA_Cubit (obj_name)
+Cubit_i::Cubit_i (const char *)
{
}
@@ -135,16 +105,16 @@ Cubit_i::cube_union (const Cubit::oneof &values,
ACE_UNUSED_ARG (env);
switch (values._d ())
{
- case e_0th:
+ case Cubit::e_0th:
temp.o (values.o () * values.o () * values.o ());
break;
- case e_1st:
+ case Cubit::e_1st:
temp.s (values.s () * values.s () * values.s ());
break;
- case e_2nd:
+ case Cubit::e_2nd:
temp.l (values.l () * values.l () * values.l ());
break;
- case e_3rd:
+ case Cubit::e_3rd:
default:
temp._d (values._d ()); // set the discriminant
// use the read/write accessor