summaryrefslogtreecommitdiff
path: root/TAO/tests/OBV/Supports
diff options
context:
space:
mode:
authoredwardgt <edwardgt@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-07-18 15:22:54 +0000
committeredwardgt <edwardgt@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-07-18 15:22:54 +0000
commit72ffc97d83f6ace315334c92997a191c9cb432b8 (patch)
tree3985bc77f1e35e08563a6f915dd1562f154325de /TAO/tests/OBV/Supports
parent5a80b73e583418df8f6e5fbda343a56b0a8ac5ff (diff)
downloadATCD-72ffc97d83f6ace315334c92997a191c9cb432b8.tar.gz
ChangeLogTag: Fri Jul 18 10:18:41 2003 George Edwards <g.edwards@vanderbilt.edu>
Diffstat (limited to 'TAO/tests/OBV/Supports')
-rw-r--r--TAO/tests/OBV/Supports/Client.dsp10
-rw-r--r--TAO/tests/OBV/Supports/Client/client.cpp82
-rw-r--r--TAO/tests/OBV/Supports/README32
-rw-r--r--TAO/tests/OBV/Supports/Server.dsp12
-rw-r--r--TAO/tests/OBV/Supports/Server/server.cpp15
-rw-r--r--TAO/tests/OBV/Supports/Supports_Test.idl46
-rw-r--r--TAO/tests/OBV/Supports/Supports_Test_impl.cpp83
-rw-r--r--TAO/tests/OBV/Supports/Supports_Test_impl.h23
8 files changed, 239 insertions, 64 deletions
diff --git a/TAO/tests/OBV/Supports/Client.dsp b/TAO/tests/OBV/Supports/Client.dsp
index 23fe1f93b27..d836b9ba92c 100644
--- a/TAO/tests/OBV/Supports/Client.dsp
+++ b/TAO/tests/OBV/Supports/Client.dsp
@@ -180,7 +180,7 @@ InputPath=.\Supports_Test.idl
InputName=Supports_Test
BuildCmds= \
- $(ACE_ROOT)\bin\tao_idl -o . -Sc $(InputPath)
+ %ACE_ROOT%\bin\tao_idl -o . -Sc $(InputPath) -Gv -Gt
".\$(InputName)C.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
@@ -205,5 +205,13 @@ BuildCmds= \
# End Source File
# End Group
+# Begin Group "Documentation"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\README
+# End Source File
+# End Group
# End Target
# End Project
diff --git a/TAO/tests/OBV/Supports/Client/client.cpp b/TAO/tests/OBV/Supports/Client/client.cpp
index d49fa13aaf5..9b6c080c9bf 100644
--- a/TAO/tests/OBV/Supports/Client/client.cpp
+++ b/TAO/tests/OBV/Supports/Client/client.cpp
@@ -3,6 +3,38 @@
#include "..\Supports_Test_impl.h"
const char * ior = "file://test.ior";
+int num_trials = 1;
+int id = 0;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "t:i:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 't':
+ num_trials = atoi (get_opts.optarg);
+ break;
+
+ case 'i':
+ id = atoi (get_opts.optarg);
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-t <trials> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
int
main (int argc, char *argv[])
@@ -14,6 +46,9 @@ main (int argc, char *argv[])
CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
CORBA::Object_var poa_object = orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
@@ -81,66 +116,81 @@ main (int argc, char *argv[])
if (CORBA::is_nil (my_test.in ())) ACE_ERROR_RETURN ((LM_DEBUG, "Nil Supports_Test::test obj ref <%s>\n", ior), 1);
-
+ my_test->start ();
+
/* Perform test */
+ for (int i = 0; i < num_trials; i++)
+ {
+
+ // Create a vt_graph_impl instance and store the reference as a
+ // vt_graph_var. Then register the instance with the POA to obtain an
+ // object reference, stored as a graph_var. Increment the reference count
+ // of the vt_graph_impl instance.
vt_graph_impl * the_vt_graph = 0;
ACE_NEW_RETURN (the_vt_graph, vt_graph_impl (3), 1);
Supports_Test::vt_graph_var test_vt_graph = the_vt_graph;
- vt_graph_impl * the_vt_graph2 = 0;
- ACE_NEW_RETURN (the_vt_graph2, vt_graph_impl (4), 1);
- Supports_Test::graph_var test_graph = the_vt_graph2->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ Supports_Test::graph_var test_graph = the_vt_graph->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
if (CORBA::is_nil (test_graph.in ())) ACE_ERROR_RETURN ((LM_DEBUG, "Nil Supports_Test::graph obj ref\n"), 1);
+ the_vt_graph->DefaultValueRefCountBase::_add_ref ();
+ // At this point, test_vt_graph and test_graph refer to the same object.
ACE_ASSERT (test_vt_graph->size () == 3);
my_test->pass_vt_graph_in (test_vt_graph.in () ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
ACE_ASSERT (test_vt_graph->size () == 3);
- ACE_ASSERT (test_graph->size () == 4);
+ ACE_ASSERT (test_graph->size () == 3);
my_test->pass_obj_graph_in (test_graph.in () ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
- ACE_ASSERT (test_graph->size () == 5);
+ ACE_ASSERT (test_graph->size () == 4);
- test_vt_graph->add_node ("NEW1");
+ test_vt_graph->add_node ("NEW2");
- test_graph->add_node ("NEW2");
+ test_graph->add_node ("NEW3");
- ACE_ASSERT (test_vt_graph->size () == 4);
+ // After the 'pass_vt_graph_out' call returns, test_vt_graph will refer to
+ // a new object.
+ ACE_ASSERT (test_vt_graph->size () == 6);
my_test->pass_vt_graph_out (test_vt_graph.out () ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
- ACE_ASSERT (test_vt_graph->size () == 4);
+ ACE_ASSERT (test_vt_graph->size () == 5);
+ // 'test_graph' still refers to the original object, but after the
+ // 'pass_obj_graph_out' call returns, it will refer to a new object,
+ // residing on the server.
ACE_ASSERT (test_graph->size () == 6);
my_test->pass_obj_graph_out (test_graph.out () ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
ACE_ASSERT (test_graph->size () == 5);
+ // test_vt_graph and test_graph now refer to different objects.
test_vt_graph->add_node ("NEW2");
test_graph->add_node ("NEW2");
- ACE_ASSERT (test_vt_graph->size () == 5);
+ ACE_ASSERT (test_vt_graph->size () == 6);
my_test->pass_vt_graph_inout (test_vt_graph.inout () ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
- ACE_ASSERT (test_vt_graph->size () == 6);
+ ACE_ASSERT (test_vt_graph->size () == 7);
ACE_ASSERT (test_graph->size () == 6);
my_test->pass_obj_graph_inout (test_graph.inout () ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
ACE_ASSERT (test_graph->size () == 7);
- /* Shut down */
+ }
- my_test->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ my_test->finish ();
+
+ /* Shut down */
orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) Client test finished\n"));
+ ACE_DEBUG ((LM_DEBUG, "Client (%P.%t) completed test successfully\n", id));
}
ACE_CATCHANY
diff --git a/TAO/tests/OBV/Supports/README b/TAO/tests/OBV/Supports/README
index 2b7bf443907..6256d7c6be8 100644
--- a/TAO/tests/OBV/Supports/README
+++ b/TAO/tests/OBV/Supports/README
@@ -1,9 +1,35 @@
// $Id$
-The Supports_Test example tests the ability of valuetypes to support concrete interfaces. Valuetypes are manipulated both as normal valuetypes and as object references.
+The Supports_Test example tests the ability of valuetypes to support concrete
+interfaces. Valuetypes are manipulated both as normal valuetypes and as object
+references.
+
+Since operations of a supported interface are mapped to pure virtual methods in
+the valuetype (and are not inherited), an application using this feature should
+probably not define an implementation of the interface. Doing so will result in
+multiple implementations of the same method - one for objects of the interface,
+and one for valuetypes - and clients will have no way to distiguish between the
+two, other than narrowing objects of the interface type to the
+valuetype. Instead, leave the interface unimplemented, and only define
+implementations of its methods in the valuetype.
The steps are as follows:
1. Activate a POA in which the valuetype will reside and create the valuetype.
-2. Call the valuetype's "_this ()" method, which is inherited from the skeleton class of the supported interface. This will return an active object reference to an object that is the type of the supported interface.
-3. This object reference can be passed as a parameter and supports remote operation invokations. \ No newline at end of file
+2. Call the valuetype's "_this ()" method, which is inherited from the skeleton
+ class of the supported interface. This will return an active object reference
+ to an object that is the type of the supported interface.
+3. This object reference can be passed as a parameter and supports remote
+ operation invokations.
+
+Supports_Test checks proper operation of the following features:
+-Valuetypes that support concrete interfaces:
+ Using the same valuetype implementation, Supports_Test creates both
+ valuetypes and object references, passes them as parameters, and
+ invokes both local and remote calls.
+-ORB::register_value_factory () return values:
+ Supports_Test checks the return values of register_value_factory () to
+ ensure compliance with the spec.
+-Multithreading:
+ If the run_test.pl script is used, several clients will be spawned and the
+ server will used a thread-per-connection model. \ No newline at end of file
diff --git a/TAO/tests/OBV/Supports/Server.dsp b/TAO/tests/OBV/Supports/Server.dsp
index 82aac4e92c0..c9b439bfebc 100644
--- a/TAO/tests/OBV/Supports/Server.dsp
+++ b/TAO/tests/OBV/Supports/Server.dsp
@@ -62,7 +62,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /machine:IX86
-# ADD LINK32 aced.lib taod.lib TAO_PortableServerd.lib TAO_Valuetyped.lib TAO_Strategiesd.lib /nologo /version:1.0 /subsystem:console /debug /machine:I386 /libpath:"C:\ACE_wrappers\ace" /libpath:"C:\ACE_wrappers\TAO\tao" /libpath:"C:\ACE_wrappers\TAO\tao\Valuetype" /libpath:"C:\ACE_wrappers\TAO\tao\PortableServer" /libpath:"C:\ACE_wrappers\TAO\tao\IFR_Client" /libpath:"C:\ACE_wrappers\TAO\orbsvcs\orbsvcs" /libpath:"C:\ACE_wrappers\TAO\tao\IORInterceptor" /libpath:"C:\ACE_wrappers\TAO\orbsvcs\IFR_Service" /libpath:"C:\ACE_wrappers\TAO\tao\Strategies"
+# ADD LINK32 aced.lib taod.lib TAO_PortableServerd.lib TAO_Valuetyped.lib TAO_Strategiesd.lib /nologo /version:1.0 /subsystem:console /debug /machine:I386 /libpath:"../../../../ace" /libpath:"../../../tao" /libpath:"../../../tao/Valuetype" /libpath:"../../../tao/PortableServer" /libpath:"../../../tao/Strategies"
# SUBTRACT LINK32 /pdb:none /incremental:no /force
!ENDIF
@@ -180,7 +180,7 @@ InputPath=.\Supports_Test.idl
InputName=Supports_Test
BuildCmds= \
- $(ACE_ROOT)\bin\tao_idl -o . -Sc $(InputPath)
+ %ACE_ROOT%\bin\tao_idl -o . -Sc $(InputPath) -Gt -Gv
".\$(InputName)C.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
@@ -205,5 +205,13 @@ BuildCmds= \
# End Source File
# End Group
+# Begin Group "Documentation"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\README
+# End Source File
+# End Group
# End Target
# End Project
diff --git a/TAO/tests/OBV/Supports/Server/server.cpp b/TAO/tests/OBV/Supports/Server/server.cpp
index f246a0448dd..85edca50fd6 100644
--- a/TAO/tests/OBV/Supports/Server/server.cpp
+++ b/TAO/tests/OBV/Supports/Server/server.cpp
@@ -51,17 +51,16 @@ main (int argc, char * argv[])
vt_graph_factory->_remove_ref ();
-
test_impl * a_test_impl;
ACE_NEW_RETURN (a_test_impl, test_impl (orb.in ()), 1);
- PortableServer::ServantBase_var owner_transfer(a_test_impl);
+ //PortableServer::ServantBase_var owner_transfer = a_test_impl;
- Supports_Test::test_var a_test = a_test_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ Supports_Test::test_ptr a_test = a_test_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
- CORBA::String_var ior = orb->object_to_string (a_test.in () ACE_ENV_ARG_PARAMETER);
+ CORBA::String_var ior = orb->object_to_string (a_test ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
FILE * output_file = ACE_OS::fopen (ior_output_file, "w");
@@ -75,16 +74,18 @@ main (int argc, char * argv[])
poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
- orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ a_test_impl->_remove_ref ();
+
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
- root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ root_poa->destroy (0, 0 ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) Server test finished\n"));
+ ACE_DEBUG ((LM_DEBUG, "Server (%P.%t) completed test successfully\n"));
}
ACE_CATCHANY
diff --git a/TAO/tests/OBV/Supports/Supports_Test.idl b/TAO/tests/OBV/Supports/Supports_Test.idl
index 3f1ab85f6c4..22631a893b7 100644
--- a/TAO/tests/OBV/Supports/Supports_Test.idl
+++ b/TAO/tests/OBV/Supports/Supports_Test.idl
@@ -1,5 +1,25 @@
// $Id$
+///////////////////////////////////////////////////////////////////////////////
+/**
+ * \file Supports_Test.idl
+ *
+ * \author George Thomas Edwards <g.edwards@vanderbilt.edu>
+ *
+ * This file contain definitions of the valuetypes and interfaces of
+ * Supports_Test, a test of TAO's OBV capabilities. Specifically, Supports_Test
+ * checks proper operation of the following features:
+ *
+ * -Valuetypes that support concrete interfaces:
+ * Using the same valuetype implementation, Supports_Test creates both
+ * valuetypes and object references, passes them as parameters, and
+ * invokes both local and remote calls.
+ * -ORB::register_value_factory () return values:
+ * Supports_Test checks the return values of register_value_factory () to
+ * ensure compliance with the spec.
+ */
+///////////////////////////////////////////////////////////////////////////////
+
module Supports_Test
{
@@ -7,6 +27,12 @@ module Supports_Test
typedef sequence<Node> Node_List;
+ /**
+ *
+ * This valuetype is the basic building block of the vt_graph valuetype,
+ * defined below. Some of these operations and state members are not
+ * currently used in the test.
+ */
valuetype Node
{
@@ -25,6 +51,14 @@ module Supports_Test
};
+ /**
+ * \interface graph
+ *
+ * This interface contains the operations we will invoke on vt_graph
+ * valuetypes as well as graph object references. The implementations of
+ * these operations will be defined in vt_graph. All graph object refs will
+ * be vt_graphs under the hood.
+ */
interface graph
{
@@ -37,22 +71,26 @@ module Supports_Test
valuetype vt_graph supports graph
{
- public Node_List nodes_;
+ private Node_List nodes_;
factory create ();
};
+ /**
+ * \interface test
+ *
+ * This interface contains the operations that will perform the tests.
+ */
interface test
{
-
void pass_vt_graph_in (in vt_graph vt_graph_param);
void pass_obj_graph_in (in graph graph_param);
void pass_vt_graph_out (out vt_graph vt_graph_param);
void pass_obj_graph_out (out graph graph_param);
void pass_vt_graph_inout (inout vt_graph vt_graph_param);
void pass_obj_graph_inout (inout graph graph_param);
- oneway void shutdown ();
-
+ void start ();
+ oneway void finish ();
};
};
diff --git a/TAO/tests/OBV/Supports/Supports_Test_impl.cpp b/TAO/tests/OBV/Supports/Supports_Test_impl.cpp
index 6c59b48cd68..cd28591efce 100644
--- a/TAO/tests/OBV/Supports/Supports_Test_impl.cpp
+++ b/TAO/tests/OBV/Supports/Supports_Test_impl.cpp
@@ -9,21 +9,26 @@ vt_graph_impl::vt_graph_impl (void)
{
}
+// Creates a vt_graph_impl with the given number of nodes. There will be one
+// root node and the rest will be children of it.
vt_graph_impl::vt_graph_impl (int num_nodes)
{
nodes_ ().length (0);
- for (int i = 0; i < num_nodes; i++)
+ add_node ("ROOT");
+ for (int i = 1; i < num_nodes; i++)
{
- add_node ("OLD");
- if (i != 0) nodes_ ()[i]->add_edge (nodes_ ()[0]);
+ add_node ("CHILD");
+ nodes_ ()[0]->add_edge (nodes_ ()[i]);
}
}
+// Get the number of nodes in the vt_graph.
CORBA::Long vt_graph_impl::size (void)
{
return nodes_ ().length ();
}
+// Add a node to the graph with no edges.
void vt_graph_impl::add_node (const char * name)
{
Supports_Test::Node * new_node = 0;
@@ -32,19 +37,18 @@ void vt_graph_impl::add_node (const char * name)
nodes_ ()[nodes_ ().length () - 1] = new_node;
}
+// Print out information about each node.
void vt_graph_impl::print (void)
{
+ cout << "Printing graph data..." << endl;
+ cout << "Number of nodes: " << nodes_ ().length () << endl;
for (int i = 0; i < nodes_ ().length (); i++)
- {
- nodes_ ()[i]->print ();
- }
-
+ nodes_ ()[i]->print ();
cout << endl;
}
-
-/* vt_graph_init_impl */
+/* vt_graph_init_impl - factory operations */
Supports_Test::vt_graph * vt_graph_init_impl::create (void)
{
@@ -63,16 +67,21 @@ CORBA::ValueBase * vt_graph_init_impl::create_for_unmarshal (void)
/* test_impl */
-test_impl::test_impl (CORBA::ORB_ptr orb) : orb_ (CORBA::ORB::_duplicate (orb))
+test_impl::test_impl (CORBA::ORB_ptr orb) : orb_ (CORBA::ORB::_duplicate (orb)), num_clients_ (0)
+{
+}
+
+test_impl::~test_impl (void)
{
+ this->orb_->shutdown (0);
}
void test_impl::pass_obj_graph_in (Supports_Test::graph * graph_param ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException))
{
- ACE_ASSERT (graph_param->size () == 4);
+ ACE_ASSERT (graph_param->size () == 3);
graph_param->add_node ("NEW1");
- ACE_ASSERT (graph_param->size () == 5);
+ ACE_ASSERT (graph_param->size () == 4);
}
@@ -103,12 +112,12 @@ void test_impl::pass_vt_graph_out (Supports_Test::vt_graph_out vt_graph_param AC
{
vt_graph_impl * the_vt_graph = 0;
- ACE_NEW (the_vt_graph, vt_graph_impl (3));
+ ACE_NEW (the_vt_graph, vt_graph_impl (4));
vt_graph_param = the_vt_graph;
- ACE_ASSERT (vt_graph_param->size () == 3);
- vt_graph_param->add_node ("NEW1");
ACE_ASSERT (vt_graph_param->size () == 4);
+ vt_graph_param->add_node ("NEW1");
+ ACE_ASSERT (vt_graph_param->size () == 5);
}
@@ -116,7 +125,7 @@ void test_impl::pass_obj_graph_inout (Supports_Test::graph * &graph_param ACE_EN
{
ACE_ASSERT (graph_param->size () == 6);
- graph_param->add_node ("NEW!");
+ graph_param->add_node ("NEW3");
ACE_ASSERT (graph_param->size () == 7);
}
@@ -124,15 +133,24 @@ void test_impl::pass_obj_graph_inout (Supports_Test::graph * &graph_param ACE_EN
void test_impl::pass_vt_graph_inout (Supports_Test::vt_graph * &vt_graph_param ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException))
{
- ACE_ASSERT (vt_graph_param->size () == 5);
- vt_graph_param->add_node ("NEW!");
ACE_ASSERT (vt_graph_param->size () == 6);
+ vt_graph_param->add_node ("NEW3");
+ ACE_ASSERT (vt_graph_param->size () == 7);
+
+}
+void test_impl::start (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_GUARD (ACE_Thread_Mutex, guard, lock_);
+ num_clients_++;
}
-void test_impl::shutdown (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException))
+void test_impl::finish (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException))
{
- this->orb_->shutdown ();
+ ACE_GUARD (ACE_Thread_Mutex, guard, lock_);
+ num_clients_--;
+ if (num_clients_ == 0)
+ this->_remove_ref ();
}
@@ -142,6 +160,7 @@ node_impl::node_impl (void)
{
}
+// Initialize state.
node_impl::node_impl (const char * name)
{
name_ (name);
@@ -150,6 +169,7 @@ node_impl::node_impl (const char * name)
neighbors_ ().length (0);
}
+// Add an edge from this node to neighbor.
void node_impl::add_edge (Supports_Test::Node * neighbor)
{
degree_ (degree_ () + 1);
@@ -158,10 +178,17 @@ void node_impl::add_edge (Supports_Test::Node * neighbor)
neighbor->_add_ref ();
return;
}
-
+
+// Remove the edge from this node to neighbor.
void node_impl::remove_edge (Supports_Test::Node * neighbor)
{
-
+ for (int i = 0; i < neighbors_ ().length (); i++)
+ if (neighbors_ ()[i] == neighbor)
+ {
+ neighbors_ ()[i] = neighbors_ ()[neighbors_ ().length () - 1];
+ neighbors_ ().length (neighbors_ ().length () - 1);
+ neighbor->_remove_ref ();
+ }
}
void node_impl::change_weight (CORBA::Long new_weight)
@@ -171,15 +198,15 @@ void node_impl::change_weight (CORBA::Long new_weight)
void node_impl::print (void)
{
- cout << "Name: " << name_ () << endl;
- cout << "Weight: " << weight_ () << endl;
- cout << "Degree: " << degree_ () << endl;
- cout << "Neighbors: " << endl;
+ cout << " Name: " << name_ () << endl;
+ cout << " Weight: " << weight_ () << endl;
+ cout << " Degree: " << degree_ () << endl;
+ cout << " Neighbors: " << endl;
for (int i = 0; i < neighbors_ ().length (); i++)
- cout << " " << neighbors_ ()[i]->name_ () << endl;
+ cout << " " << neighbors_ ()[i]->name_ () << endl;
}
-/* node_init_impl */
+/* node_init_impl - factory operations */
Supports_Test::Node * node_init_impl::create (void)
{
diff --git a/TAO/tests/OBV/Supports/Supports_Test_impl.h b/TAO/tests/OBV/Supports/Supports_Test_impl.h
index 346c3eb6e86..6f3255c750c 100644
--- a/TAO/tests/OBV/Supports/Supports_Test_impl.h
+++ b/TAO/tests/OBV/Supports/Supports_Test_impl.h
@@ -4,7 +4,14 @@
#define TAO_SUPPORTS_TEST_IMPL_H
#include "Supports_TestS.h"
-
+#include "ace/Synch.h"
+#include "ace/Get_Opt.h"
+
+/**
+ * \class node_impl
+ *
+ *
+ */
class node_impl :
public virtual OBV_Supports_Test::Node,
public virtual CORBA::DefaultValueRefCountBase
@@ -71,13 +78,16 @@ public:
};
class test_impl :
- public virtual POA_Supports_Test::test
+ public virtual POA_Supports_Test::test,
+ public virtual PortableServer::RefCountServantBase
{
public:
test_impl (CORBA::ORB_ptr orb);
+ virtual ~test_impl (void);
+
virtual void pass_obj_graph_in (Supports_Test::graph * graph_param
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException));
@@ -102,13 +112,20 @@ public:
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException));
- virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ virtual void start (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void finish (ACE_ENV_SINGLE_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException));
private:
CORBA::ORB_var orb_;
+ int num_clients_;
+
+ ACE_Thread_Mutex lock_;
+
};
#endif /* TAO_SUPPORTS_TEST_IMPL_H */