summaryrefslogtreecommitdiff
path: root/TAO/tests/ORT/ObjectReferenceFactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tests/ORT/ObjectReferenceFactory.cpp')
-rw-r--r--TAO/tests/ORT/ObjectReferenceFactory.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/TAO/tests/ORT/ObjectReferenceFactory.cpp b/TAO/tests/ORT/ObjectReferenceFactory.cpp
new file mode 100644
index 00000000000..0373edccd29
--- /dev/null
+++ b/TAO/tests/ORT/ObjectReferenceFactory.cpp
@@ -0,0 +1,38 @@
+#include "ObjectReferenceFactory.h"
+
+
+ACE_RCSID (ORT,
+ ObjectReferenceFactory,
+ "$Id$")
+
+
+#include "tao/debug.h"
+
+
+ObjectReferenceFactory::ObjectReferenceFactory (
+ PortableInterceptor::ObjectReferenceFactory * old_orf)
+ : old_orf_ (old_orf)
+{
+ // Claim ownership of the old ObjectReferenceFactory.
+ CORBA::add_ref (old_orf);
+}
+
+ObjectReferenceFactory::~ObjectReferenceFactory (void)
+{
+ // No need to call CORBA::remove_ref() on this->old_orf_. It is a
+ // "_var" object, meaning that will be done automatically.
+}
+
+CORBA::Object_ptr
+ObjectReferenceFactory::make_object (
+ const char *repository_id,
+ const PortableInterceptor::ObjectId & id)
+{
+ ACE_ASSERT (repository_id != 0);
+
+ ACE_DEBUG ((LM_INFO,
+ "Invoked custom ObjectReferenceFactory::make_object()\n"));
+
+ return this->old_orf_->make_object (repository_id,
+ id);
+}