summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-01-22 17:27:39 +0000
committercoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-01-22 17:27:39 +0000
commitf8d98275cf4eaae74055d4998dc24aa40501bcb3 (patch)
tree241a09a645ac5bc4ded6fea1610fff7a0b742ce6
parent5d702a2bd359823bb37e0bf02ee602daeaae6799 (diff)
downloadATCD-f8d98275cf4eaae74055d4998dc24aa40501bcb3.tar.gz
ChangeLogTag:Thu Jan 22 10:40:13 1998 Carlos O'Ryan <coryan@cs.wustl.edu>
-rw-r--r--TAO/ChangeLog-98c5
-rw-r--r--TAO/INSTALL26
-rw-r--r--TAO/Makefile20
-rw-r--r--TAO/TAO_IDL/be/be_attribute.cpp48
-rw-r--r--TAO/TAO_IDL/be/be_operation.cpp10
-rw-r--r--TAO/TAO_IDL/be/be_state_attribute.cpp5
-rw-r--r--TAO/TAO_IDL/be/be_state_operation.cpp6
-rw-r--r--TAO/VERSION2
-rw-r--r--TAO/orbsvcs/Event_Service/GPlot_File.cpp8
-rw-r--r--TAO/orbsvcs/Event_Service/Makefile1
-rw-r--r--TAO/orbsvcs/Naming_Service/Naming_Service.cpp2
-rw-r--r--TAO/orbsvcs/orbsvcs/AVStreams.idl29
-rw-r--r--TAO/orbsvcs/orbsvcs/Makefile1
-rw-r--r--TAO/orbsvcs/tests/Simple_Naming/clnt.cpp16
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/Makefile11
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/README5
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp10
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/server.cpp9
-rw-r--r--TAO/tao/corbacom.h6
-rw-r--r--TAO/tao/decode.cpp9
-rw-r--r--TAO/tao/default_server.cpp48
-rw-r--r--TAO/tao/default_server.h10
-rw-r--r--TAO/tao/encode.cpp14
-rw-r--r--TAO/tao/giop.cpp23
-rw-r--r--TAO/tao/giop.h9
-rw-r--r--TAO/tao/interp.cpp6
-rw-r--r--TAO/tao/nvlist.h2
-rw-r--r--TAO/tao/nvlist.i4
-rw-r--r--TAO/tao/sequence.cpp57
-rw-r--r--TAO/tao/sequence.h11
-rw-r--r--TAO/tao/sequence.i18
-rw-r--r--TAO/tao/sequence_T.cpp440
-rw-r--r--TAO/tao/sequence_T.i72
-rw-r--r--TAO/tao/servant_base.cpp2
-rw-r--r--TAO/tests/Cubit/TAO/IDL_Cubit/Makefile6
-rw-r--r--TAO/tests/Cubit/TAO/IDL_Cubit/README4
-rw-r--r--TAO/tests/Cubit/TAO/IDL_Cubit/clnt.cpp5
-rw-r--r--TAO/tests/Cubit/TAO/MT_Cubit/Makefile11
-rw-r--r--TAO/tests/Cubit/TAO/MT_Cubit/README5
-rw-r--r--TAO/tests/Cubit/TAO/MT_Cubit/client.cpp10
-rw-r--r--TAO/tests/Cubit/TAO/MT_Cubit/server.cpp9
41 files changed, 628 insertions, 367 deletions
diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c
index 34d4c90b850..b372ab0a593 100644
--- a/TAO/ChangeLog-98c
+++ b/TAO/ChangeLog-98c
@@ -1,3 +1,8 @@
+Thu Jan 22 10:40:13 1998 Carlos O'Ryan <coryan@cs.wustl.edu>
+
+ * Merged changes from main_to_poa_merge_10 up to
+ main_to_poa_merge_11
+
Wed Jan 21 00:31:40 1998 Irfan Pyarali <irfan@cs.wustl.edu>
* tao/servant_base.cpp (_default_POA): Changed to use
diff --git a/TAO/INSTALL b/TAO/INSTALL
index 649909c5961..d5f5c52e9bf 100644
--- a/TAO/INSTALL
+++ b/TAO/INSTALL
@@ -1,6 +1,6 @@
_________________________________________________________________
-
+
Building and Installing TAO
TAO has been ported and tested Windows NT, Solaris, VxWorks, and
@@ -17,9 +17,8 @@
linking TAO with a version of ACE that must also be linked against
another ORB vendor's library, e.g., liborbix.so, will produce
undefined and most likely unpredictable and erroneous results.
-
_________________________________________________________________
-
+
On UNIX platforms
1. Set ACE_ROOT environment variable as outlined in the [5]ACE
@@ -33,16 +32,16 @@
6. Follow instructions on executing the various examples under
$TAO_ROOT/tests.
- _A Note On Make_
+ A Note On Make
Since TAO is built atop ACE, TAO re-uses ACE's Makefile structure as
well. Thus, just like ACE requires GNU Make, so too does TAO. More
- exactly, versions of make which are known to _not_ work include those
+ exactly, versions of make which are known to not work include those
from Solaris 4.x and 5.x, HP-UX, the latest BSD, etc.
GNU Make can be obtained from various places in source form.
_________________________________________________________________
-
+
On Windows NT
Before compiling TAO_IDL on NT, you may need to set the environment
@@ -62,9 +61,7 @@
1. Make sure ACE is built (For Visual C++ 5.0, use ace.dsw or
ace-vc50.dsw, whichever is in your copy of ACE).
-
2. Load the workspace tao\TAO.dsw and build the TAO library.
-
3. To build the Cubit test, load the workspace
tests\Cubit\TAO\test.dsw and build both client and server.
@@ -77,19 +74,18 @@
2. Load the project file tao\TAO.mdp and build the TAO library.
3. To build the Cubit test, load the project file
tests\Cubit\TAO\test.mdp and build both client and server.
-
_________________________________________________________________
-
+
Back to the [9]TAO home page.
References
- 1. file://localhost/.automount/tango/root/export2/project/doc/chris/ACE_wrappers/TAO/TAO-obtain.html
+ 1. file://localhost/project/adaptive/ACE_wrappers/TAO/TAO-obtain.html
2. http://siesta.cs.wustl.edu/~schmidt/TAO-obtain.html
3. http://siesta.cs.wustl.edu/~schmidt/ACE-obtain.html
4. http://www.cs.wustl.edu/~schmidt/ACE_wrappers/ACE.tar.gz
- 5. file://localhost/.automount/tango/root/export2/project/doc/chris/ACE_wrappers/ACE-INSTALL.html
- 6. file://localhost/.automount/tango/root/export2/project/doc/chris/ACE_wrappers/TAO/TAO-INSTALL.html#makenotes
- 7. file://localhost/.automount/tango/root/export2/project/doc/chris/ACE_wrappers/TAO/TAO-INSTALL.html#makenotes
- 8. file://localhost/.automount/tango/root/export2/project/doc/chris/ACE_wrappers/TAO/TAO-INSTALL.html#makenotes
+ 5. http://www.cs.wustl.edu/~schmidt/ACE-INSTALL.html
+ 6. file://localhost/project/adaptive/ACE_wrappers/TAO/TAO-INSTALL.html#makenotes
+ 7. file://localhost/project/adaptive/ACE_wrappers/TAO/TAO-INSTALL.html#makenotes
+ 8. file://localhost/project/adaptive/ACE_wrappers/TAO/TAO-INSTALL.html#makenotes
9. http://www.cs.wustl.edu/~schmidt/TAO.html
diff --git a/TAO/Makefile b/TAO/Makefile
index b17aaf387af..3097eb12799 100644
--- a/TAO/Makefile
+++ b/TAO/Makefile
@@ -77,27 +77,9 @@ INSTALL: TAO-INSTALL.html
ifeq ($(shell pwd),/project/adaptive/ACE_wrappers/TAO)
TIMESTAMP = (CHANGELOG='ChangeLog'; export CHANGELOG; \
if [ -z "$$CHANGELOG" ]; then echo unable to find latest ChangeLog file; exit 1; fi; \
- DATE=`/usr/bin/date +"%a %b %d %T %Y"`; export DATE; \
cd ..; UPTODATE=`cvs -nq update $(RELEASE_FILES) | egrep -v '/tests/log/' | perl -pi -e 's%/TAO%%g; s/$$/\\\n /g'`; cd TAO; \
if [ "$$UPTODATE" ]; then /pkg/gnu/bin/echo -e ERROR: workspace must be updated, and/or non-controlled files must be removed or added/committed: $$UPTODATE; exit 1; fi; \
- TAO_VERSION=`perl -pi -e \
- 'BEGIN { $$date=$$ENV{"DATE"} } \
- s/(TAO version \d+\.\d+\.)(\d+)/sprintf("$$1%d",$$2+1)/e; \
- if (s/(, released ).*/$$1$$date./) { \
- ($$version = $$_) =~ s/^This is //; } \
- END { print $$version } ' VERSION;` export TAO_VERSION; \
- perl -i -e \
- 'BEGIN {($$message = \
- $$ENV{"DATE"} . " " . \
- $$ENV{"SIGNATURE"} . " <" . \
- $$ENV{"LOGNAME"} . "\@cs.wustl.edu>\n\n\t* " . \
- $$ENV{"TAO_VERSION"} . "\n"); \
- $$message_printed = 0;} \
- while (<>) { \
- if ( ! $$message_printed++ ) { print "$$message\n"; } \
- print; } ' $$CHANGELOG; \
- cvs commit -m"$$TAO_VERSION" VERSION $$CHANGELOG; \
- chmod 644 VERSION $$CHANGELOG) &&
+ perl release.pl) &&
else
TIMESTAMP =
endif
diff --git a/TAO/TAO_IDL/be/be_attribute.cpp b/TAO/TAO_IDL/be/be_attribute.cpp
index 294a7c4c0b2..28b4ff9c168 100644
--- a/TAO/TAO_IDL/be/be_attribute.cpp
+++ b/TAO/TAO_IDL/be/be_attribute.cpp
@@ -158,13 +158,24 @@ be_attribute::gen_client_stubs (void)
*cs << "{" << bt->tc_name () << ", PARAM_RETURN, ";
// Are we returning a pointer to value? i.e., is the type variable? If it is,
// we must tell the stub what is the size of the top level structure
- if (bt->size_type () == be_decl::VARIABLE)
+ be_type *prim;
+ if (bt->node_type () == AST_Decl::NT_typedef)
{
- switch (bt->node_type ())
+ be_typedef *tdef = be_typedef::narrow_from_decl (bt);
+ prim = tdef->primitive_base_type ();
+ }
+ else
+ prim = bt;
+ if (prim->size_type () == be_decl::VARIABLE)
+ {
+ switch (prim->node_type ())
{
case AST_Decl::NT_interface:
case AST_Decl::NT_interface_fwd:
case AST_Decl::NT_string:
+ case AST_Decl::NT_sequence:
+ case AST_Decl::NT_struct:
+ case AST_Decl::NT_union:
// no need of size here
*cs << "0}";
break;
@@ -264,7 +275,38 @@ be_attribute::gen_client_stubs (void)
// call do_call with appropriate number of arguments
*cs << "istub->do_call (env, &_get_" << this->flatname () <<
- "_calldata, &retval);" << nl;
+ "_calldata";
+
+ if (bt->node_type () == AST_Decl::NT_typedef)
+ {
+ be_typedef *tdef = be_typedef::narrow_from_decl (bt);
+ prim = tdef->primitive_base_type ();
+ }
+ else
+ prim = bt;
+
+ if (prim->size_type () == be_decl::VARIABLE)
+ {
+ switch (prim->node_type ())
+ {
+ case AST_Decl::NT_interface:
+ case AST_Decl::NT_interface_fwd:
+ case AST_Decl::NT_string:
+ *cs << ", &retval";
+ break;
+ case AST_Decl::NT_sequence:
+ case AST_Decl::NT_struct:
+ case AST_Decl::NT_union:
+ *cs << ", retval";
+ break;
+ default:
+ *cs << ", &retval";
+ }
+ }
+ else
+ *cs << ", &retval";
+
+ *cs << ");" << nl;
// return the retval
cg->push (TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_RETURN_CS);
diff --git a/TAO/TAO_IDL/be/be_operation.cpp b/TAO/TAO_IDL/be/be_operation.cpp
index c7339340121..09b84b5612f 100644
--- a/TAO/TAO_IDL/be/be_operation.cpp
+++ b/TAO/TAO_IDL/be/be_operation.cpp
@@ -212,7 +212,15 @@ be_operation::gen_client_stubs (void)
// Are we returning a pointer to value? i.e., is the type
// variable? If it is, we must tell the stub what is the size of
// the top level structure
- if (bt->size_type () == be_decl::VARIABLE)
+ be_type *prim;
+ if (bt->node_type () == AST_Decl::NT_typedef)
+ {
+ be_typedef *tdef = be_typedef::narrow_from_decl (bt);
+ prim = tdef->primitive_base_type ();
+ }
+ else
+ prim = bt;
+ if (prim->size_type () == be_decl::VARIABLE)
{
switch (bt->node_type ())
{
diff --git a/TAO/TAO_IDL/be/be_state_attribute.cpp b/TAO/TAO_IDL/be/be_state_attribute.cpp
index 315503929cf..94cf9500bae 100644
--- a/TAO/TAO_IDL/be/be_state_attribute.cpp
+++ b/TAO/TAO_IDL/be/be_state_attribute.cpp
@@ -930,11 +930,12 @@ be_state_attribute::gen_code (be_type *bt, be_decl *d, be_type *type)
{
// nothing
}
- break;
+ break;
break;
case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_DECL_CS:
{
- *os << bt->name () << " *retval = 0;" << nl;
+ *os << bt->name () << " *retval = new " << bt->name () << ";" <<
+ nl;
}
break;
case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_EXCEPTION_CS:
diff --git a/TAO/TAO_IDL/be/be_state_operation.cpp b/TAO/TAO_IDL/be/be_state_operation.cpp
index b0f25bf33f8..8e0a255232e 100644
--- a/TAO/TAO_IDL/be/be_state_operation.cpp
+++ b/TAO/TAO_IDL/be/be_state_operation.cpp
@@ -475,7 +475,8 @@ be_state_operation::gen_code (be_type *bt, be_decl *d, be_type *type)
break;
case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS:
{
- *os << bt->name () << " *retval = 0;" << nl;
+ *os << bt->name () << " *retval = new " << bt->name () << ";" <<
+ nl;
}
break;
case TAO_CodeGen::TAO_OPERATION_RETVAL_EXCEPTION_CS:
@@ -603,7 +604,8 @@ be_state_operation::gen_code (be_type *bt, be_decl *d, be_type *type)
{
if (bt->size_type () == be_decl::VARIABLE)
{
- *os << bt->name () << " *retval;" << nl;
+ *os << bt->name () << " *retval = new " << bt->name () << ";"
+ << nl;
}
else
{
diff --git a/TAO/VERSION b/TAO/VERSION
index b02178fb16e..5342674e9a3 100644
--- a/TAO/VERSION
+++ b/TAO/VERSION
@@ -1,4 +1,4 @@
-This is TAO version 0.0.53, released Sun Jan 04 17:19:34 1998.
+This is TAO version 0.0.54, released Wed Jan 21 20:49:51 1998.
If you have any problems with TAO, please send email to Douglas
C. Schmidt (schmidt@cs.wustl.edu) and Chris Cleeland
diff --git a/TAO/orbsvcs/Event_Service/GPlot_File.cpp b/TAO/orbsvcs/Event_Service/GPlot_File.cpp
index 926fc16537d..6967cc932fe 100644
--- a/TAO/orbsvcs/Event_Service/GPlot_File.cpp
+++ b/TAO/orbsvcs/Event_Service/GPlot_File.cpp
@@ -165,15 +165,15 @@ ACE_GPlot_File::set (long entry, float value)
#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-template class ACE_Map_Entry<long, char *>;
+template class ACE_Map_Manager<long, char *, ACE_Null_Mutex>;
template class ACE_Map_Iterator_Base<long, char *, ACE_Null_Mutex>;
template class ACE_Map_Iterator<long, char *, ACE_Null_Mutex>;
template class ACE_Map_Reverse_Iterator<long, char *, ACE_Null_Mutex>;
-template class ACE_Map_Manager<long, char *, ACE_Null_Mutex>;
+template class ACE_Map_Entry<long, char *>;
#elif defined(ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
-#pragma instantiate ACE_Map_Entry<long, char *>
+#pragma instantiate ACE_Map_Manager<long, char *, ACE_Null_Mutex>
#pragma instantiate ACE_Map_Iterator_Base<long, char *, ACE_Null_Mutex>
#pragma instantiate ACE_Map_Iterator<long, char *, ACE_Null_Mutex>
#pragma instantiate ACE_Map_Reverse_Iterator<long, char *, ACE_Null_Mutex>
-#pragma instantiate ACE_Map_Manager<long, char *, ACE_Null_Mutex>
+#pragma instantiate ACE_Map_Entry<long, char *>
#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
diff --git a/TAO/orbsvcs/Event_Service/Makefile b/TAO/orbsvcs/Event_Service/Makefile
index a1b69ec958b..1cfda509b38 100644
--- a/TAO/orbsvcs/Event_Service/Makefile
+++ b/TAO/orbsvcs/Event_Service/Makefile
@@ -11,7 +11,6 @@ LSRC = \
CORBA_Utils_T.cpp \
Dispatching_Modules.cpp \
Event_Channel.cpp \
- GPlot_File.cpp \
Local_ESTypes.cpp \
Memory_Pools.cpp \
RT_Task.cpp \
diff --git a/TAO/orbsvcs/Naming_Service/Naming_Service.cpp b/TAO/orbsvcs/Naming_Service/Naming_Service.cpp
index 1632fe77168..bffdf3c9fc8 100644
--- a/TAO/orbsvcs/Naming_Service/Naming_Service.cpp
+++ b/TAO/orbsvcs/Naming_Service/Naming_Service.cpp
@@ -1,7 +1,7 @@
//
// $Id$
//
-#include <iostream.h>
+#include "ace/streams.h"
#include "CosNaming_i.h"
#include "Naming_Service.h"
diff --git a/TAO/orbsvcs/orbsvcs/AVStreams.idl b/TAO/orbsvcs/orbsvcs/AVStreams.idl
index bd8de25c306..cef01d8a67d 100644
--- a/TAO/orbsvcs/orbsvcs/AVStreams.idl
+++ b/TAO/orbsvcs/orbsvcs/AVStreams.idl
@@ -1,3 +1,5 @@
+// -*-c++-*-
+
// $Id$
// IDL for Control and Management of Audio/Video Streams
@@ -9,7 +11,7 @@ module AVStreams{
struct QoS{
string QoSType;
- PropertyService::Properties QoSParams;
+ CosPropertyService::Properties QoSParams;
};
typedef sequence<QoS> streamQoS;
@@ -46,7 +48,7 @@ module AVStreams{
QoS theQoS;
};
- typedef PropertyService::Property streamEvent;
+ typedef CosPropertyService::Property streamEvent;
exception notSupported {};
exception PropertyException {};
@@ -61,7 +63,7 @@ module AVStreams{
exception QoSRequestFailed{
string reason;};
- interface Basic_StreamCtrl : PropertyService::PropertySet {
+ interface Basic_StreamCtrl : CosPropertyService::PropertySet {
// Empty flowSpec => apply operation to all flows
void stop(in flowSpec the_spec) raises (noSuchFlow);
@@ -124,7 +126,7 @@ module AVStreams{
raises (streamOpFailed);
};
- interface MCastConfigIf : PropertyService::PropertySet{
+ interface MCastConfigIf : CosPropertyService::PropertySet{
boolean set_peer(
in Object peer,
@@ -132,10 +134,9 @@ module AVStreams{
in flowSpec the_spec)
raises (QoSRequestFailed, streamOpFailed);
- void configure(in PropertyService::Property a_configuration);
+ void configure(in CosPropertyService::Property a_configuration);
- void set_initial_configuration(
- in PropertyService::Properties initial);
+ void set_initial_configuration(in CosPropertyService::Properties initial);
// Uses <format_name> standardised by OMG and IETF
void set_format(in string flowName, in string format_name)
@@ -143,13 +144,13 @@ module AVStreams{
// Note, some of these device params are standardised by OMG
void set_dev_params(in string flowName,
- in PropertyService::Properties new_params)
- raises(PropertyService::PropertyException,
+ in CosPropertyService::Properties new_params)
+ raises(CosPropertyService::PropertyException,
streamOpFailed);
};
- interface StreamEndPoint : PropertyService::PropertySet{
+ interface StreamEndPoint : CosPropertyService::PropertySet{
void stop(in flowSpec the_spec) raises (noSuchFlow);
void start(in flowSpec the_spec) raises (noSuchFlow);
@@ -222,7 +223,7 @@ module AVStreams{
QoSRequestFailed, FPError);
};
- interface VDev : PropertyService::PropertySet{
+ interface VDev : CosPropertyService::PropertySet{
boolean set_peer(
in StreamCtrl the_ctrl,
@@ -237,7 +238,7 @@ module AVStreams{
in flowSpec the_spec)
raises (noSuchFlow, QoSRequestFailed, streamOpFailed);
- void configure(in PropertyService::Property the_config_mesg)
+ void configure(in CosPropertyService::Property the_config_mesg)
raises(PropertyException, streamOpFailed);
// Uses <formatName> standardised by OMG and IETF
@@ -246,7 +247,7 @@ module AVStreams{
// Note, some of these device params are standardised by OMG
void set_dev_params(in string flowName,
- in PropertyService::Properties new_params)
+ in CosPropertyService::Properties new_params)
raises(PropertyException, streamOpFailed);
boolean modify_QoS(inout streamQoS the_qos,
@@ -255,7 +256,7 @@ module AVStreams{
};
- interface MMDevice : PropertyService::PropertySet {
+ interface MMDevice : CosPropertyService::PropertySet {
StreamEndPoint_A create_A(
in StreamCtrl the_requester,
out VDev the_vdev,
diff --git a/TAO/orbsvcs/orbsvcs/Makefile b/TAO/orbsvcs/orbsvcs/Makefile
index 8e954a7b0c4..fb84cd685e6 100644
--- a/TAO/orbsvcs/orbsvcs/Makefile
+++ b/TAO/orbsvcs/orbsvcs/Makefile
@@ -24,6 +24,7 @@ FILES= $(IDL_FILES) \
Scheduler_Factory \
Runtime_Scheduler \
Scheduler_Utilities \
+ TAO_IDL_templates \
DEFS = $(addsuffix .h,$(FILES))
LSRC = $(addsuffix .cpp,$(FILES))
diff --git a/TAO/orbsvcs/tests/Simple_Naming/clnt.cpp b/TAO/orbsvcs/tests/Simple_Naming/clnt.cpp
index f657ce240e8..10ecfeefada 100644
--- a/TAO/orbsvcs/tests/Simple_Naming/clnt.cpp
+++ b/TAO/orbsvcs/tests/Simple_Naming/clnt.cpp
@@ -28,7 +28,7 @@ CosNaming_Client::CosNaming_Client (void)
factory_ (CORBA::Object::_nil ()),
objref_ (CORBA::Object::_nil ()),
CosNaming_ (CosNaming::NamingContext::_nil ()),
- cosnaming_factory_key_ ("naming_context")
+ cosnaming_factory_key_ ("NameService")
{
}
@@ -109,12 +109,12 @@ CosNaming_Client::init (int argc, char **argv)
if (this->env_.exception () != 0)
{
this->env_.print_exception ("ORB initialization");
- return 1;
+ return -1;
}
// Parse command line and verify parameters.
if (this->parse_args () == -1)
- return 1;
+ return -1;
// Retrieve a factory objref.
this->objref_ = CosNaming::NamingContext::_bind (this->hostname_,
@@ -125,7 +125,7 @@ CosNaming_Client::init (int argc, char **argv)
if (this->env_.exception () != 0)
{
this->env_.print_exception ("CosNaming_Factory::_bind");
- return 1;
+ return -1;
}
if (CORBA::is_nil (this->objref_) == CORBA::B_TRUE)
@@ -134,7 +134,7 @@ CosNaming_Client::init (int argc, char **argv)
this->cosnaming_factory_key_,
this->hostname_,
this->portnum_),
- 1);
+ -1);
// Narrow the CORBA::Object reference to the stub object, checking
// the type along the way using _is_a. There is really no need to
@@ -148,18 +148,18 @@ CosNaming_Client::init (int argc, char **argv)
if (this->CosNaming_ == 0)
ACE_ERROR_RETURN ((LM_ERROR,
" (%P|%t) Unable to narrow object reference to a CosNaming_ptr.\n"),
- 1);
+ -1);
if (this->env_.exception () != 0)
{
this->env_.print_exception ("CosNaming::NamingContext::_narrow");
- return 1;
+ return -1;
}
if (CORBA::is_nil (this->CosNaming_))
ACE_ERROR_RETURN ((LM_ERROR,
"null CosNaming objref returned by factory\n"),
- 1);
+ -1);
return 0;
}
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Makefile b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Makefile
index a516f6b3cfc..7e372e3ba2a 100644
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Makefile
+++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Makefile
@@ -12,12 +12,17 @@
LDLIBS = -lTAO
IDL_SRC = cubitC.cpp cubitS.cpp
-PROG_SRCS = server.cpp cubit_i.cpp Task_Client.cpp client.cpp Util_Thread.cpp
+PROG_SRCS = server.cpp \
+ cubit_i.cpp \
+ Task_Client.cpp \
+ client.cpp \
+ Util_Thread.cpp \
+ tmplinst.cpp
LSRC = $(IDL_SRC) $(PROG_SRCS)
-CUBIT_SVR_OBJS = cubitC.o cubitS.o server.o cubit_i.o
-CUBIT_CLIENT_OBJS = cubitC.o Task_Client.o client.o Util_Thread.o
+CUBIT_SVR_OBJS = cubitC.o cubitS.o server.o cubit_i.o tmplinst.o
+CUBIT_CLIENT_OBJS = cubitC.o Task_Client.o client.o Util_Thread.o tmplinst.o
BIN = server client
BUILD = $(BIN)
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/README b/TAO/performance-tests/Cubit/TAO/MT_Cubit/README
index ecf6fc3a6d1..0027aca76b9 100644
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/README
+++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/README
@@ -12,7 +12,7 @@ the client or open a separate window for the client and server.
server:
-------
-./svr -p <port_num> -h <my_hostname> -t <number_of_servants>
+./server -p <port_num> -h <my_hostname> -t <number_of_servants>
port_num is the port number at which the server will start the first
(and highest priority) servant. Successive servants (with successively
@@ -25,7 +25,8 @@ by the client.
client:
-------
-./client -d <datatype> -p <port_num> -h <server_hostname> -n <num_calls> -t <num_of_clients> [-r]
+./client -ORBobjrefstyle url -p <port_num> -h <server_hostname>
+ -d <datatype> -n <num_calls> -t <num_of_clients> [-r]
<datatype> is one of the following:
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp b/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp
index 5d8ba4d0da0..4ec478f6ea9 100644
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp
+++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp
@@ -59,8 +59,15 @@ do_priority_inversion_test (Task_State &ts)
// Now activate the high priority client.
-
+
+ // @@ The ifdef here is temporarily placed here until
+ // I figure out how to map NT's thread priorities
+ // into pthread's priorities.
+#if defined (ACE_THR_PRI_FIFO_DEF)
priority = ACE_THR_PRI_FIFO_DEF;
+#else
+ priority = ACE_DEFAULT_THREAD_PRIORITY;
+#endif
if (high_priority_client.activate (THR_BOUND | ACE_SCHED_FIFO,
1,
@@ -213,4 +220,5 @@ main (int argc, char *argv [])
do_priority_inversion_test (ts);
else
do_thread_per_rate_test (ts);
+ return 0;
}
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/server.cpp b/TAO/performance-tests/Cubit/TAO/MT_Cubit/server.cpp
index d21f6c81194..4158bd5fc2c 100644
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/server.cpp
+++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/server.cpp
@@ -168,7 +168,7 @@ Cubit_Task::create_servants ()
ACE_DEBUG ((LM_DEBUG,"Object Created at: '%ul'", obj));
CORBA::string_free (obj_str);
}
-
+ return 0;
}
// Global options used to configure various parameters.
@@ -269,7 +269,14 @@ start_servants ()
ACE_Sched_Priority priority;
+ // @@ The ifdef here is temporarily placed here until
+ // I figure out how to map NT's thread priorities
+ // into pthread's priorities.
+#if defined (ACE_THR_PRI_FIFO_DEF)
priority = ACE_THR_PRI_FIFO_DEF;
+#else
+ priority = ACE_DEFAULT_THREAD_PRIORITY;
+#endif /* ACE_THR_PRI_FIFO_DEF */
ACE_DEBUG ((LM_DEBUG,
"Creating servant with high priority\n"));
diff --git a/TAO/tao/corbacom.h b/TAO/tao/corbacom.h
index 2a00436af26..ae6d6ce4328 100644
--- a/TAO/tao/corbacom.h
+++ b/TAO/tao/corbacom.h
@@ -71,6 +71,8 @@ class CORBA_NVList;
//typedef class CORBA_NVList *CORBA_NVList_ptr;
class CORBA_ORB;
+class CORBA_ORB_var;
+class CORBA_ORB_out;
//typedef class CORBA_ORB *CORBA_ORB_ptr;
class CORBA_Object;
@@ -451,7 +453,9 @@ public:
typedef CORBA_Principal *Principal_ptr;
typedef CORBA_ORB ORB;
- typedef ORB *ORB_ptr;
+ typedef CORBA_ORB *ORB_ptr;
+ typedef CORBA_ORB_var ORB_var;
+ typedef CORBA_ORB_out ORB_out;
typedef CORBA_Request Request;
typedef Request *Request_ptr;
diff --git a/TAO/tao/decode.cpp b/TAO/tao/decode.cpp
index 97bf949b825..eac7514c125 100644
--- a/TAO/tao/decode.cpp
+++ b/TAO/tao/decode.cpp
@@ -680,6 +680,8 @@ TAO_Marshal_Struct::decode (CORBA::TypeCode_ptr tc,
CORBA::TypeCode_ptr param;
CORBA::Long size, alignment;
+ void *start_addr = (void *)data;
+
// number of fields in the struct
int member_count = tc->member_count (env);
@@ -699,7 +701,9 @@ TAO_Marshal_Struct::decode (CORBA::TypeCode_ptr tc,
alignment = param->alignment (env);
if (env.exception () == 0)
{
- data = ptr_align_binary (data, alignment);
+ data = (const void *)((ptr_arith_t) ptr_align_binary (data, alignment) +
+ (ptr_arith_t) ptr_align_binary (start_addr, alignment) -
+ (ptr_arith_t) start_addr);
switch (param->kind_)
{
case CORBA::tk_null:
@@ -958,7 +962,7 @@ TAO_Marshal_String::decode (CORBA::TypeCode_ptr,
{
// note that the encoded length is 1 more than the length of the string
// because it also accounts for the terminating NULL character
-
+
str = (*(char **) data) = CORBA::string_alloc (len - 1);
// only allocate the string *after* the length was validated.
@@ -1127,6 +1131,7 @@ TAO_Marshal_Sequence::decode (CORBA::TypeCode_ptr tc,
{
continue_decoding = stream->get_long (*(CORBA::Long *) value);
value += size;
+
}
// CORBA::release (tc2);
if (continue_decoding == CORBA::B_TRUE)
diff --git a/TAO/tao/default_server.cpp b/TAO/tao/default_server.cpp
index 71ed06e3e83..c0f86364901 100644
--- a/TAO/tao/default_server.cpp
+++ b/TAO/tao/default_server.cpp
@@ -13,54 +13,6 @@
#include "tao/default_server.h"
#include "tao/orb_core.h"
-template <class SH>
-TAO_Reactive_Strategy<SH>::TAO_Reactive_Strategy (void)
-{}
-
-template <class SH>
-TAO_Reactive_Strategy<SH>::~TAO_Reactive_Strategy (void)
-{}
-
-template <class SH> int
-TAO_Reactive_Strategy<SH>::activate_svc_handler (SH *svc_handler, void *arg)
-{
- ACE_TRACE ("ACE_Reactive_Strategy<SVC_HANDLER>::activate_svc_handler");
-
- ACE_Reactor *r = TAO_ORB_Core_instance ()->reactor ();
-
- int result = 0;
-
- if (r == 0)
- result = -1;
-
- // Register with the Reactor with the appropriate <mask>.
- else if (r->register_handler (svc_handler, this->mask_) == -1)
- result = -1;
-
- // If the implementation of the reactor uses event associations
- else if (r->uses_event_associations ())
- {
- // If we don't have non-block on, it won't work with
- // WFMO_Reactor
- // This maybe too harsh
- // if (!ACE_BIT_ENABLED (this->flags_, ACE_NONBLOCK))
- // goto failure;
- if (svc_handler->open ((void *) this) != -1)
- return 0;
- else
- result = -1;
- }
- else
- // Call up to our parent to do the SVC_HANDLER initialization.
- return this->inherited::activate_svc_handler (svc_handler, arg);
-
- if (result == -1)
- svc_handler->close (0);
-
- return result;
-}
-
-
TAO_Default_Server_Strategy_Factory::TAO_Default_Server_Strategy_Factory (void)
: thread_flags_ (0),
object_table_size_ (TAO_DEFAULT_SERVER_OBJECT_TABLE_SIZE),
diff --git a/TAO/tao/default_server.h b/TAO/tao/default_server.h
index d9c102568f5..7ac576a9440 100644
--- a/TAO/tao/default_server.h
+++ b/TAO/tao/default_server.h
@@ -19,15 +19,7 @@
#include "tao/corba.h"
-template <class SH>
-class TAO_Reactive_Strategy : public ACE_Reactive_Strategy<SH>
-{
-public:
- TAO_Reactive_Strategy (void);
- ~TAO_Reactive_Strategy (void);
-
- virtual int activate_svc_handler (SH *sh, void *arg);
-};
+#include "tao/strategy_T.h"
class TAO_Default_Server_Strategy_Factory : public TAO_Server_Strategy_Factory
// = TITLE
diff --git a/TAO/tao/encode.cpp b/TAO/tao/encode.cpp
index 6ea62a79bf1..6d8e8cc98bc 100644
--- a/TAO/tao/encode.cpp
+++ b/TAO/tao/encode.cpp
@@ -318,6 +318,13 @@ TAO_Marshal_ObjRef::encode (CORBA::TypeCode_ptr,
if (CORBA::is_nil (obj))
{
+ // encode an empty type_id i.e., an empty string
+ stream->put_ulong (1);
+ stream->put_char (0);
+
+ // Number of profiles = 0
+ stream->put_ulong (0);
+
return CORBA::TypeCode::TRAVERSE_CONTINUE;
}
else
@@ -404,6 +411,8 @@ TAO_Marshal_Struct::encode (CORBA::TypeCode_ptr tc,
CORBA::TypeCode_ptr param;
CORBA::Long size, alignment;
+ void *start_addr = (void *)data;
+
if (env.exception () == 0)
{
int member_count = tc->member_count (env);
@@ -422,7 +431,10 @@ TAO_Marshal_Struct::encode (CORBA::TypeCode_ptr tc,
alignment = param->alignment (env);
if (env.exception () == 0)
{
- data = ptr_align_binary (data, alignment);
+ data = (const void *)
+ ((ptr_arith_t) ptr_align_binary (data, alignment) +
+ (ptr_arith_t) ptr_align_binary (start_addr, alignment) -
+ (ptr_arith_t) start_addr);
switch (param->kind_)
{
case CORBA::tk_null:
diff --git a/TAO/tao/giop.cpp b/TAO/tao/giop.cpp
index 2de40dfbe7c..844f943d4db 100644
--- a/TAO/tao/giop.cpp
+++ b/TAO/tao/giop.cpp
@@ -888,8 +888,6 @@ TAO_GIOP_Invocation::invoke (CORBA::ExceptionList &exceptions,
return TAO_GIOP_SYSTEM_EXCEPTION;
}
- delete [] reply_ctx.buffer;
-
if (!this->stream_.get_ulong (request_id)
|| request_id != this->my_request_id_
|| !this->stream_.get_ulong (reply_status)
@@ -1102,14 +1100,11 @@ CORBA::Boolean
TAO_GIOP_LocateRequestHeader::init (CDR &msg,
CORBA::Environment &env)
{
- CORBA::Boolean hdr_status;
-
- hdr_status = hdr_status && msg.get_ulong (this->request_id);
- hdr_status = hdr_status && msg.decode (&TC_opaque,
- &this->object_key,
- 0,
- env);
- return hdr_status;
+ return ( msg.get_ulong (this->request_id)
+ && msg.decode (&TC_opaque,
+ &this->object_key,
+ 0,
+ env));
}
// Initialize the request header from <msg>, setting <env> for errors.
@@ -1177,11 +1172,15 @@ TAO_GIOP::start_message (TAO_GIOP_MsgType type, CDR &msg)
}
#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-template class CORBA_SEQUENCE<TAO_GIOP_ServiceContext>;
+template class TAO_Unbounded_Sequence<TAO_GIOP_ServiceContext>;
+template class TAO_Unbounded_Sequence<TAO_IOP_TaggedComponent>;
+template class TAO_Unbounded_Sequence<TAO_GIOP_ServiceContext>;
template class CORBA_SEQUENCE<CORBA::Octet>;
template class CORBA_SEQUENCE<CORBA::TypeCode*>;
#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
-#pragma instantiate CORBA_SEQUENCE<TAO_GIOP_ServiceContext>
+#pragma instantiate TAO_Unbounded_Sequence<TAO_GIOP_ServiceContext>
+#pragma instantiate TAO_Unbounded_Sequence<TAO_IOP_TaggedComponent>
+#pragma instantiate TAO_Unbounded_Sequence<TAO_GIOP_ServiceContext>
#pragma instantiate CORBA_SEQUENCE<CORBA::Octet>
#pragma instantiate CORBA_SEQUENCE<CORBA::TypeCode*>
#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
diff --git a/TAO/tao/giop.h b/TAO/tao/giop.h
index 99bb59f0cce..2f5510e96c9 100644
--- a/TAO/tao/giop.h
+++ b/TAO/tao/giop.h
@@ -59,8 +59,7 @@ struct TAO_IOP_Tagged_Profile
TAO_opaque profile_data;
};
-typedef CORBA_SEQUENCE <TAO_IOP_Tagged_Profile>
- TAO_IOP_Tagged_Profile_Sequence;
+typedef TAO_Unbounded_Sequence<TAO_IOP_Tagged_Profile> TAO_IOP_Tagged_Profile_Sequence;
struct TAO_IOP_IOR
// = TITLE
@@ -109,8 +108,7 @@ struct TAO_IOP_TaggedComponent
TAO_opaque component_data;
};
-typedef CORBA_SEQUENCE <TAO_IOP_TaggedComponent>
- TAO_IOP_MultipleComponentProfile;
+typedef TAO_Unbounded_Sequence<TAO_IOP_TaggedComponent> TAO_IOP_MultipleComponentProfile;
// namespace TAO_GIOP
@@ -180,8 +178,7 @@ struct TAO_GIOP_ServiceContext
TAO_opaque context_data;
};
-typedef CORBA_SEQUENCE <TAO_GIOP_ServiceContext>
- TAO_GIOP_ServiceContextList;
+typedef TAO_Unbounded_Sequence<TAO_GIOP_ServiceContext> TAO_GIOP_ServiceContextList;
extern CORBA::TypeCode TC_ServiceContextList;
diff --git a/TAO/tao/interp.cpp b/TAO/tao/interp.cpp
index e1d25b20a01..6de1c818566 100644
--- a/TAO/tao/interp.cpp
+++ b/TAO/tao/interp.cpp
@@ -290,7 +290,8 @@ declare_entry (CORBA::Principal_ptr, tk_Principal);
declare_entry (CORBA::Object_ptr, tk_objref);
declare_entry (CORBA::String, tk_string);
-declare_entry (CORBA::OctetSeq, tk_sequence);
+//declare_entry (CORBA::OctetSeq, tk_sequence);
+declare_entry (TAO_opaque, tk_sequence);
declare_entry (CORBA::LongLong, tk_longlong);
declare_entry (CORBA::ULongLong, tk_ulonglong);
@@ -326,7 +327,8 @@ __TC_init_table (void)
table [CORBA::tk_enum].alignment = sizeof (generic_enum);
setup_entry (CORBA::String, tk_string);
- setup_entry (CORBA::OctetSeq, tk_sequence);
+ // setup_entry (CORBA::OctetSeq, tk_sequence);
+ setup_entry (TAO_opaque, tk_sequence);
setup_entry (CORBA::LongLong, tk_longlong);
setup_entry (CORBA::ULongLong, tk_ulonglong);
diff --git a/TAO/tao/nvlist.h b/TAO/tao/nvlist.h
index 00143ce3555..f0c93970a12 100644
--- a/TAO/tao/nvlist.h
+++ b/TAO/tao/nvlist.h
@@ -31,7 +31,7 @@ class TAO_Export CORBA_NamedValue
// the value is packaged as an Any. The flags indicate parameter
// mode, and some ownership rules for "top level" memory.
public:
- TAO_CONST char *name (void) const;
+ const char *name (void) const;
// optional name
CORBA::Any_ptr value (void) const;
diff --git a/TAO/tao/nvlist.i b/TAO/tao/nvlist.i
index b7fc4ea2624..e4b35074884 100644
--- a/TAO/tao/nvlist.i
+++ b/TAO/tao/nvlist.i
@@ -31,7 +31,7 @@ CORBA_NamedValue::CORBA_NamedValue (void)
}
// return the name
-ACE_INLINE TAO_CONST char*
+ACE_INLINE const char*
CORBA_NamedValue::name (void) const
{
return this->name_;
@@ -41,7 +41,7 @@ CORBA_NamedValue::name (void) const
ACE_INLINE CORBA::Any_ptr
CORBA_NamedValue::value (void) const
{
- return (const CORBA::Any_ptr)&this->any_;
+ return ACE_const_cast(CORBA::Any_ptr,&this->any_);
}
// return the flags
diff --git a/TAO/tao/sequence.cpp b/TAO/tao/sequence.cpp
index 746ec881c06..99d2c2c0c47 100644
--- a/TAO/tao/sequence.cpp
+++ b/TAO/tao/sequence.cpp
@@ -32,7 +32,7 @@ TAO_String_Manager::operator=(const TAO_String_Manager &rhs)
if (this == &rhs)
return *this;
- if (this->release_) // need to free old one
+ if (this->release_)
{
CORBA::string_free (*this->ptr_);
*this->ptr_ = CORBA::string_dup (*rhs.ptr_);
@@ -55,6 +55,7 @@ TAO_String_Manager::operator= (const char * p)
}
else
{
+ // @@ TODO find out why was this cast needed.
*this->ptr_ = ACE_const_cast(char*,p);
}
return *this;
@@ -71,18 +72,15 @@ TAO_Unbounded_String_Sequence (CORBA::ULong maximum)
}
TAO_Unbounded_String_Sequence::
-TAO_Unbounded_String_Sequence (const TAO_Unbounded_String_Sequence &seq)
- : TAO_Unbounded_Base_Sequence (seq)
+TAO_Unbounded_String_Sequence (const TAO_Unbounded_String_Sequence &rhs)
+ : TAO_Unbounded_Base_Sequence (rhs)
{
- this->buffer_ =
- TAO_Unbounded_String_Sequence::allocbuf (this->maximum_);
-
- char* *tmp1 = ACE_reinterpret_cast(char* *,this->buffer_);
- char* *tmp2 = ACE_reinterpret_cast(char* *,seq.buffer_);
- for (CORBA::ULong i = 0; i < seq.length_; ++i)
- tmp1 [i] = CORBA::string_dup (tmp2 [i]);
+ char* *tmp1 = TAO_Unbounded_String_Sequence::allocbuf (this->maximum_);
- this->release_ = 1;
+ char* *tmp2 = ACE_reinterpret_cast(char* *,rhs.buffer_);
+ for (CORBA::ULong i = 0; i < rhs.length_; ++i)
+ tmp1[i] = CORBA::string_dup (tmp2[i]);
+ this->buffer_ = tmp1;
}
TAO_Unbounded_String_Sequence::~TAO_Unbounded_String_Sequence (void)
@@ -92,9 +90,9 @@ TAO_Unbounded_String_Sequence::~TAO_Unbounded_String_Sequence (void)
TAO_Unbounded_String_Sequence&
TAO_Unbounded_String_Sequence::
-operator= (const TAO_Unbounded_String_Sequence &seq)
+operator= (const TAO_Unbounded_String_Sequence &rhs)
{
- if (this == &seq)
+ if (this == &rhs)
return *this;
if (this->release_)
@@ -103,24 +101,27 @@ operator= (const TAO_Unbounded_String_Sequence &seq)
for (CORBA::ULong i = 0; i < this->length_; ++i)
{
CORBA::string_free (tmp[i]);
+ tmp[i] = 0;
}
- if (this->maximum_ < seq.maximum_)
+ if (this->maximum_ < rhs.maximum_)
{
+ // free the older buffer
+ TAO_Unbounded_String_Sequence::freebuf (tmp);
this->buffer_ =
- TAO_Unbounded_String_Sequence::allocbuf (seq.maximum_);
+ TAO_Unbounded_String_Sequence::allocbuf (rhs.maximum_);
}
}
else
{
this->buffer_ =
- TAO_Unbounded_String_Sequence::allocbuf (this->maximum_);
+ TAO_Unbounded_String_Sequence::allocbuf (rhs.maximum_);
}
+ TAO_Unbounded_Base_Sequence::operator= (rhs);
char* *tmp1 = ACE_reinterpret_cast(char* *,this->buffer_);
- char* *tmp2 = ACE_reinterpret_cast(char* *,seq.buffer_);
- CORBA::ULong i=0;
- for (; i < seq.length_; ++i)
- tmp1 [i] = CORBA::string_dup (tmp2 [i]);
+ char* *tmp2 = ACE_reinterpret_cast(char* *,rhs.buffer_);
+ for (CORBA::ULong i=0; i < rhs.length_; ++i)
+ tmp1[i] = CORBA::string_dup (tmp2[i]);
return *this;
}
@@ -152,15 +153,13 @@ TAO_Unbounded_String_Sequence::freebuf (char* *buffer)
// Mark the length in the first four bytes? For the moment we let
// that be.
- char* *tmp = ACE_reinterpret_cast (char**,buffer);
- delete[] tmp;
+ delete[] buffer;
}
void
TAO_Unbounded_String_Sequence::_allocate_buffer (CORBA::ULong length)
{
- char* *tmp;
- ACE_NEW (tmp, char* [length]);
+ char* *tmp = TAO_Unbounded_String_Sequence::allocbuf (length);
if (this->buffer_ != 0)
{
@@ -194,8 +193,9 @@ TAO_Unbounded_String_Sequence::_deallocate_buffer (void)
++i)
{
CORBA::string_free (tmp[i]);
+ tmp[i] = 0;
}
- delete[] tmp;
+ TAO_Unbounded_String_Sequence::freebuf (tmp);
this->buffer_ = 0;
}
@@ -204,6 +204,9 @@ TAO_Unbounded_String_Sequence::_shrink_buffer (CORBA::ULong nl,
CORBA::ULong ol)
{
char* *tmp = ACE_reinterpret_cast (char**,this->buffer_);
- for (CORBA::ULong i = ol; i < nl; ++i)
- CORBA::string_free (tmp[i]);
+ for (CORBA::ULong i = nl; i < ol; ++i)
+ {
+ CORBA::string_free (tmp[i]);
+ tmp[i] = 0;
+ }
}
diff --git a/TAO/tao/sequence.h b/TAO/tao/sequence.h
index 1437048dad8..c9e78425f93 100644
--- a/TAO/tao/sequence.h
+++ b/TAO/tao/sequence.h
@@ -61,7 +61,7 @@ protected:
TAO_Base_Sequence (CORBA::ULong maximum,
CORBA::ULong length,
void* buffer,
- CORBA::Boolean release = 0);
+ CORBA::Boolean release = CORBA::B_FALSE);
// Constructor with control of ownership.
TAO_Base_Sequence (CORBA::ULong maximum,
@@ -225,15 +225,14 @@ private:
// control memory managment semantics.
};
-class TAO_Unbounded_String_Sequence : public TAO_Unbounded_Base_Sequence
+class TAO_Export TAO_Unbounded_String_Sequence : public TAO_Unbounded_Base_Sequence
{
// =TITLE
- // Parametric sequence for types that require managers.
+ // Unbounded sequence of strings.
//
// =DESCRIPTION
- // Some IDL types require that sequences on them have a "manager"
- // class, in charge of handling the object lifetime, examples are
- // pseudo objects, object references and strings.
+ // IDL sequences of strings must automatically duplicate and
+ // release their members based on some global <release> flag.
// = SPEC
// 16.8 Mapping for Structured Types
diff --git a/TAO/tao/sequence.i b/TAO/tao/sequence.i
index 9b728b899c5..5a5cb3c3fdb 100644
--- a/TAO/tao/sequence.i
+++ b/TAO/tao/sequence.i
@@ -43,7 +43,7 @@ TAO_Base_Sequence::TAO_Base_Sequence (CORBA::ULong maximum,
: maximum_ (maximum),
length_ (0),
buffer_ (data),
- release_ (1)
+ release_ (CORBA::B_TRUE)
{
}
@@ -51,19 +51,16 @@ ACE_INLINE
TAO_Base_Sequence::TAO_Base_Sequence (const TAO_Base_Sequence &rhs)
: maximum_ (rhs.maximum_),
length_ (rhs.length_),
- release_ (1)
+ release_ (CORBA::B_TRUE)
{
}
ACE_INLINE TAO_Base_Sequence &
TAO_Base_Sequence::operator= (const TAO_Base_Sequence &rhs)
{
- if (this != &rhs)
- {
- this->maximum_ = rhs.maximum_;
- this->length_ = rhs.length_;
- this->release_ = CORBA::B_TRUE;
- }
+ this->maximum_ = rhs.maximum_;
+ this->length_ = rhs.length_;
+ this->release_ = CORBA::B_TRUE;
return *this;
}
@@ -111,8 +108,9 @@ TAO_Unbounded_Base_Sequence::length (CORBA::ULong length)
{
this->_allocate_buffer (length);
this->maximum_ = length;
+ this->release_ = CORBA::B_TRUE;
}
- else
+ else if (length < this->length_)
{
this->_shrink_buffer (length, this->length_);
}
@@ -157,7 +155,7 @@ TAO_Bounded_Base_Sequence::length (CORBA::ULong length)
{
return;
}
- else
+ else if (length < this->length_)
{
this->_shrink_buffer (length, this->length_);
}
diff --git a/TAO/tao/sequence_T.cpp b/TAO/tao/sequence_T.cpp
index c37df3a72e4..f12347feaeb 100644
--- a/TAO/tao/sequence_T.cpp
+++ b/TAO/tao/sequence_T.cpp
@@ -18,32 +18,43 @@ TAO_Unbounded_Sequence<T>::
TAO_Unbounded_Sequence (const TAO_Unbounded_Sequence<T> &rhs)
: TAO_Unbounded_Base_Sequence (rhs)
{
- this->buffer_ = TAO_Unbounded_Sequence<T>::allocbuf (this->maximum_);
- T* tmp = ACE_reinterpret_cast(T*,this->buffer_);
+ T* tmp1 = TAO_Unbounded_Sequence<T>::allocbuf (this->maximum_);
+ T* tmp2 = ACE_reinterpret_cast(T*, rhs.buffer_);
for (CORBA::ULong i = 0; i < this->length_; ++i)
- tmp[i] = rhs[i];
+ tmp1[i] = tmp2[i];
+ this->buffer_ = tmp1;
}
template <class T> TAO_Unbounded_Sequence<T> &
TAO_Unbounded_Sequence<T>::operator=
(const TAO_Unbounded_Sequence<T> &rhs)
{
- if (this != &rhs)
+ if (this == &rhs)
+ return *this;
+
+ if (this->release_)
{
- if (this->release_)
- {
- // free the old buffer
- T* tmp = ACE_reinterpret_cast(T*,this->buffer_);
- TAO_Unbounded_Sequence<T>::freebuf (tmp);
- }
-
- this->TAO_Base_Sequence::operator= (rhs);
- this->buffer_ = TAO_Unbounded_Sequence<T>::allocbuf (this->maximum_);
- this->release_ = 1;
- T* tmp = ACE_reinterpret_cast(T*,this->buffer_);
- for (CORBA::ULong i = 0; i < this->length_; ++i)
- tmp[i] = rhs[i];
+ if (this->maximum_ < rhs.maximum_)
+ {
+ // free the old buffer
+ T* tmp = ACE_reinterpret_cast(T*,this->buffer_);
+ TAO_Unbounded_Sequence<T>::freebuf (tmp);
+ this->buffer_ =
+ TAO_Unbounded_Sequence<T>::allocbuf (this->maximum_);
+ }
+ }
+ else
+ {
+ this->buffer_ =
+ TAO_Unbounded_Sequence<T>::allocbuf (rhs.maximum_);
}
+ TAO_Unbounded_Base_Sequence::operator= (rhs);
+
+ T* tmp1 = ACE_reinterpret_cast(T*,this->buffer_);
+ T* tmp2 = ACE_reinterpret_cast(T*,rhs.buffer_);
+ for (CORBA::ULong i = 0; i < this->length_; ++i)
+ tmp1[i] = tmp2[i];
+
return *this;
}
@@ -56,8 +67,7 @@ TAO_Unbounded_Sequence<T>::~TAO_Unbounded_Sequence (void)
template<class T>
void TAO_Unbounded_Sequence<T>::_allocate_buffer (CORBA::ULong length)
{
- T* tmp;
- ACE_NEW (tmp, T[length]);
+ T* tmp = TAO_Unbounded_Sequence<T>::allocbuf (length);
if (this->buffer_ != 0)
{
@@ -66,7 +76,8 @@ void TAO_Unbounded_Sequence<T>::_allocate_buffer (CORBA::ULong length)
{
tmp[i] = old[i];
}
- delete[] old;
+ if (this->release_)
+ delete[] old;
}
this->buffer_ = tmp;
}
@@ -77,7 +88,7 @@ void TAO_Unbounded_Sequence<T>::_deallocate_buffer (void)
if (this->buffer_ == 0 || this->release_ == 0)
return;
T* tmp = ACE_reinterpret_cast (T*,this->buffer_);
- delete[] tmp;
+ TAO_Unbounded_Sequence<T>::freebuf (tmp);
this->buffer_ = 0;
}
@@ -90,24 +101,48 @@ TAO_Bounded_Sequence<T,MAX>::
TAO_Bounded_Sequence (const TAO_Bounded_Sequence<T,MAX> &rhs)
: TAO_Bounded_Base_Sequence (rhs)
{
- this->buffer_ = TAO_Bounded_Sequence<T,MAX>::allocbuf (MAX);
- T* tmp = ACE_reinterpret_cast(T*,this->buffer_);
+ T* tmp1 = TAO_Bounded_Sequence<T,MAX>::allocbuf (MAX);
+
+ T* tmp2 = ACE_reinterpret_cast(T*,rhs.buffer_);
for (CORBA::ULong i = 0; i < this->length_; ++i)
- tmp[i] = rhs[i];
+ tmp1[i] = tmp2[i];
+ this->buffer_ = tmp1;
}
template <class T, CORBA::ULong MAX> TAO_Bounded_Sequence<T,MAX> &
-TAO_Bounded_Sequence<T,MAX>::operator= (const TAO_Bounded_Sequence<T,MAX> &rhs)
+TAO_Bounded_Sequence<T,MAX>::
+operator= (const TAO_Bounded_Sequence<T,MAX> &rhs)
{
- if (this != &rhs)
+ if (this == &rhs)
+ return *this;
+
+ if (this->release_)
{
- this->TAO_Base_Sequence::operator= (rhs);
- this->buffer_ = TAO_Unbounded_Sequence<T>::allocbuf (this->maximum_);
- this->release_ = 1;
- T* tmp = ACE_reinterpret_cast(T*,this->buffer_);
- for (CORBA::ULong i = 0; i < this->length_; ++i)
- tmp[i] = seq[i];
+#if 0
+ // We never need to reallocate the buffer because they are
+ // always of size MAX.
+ if (this->maximum_ < rhs.maximum_)
+ {
+ // free the old buffer
+ T* tmp = ACE_reinterpret_cast(T*,this->buffer_);
+ TAO_Bounded_Sequence<T>::freebuf (tmp);
+ this->buffer_ =
+ TAO_Bounded_Sequence<T>::allocbuf (this->maximum_);
+ }
+#endif /* 0 */
+ }
+ else
+ {
+ this->buffer_ =
+ TAO_Unbounded_Sequence<T>::allocbuf (rhs.maximum_);
}
+ TAO_Bounded_Base_Sequence::operator= (rhs);
+
+ T* tmp1 = ACE_reinterpret_cast(T*,this->buffer_);
+ T* tmp2 = ACE_reinterpret_cast(T*,rhs.buffer_);
+ for (CORBA::ULong i = 0; i < this->length_; ++i)
+ tmp1[i] = tmp2[i];
+
return *this;
}
@@ -122,8 +157,8 @@ void TAO_Bounded_Sequence<T,MAX>::_allocate_buffer (CORBA::ULong)
{
// For this class memory is never reallocated so the implementation
// is *really* simple.
- ACE_NEW (this->buffer_, T[MAX]);
- this->maximum_ = MAX;
+ this->buffer_ =
+ TAO_Bounded_Sequence<T,MAX>::allocbuf (MAX);
}
template<class T, CORBA::ULong MAX>
@@ -132,7 +167,7 @@ void TAO_Bounded_Sequence<T,MAX>::_deallocate_buffer (void)
if (this->buffer_ == 0 || this->release_ == 0)
return;
T* tmp = ACE_reinterpret_cast (T*,this->buffer_);
- delete[] tmp;
+ TAO_Bounded_Sequence<T,MAX>::freebuf (MAX);
this->buffer_ = 0;
}
@@ -140,19 +175,6 @@ void TAO_Bounded_Sequence<T,MAX>::_deallocate_buffer (void)
// class TAO_Object_Manager
// *************************************************************
-// destructor
-template <class T>
-TAO_Object_Manager<T>::~TAO_Object_Manager (void)
-{
-}
-
-template <class T>
-TAO_Object_Manager<T>::TAO_Object_Manager (const TAO_Object_Manager &rhs)
- : ptr_ (rhs.ptr_),
- release_ (rhs.release_)
-{
-}
-
template <class T>
TAO_Object_Manager<T>&
TAO_Object_Manager<T>::operator= (const TAO_Object_Manager<T> &rhs)
@@ -167,7 +189,7 @@ TAO_Object_Manager<T>::operator= (const TAO_Object_Manager<T> &rhs)
}
else
{
- this->ptr_ = rhs.ptr_;
+ *this->ptr_ = *rhs.ptr_;
}
return *this;
}
@@ -176,9 +198,18 @@ template <class T>
TAO_Object_Manager<T> &
TAO_Object_Manager<T>::operator=(T* p)
{
- if (this->release_) // need to free old one
- CORBA::release (*this->ptr_);
- *this->ptr_ = p; // no copy
+ if (this->release_)
+ {
+ // Only release after increasing refcount, otherwise it can fail
+ // for assignment on the same object.
+ T* tmp = *this->ptr_;
+ *this->ptr_ = T::_duplicate (p);
+ CORBA::release (tmp);
+ }
+ else
+ {
+ *this->ptr_ = p;
+ }
return *this;
}
@@ -195,36 +226,18 @@ TAO_Unbounded_Object_Sequence (CORBA::ULong maximum)
{
}
-// copy constructor
template <class T>
TAO_Unbounded_Object_Sequence<T>::
-TAO_Unbounded_Object_Sequence (const TAO_Unbounded_Object_Sequence<T> &seq)
- : TAO_Unbounded_Base_Sequence (seq)
+TAO_Unbounded_Object_Sequence (const TAO_Unbounded_Object_Sequence<T> &rhs)
+ : TAO_Unbounded_Base_Sequence (rhs)
{
- if (this->release_)
- {
- T* *tmp = ACE_reinterpret_cast(T* *,this->buffer_);
- for (CORBA::ULong i = 0; i < this->length_; ++i)
- {
- CORBA::release (tmp[i]);
- }
- if (this->maximum_ < seq.maximum_)
- {
- this->buffer_ =
- TAO_Unbounded_Object_Sequence<T>::allocbuf (seq.maximum_);
- }
- }
- else
- {
- this->buffer_ =
- TAO_Unbounded_Object_Sequence<T>::allocbuf (this->maximum_);
- }
+ T* *tmp1 = TAO_Unbounded_Object_Sequence<T>::allocbuf (this->maximum_);
- T* *tmp1 = ACE_reinterpret_cast(T* *,this->buffer_);
- T* *tmp2 = ACE_reinterpret_cast(T* *,seq.buffer_);
- for (CORBA::ULong i=0; i < seq.length_; i++)
- tmp1 [i] = T::_duplicate (tmp2 [i]);
- this->release_ = 1;
+ T* *tmp2 = ACE_reinterpret_cast(T* *,rhs.buffer_);
+ for (CORBA::ULong i = 0; i < rhs.length_; ++i)
+ tmp1[i] = T::_duplicate (tmp2[i]);
+
+ this->buffer_ = tmp1;
}
template<class T>
@@ -237,9 +250,9 @@ TAO_Unbounded_Object_Sequence<T>::~TAO_Unbounded_Object_Sequence (void)
template <class T>
TAO_Unbounded_Object_Sequence<T>&
TAO_Unbounded_Object_Sequence<T>::
-operator= (const TAO_Unbounded_Object_Sequence<T> &seq)
+operator= (const TAO_Unbounded_Object_Sequence<T> &rhs)
{
- if (this == &seq)
+ if (this == &rhs)
return *this;
if (this->release_)
@@ -248,24 +261,27 @@ operator= (const TAO_Unbounded_Object_Sequence<T> &seq)
for (CORBA::ULong i = 0; i < this->length_; ++i)
{
CORBA::release (tmp[i]);
+ tmp[i] = T::_nil ();
}
- if (this->maximum_ < seq.maximum_)
+ if (this->maximum_ < rhs.maximum_)
{
+ TAO_Unbounded_Object_Sequence<T>::freebuf (tmp);
this->buffer_ =
- TAO_Unbounded_Object_Sequence<T>::allocbuf (seq.maximum_);
+ TAO_Unbounded_Object_Sequence<T>::allocbuf (rhs.maximum_);
}
}
else
{
this->buffer_ =
- TAO_Unbounded_Object_Sequence<T>::allocbuf (this->maximum_);
+ TAO_Unbounded_Object_Sequence<T>::allocbuf (rhs.maximum_);
}
+ TAO_Unbounded_Base_Sequence::operator= (rhs);
T* *tmp1 = ACE_reinterpret_cast(T* *,this->buffer_);
- T* *tmp2 = ACE_reinterpret_cast(T* *,seq.buffer_);
- for (CORBA::ULong i=0; i < seq.length_; i++)
- tmp1 [i] = T::_duplicate (tmp2 [i]);
- this->release_ = 1;
+ T* *tmp2 = ACE_reinterpret_cast(T* *,rhs.buffer_);
+ for (CORBA::ULong i = 0; i < rhs.length_; ++i)
+ tmp1[i] = T::_duplicate (tmp2[i]);
+
return *this;
}
@@ -296,15 +312,13 @@ TAO_Unbounded_Object_Sequence<T>::freebuf (T* *buffer)
// Mark the length in the first four bytes? For the moment we let
// that be.
- T* *tmp = ACE_reinterpret_cast (T**,buffer);
- delete[] tmp;
+ delete[] buffer;
}
template<class T>
void TAO_Unbounded_Object_Sequence<T>::_allocate_buffer (CORBA::ULong length)
{
- T* *tmp;
- ACE_NEW (tmp, T* [length]);
+ T* *tmp = TAO_Unbounded_Object_Sequence<T>::allocbuf (length);
if (this->buffer_ != 0)
{
@@ -317,9 +331,9 @@ void TAO_Unbounded_Object_Sequence<T>::_allocate_buffer (CORBA::ULong length)
// no need to copy them, if we did we would also have to
// remove the old instances.
if (!this->release_)
- tmp [i] = T::_duplicate (old[i]);
+ tmp[i] = T::_duplicate (old[i]);
else
- tmp [i] = old[i];
+ tmp[i] = old[i];
}
if (this->release_)
delete[] old;
@@ -338,8 +352,9 @@ void TAO_Unbounded_Object_Sequence<T>::_deallocate_buffer (void)
++i)
{
CORBA::release (tmp[i]);
+ tmp[i] = T::_nil ();
}
- delete[] tmp;
+ TAO_Unbounded_Object_Sequence<T>::freebuf (tmp);
this->buffer_ = 0;
}
@@ -348,76 +363,112 @@ TAO_Unbounded_Object_Sequence<T>::_shrink_buffer (CORBA::ULong nl,
CORBA::ULong ol)
{
T* *tmp = ACE_reinterpret_cast (T**,this->buffer_);
- for (CORBA::ULong i = ol; i < nl; ++i)
- CORBA::release (tmp[i]);
+ for (CORBA::ULong i = nl; i < ol; ++i)
+ {
+ CORBA::release (tmp[i]);
+ tmp[i] = T::_nil ();
+ }
}
// *************************************************************
// Operations for class TAO_Bounded_Object_Sequence
// *************************************************************
-template<class T, CORBA::ULong MAX>
-TAO_Bounded_Object_Sequence<T,MAX>::~TAO_Bounded_Object_Sequence (void)
+template <class T, CORBA::ULong MAX>
+TAO_Bounded_Object_Sequence<T,MAX>::
+TAO_Bounded_Object_Sequence (void)
+ : TAO_Bounded_Base_Sequence (MAX,
+ TAO_Bounded_Sequence<T,MAX>::allocbuf(MAX))
{
- this->_deallocate_buffer ();
}
template <class T, CORBA::ULong MAX>
TAO_Bounded_Object_Sequence<T,MAX>::
-TAO_Bounded_Object_Sequence (const TAO_Bounded_Object_Sequence<T,MAX> &seq)
- : TAO_Bounded_Base_Sequence (seq)
+TAO_Bounded_Object_Sequence (const TAO_Bounded_Object_Sequence<T,MAX> &rhs)
+ : TAO_Bounded_Base_Sequence (rhs)
{
- this->buffer_ = TAO_Bounded_Object_Sequence<T,MAX>::
- allocbuf (this->maximum_);
- T* *tmp1 = ACE_reinterpret_cast(T* *,this->buffer_);
- T* *tmp2 = ACE_reinterpret_cast(T* *,seq.buffer_);
- for (CORBA::ULong i=0; i < seq.length_; i++)
- tmp1 [i] = T::_duplicate (tmp2 [i]);
+ T* *tmp1 =
+ TAO_Bounded_Object_Sequence<T,MAX>::allocbuf (MAX);
+ T* *tmp2 = ACE_reinterpret_cast(T* *,rhs.buffer_);
+ for (CORBA::ULong i=0; i < rhs.length_; i++)
+ tmp1[i] = T::_duplicate (tmp2[i]);
+ this->buffer_ = tmp1;
}
-// assignment operator
template <class T, CORBA::ULong MAX>
TAO_Bounded_Object_Sequence<T,MAX>&
TAO_Bounded_Object_Sequence<T,MAX>::operator=
-(const TAO_Bounded_Object_Sequence<T,MAX> &seq)
+(const TAO_Bounded_Object_Sequence<T,MAX> &rhs)
{
- if (this == &seq)
+ if (this == &rhs)
return *this;
+
if (this->release_)
{
T* *tmp = ACE_reinterpret_cast (T* *,this->buffer_);
- TAO_Bounded_Object_Sequence<T,MAX>::freebuf (tmp);
+ for (CORBA::ULong i = 0; i < this->length_; ++i)
+ {
+ CORBA::release (tmp[i]);
+ tmp[i] = T::_nil ();
+ }
+ // No need to reallocate the buffer since it is always of size
+ // MAX
+#if 0
+ if (this->maximum_ < rhs.maximum_)
+ {
+ TAO_Bounded_Object_Sequence<T,MAX>::freebuf (tmp);
+ this->buffer_ =
+ TAO_Bounded_Object_Sequence<T,MAX>::allocbuf (rhs.maximum_);
+ }
+#endif /* 0 */
+ }
+ else
+ {
+ this->buffer_ =
+ TAO_Bounded_Object_Sequence<T,MAX>::allocbuf (rhs.maximum_);
}
+ TAO_Bounded_Base_Sequence::operator= (rhs);
+
T* *tmp1 = ACE_reinterpret_cast(T* *,this->buffer_);
- T* *tmp2 = ACE_reinterpret_cast(T* *,seq.buffer_);
- for (CORBA::ULong i=0; i < seq.length_; i++)
- tmp1 [i] = T::_duplicate (tmp2 [i]);
+ T* *tmp2 = ACE_reinterpret_cast(T* *,rhs.buffer_);
+ for (CORBA::ULong i=0; i < rhs.length_; ++i)
+ tmp1[i] = T::_duplicate (tmp2[i]);
return *this;
}
template <class T, CORBA::ULong MAX> T* *
-TAO_Bounded_Object_Sequence<T,MAX>::allocbuf (CORBA::ULong nelems)
+TAO_Bounded_Object_Sequence<T,MAX>::allocbuf (CORBA::ULong)
{
- T* *buf = new T*[nelems]; // allocate from heap
- for (CORBA::ULong i=0; i < nelems; i++)
+ T* *buf = new T*[MAX];
+ for (CORBA::ULong i=0; i < MAX; i++)
buf[i] = T::_nil ();
return buf;
}
-template<class T, CORBA::ULong MAX> void
-TAO_Bounded_Object_Sequence<T,MAX>::_allocate_buffer (CORBA::ULong length)
+template <class T, CORBA::ULong MAX> void
+TAO_Bounded_Object_Sequence<T,MAX>::freebuf (T* *buffer)
{
- T* *tmp;
- ACE_NEW (tmp, T* [length]);
-
- if (this->buffer_ != 0)
+ // How much do we deallocate? Easy! allocbuf() always creates MAX
+ // elements and initialize them to T::_nil(). So we can be
+ // complaint and call CORBA::release() on each one.
+ for (CORBA::ULong i = 0; i < MAX; ++i)
{
- T* *old = ACE_reinterpret_cast(T**,this->buffer_);
- for (CORBA::ULong i = 0; i < this->length_; ++i)
- tmp [i] = old[i];
- delete[] old;
+ if (buffer[i] != T::_nil ())
+ {
+ CORBA::release (buffer[i]);
+ buffer[i] = T::_nil ();
+ }
}
- this->buffer_ = tmp;
+ delete[] buffer;
+}
+
+template<class T, CORBA::ULong MAX> void
+TAO_Bounded_Object_Sequence<T,MAX>::_allocate_buffer (CORBA::ULong length)
+{
+ // For this class memory is never reallocated so the implementation
+ // is *really* simple.
+ this->buffer_ =
+ TAO_Bounded_Object_Sequence<T,MAX>::allocbuf (length);
}
template<class T, CORBA::ULong MAX>
@@ -426,9 +477,7 @@ void TAO_Bounded_Object_Sequence<T,MAX>::_deallocate_buffer (void)
if (this->buffer_ == 0 || this->release_ == 0)
return;
T* *tmp = ACE_reinterpret_cast (T**,this->buffer_);
- // XXXASG: Do we release each object here?
- // @@ TODO add static methods to Manager to release each object here.
- delete[] tmp;
+ TAO_Bounded_Object_Sequence<T,MAX>::freebuf (MAX);
this->buffer_ = 0;
}
@@ -437,8 +486,133 @@ TAO_Bounded_Object_Sequence<T,MAX>::_shrink_buffer (CORBA::ULong nl,
CORBA::ULong ol)
{
T* *tmp = ACE_reinterpret_cast (T**,this->buffer_);
- for (CORBA::ULong i = ol; i < nl; ++i)
- CORBA::release (tmp[i]);
+ for (CORBA::ULong i = nl; i < ol; ++i)
+ {
+ CORBA::release (tmp[i]);
+ tmp[i] = T::_nil ();
+ }
+}
+
+// *************************************************************
+// Operations for class TAO_Bounded_String_Sequence
+// *************************************************************
+
+template<CORBA::ULong MAX>
+TAO_Bounded_String_Sequence<MAX>::
+TAO_Bounded_String_Sequence (void)
+ : TAO_Bounded_Base_Sequence (MAX,
+ TAO_Bounded_String_Sequence<MAX>::allocbuf(MAX))
+{
+}
+
+template<CORBA::ULong MAX>
+TAO_Bounded_String_Sequence<MAX>::
+TAO_Bounded_String_Sequence (const TAO_Bounded_String_Sequence<MAX> &rhs)
+ : TAO_Bounded_Base_Sequence (rhs)
+{
+ char* *tmp1 =
+ TAO_Bounded_String_Sequence<MAX>::allocbuf (this->maximum_);
+ char* *tmp2 = ACE_reinterpret_cast(char* *,rhs.buffer_);
+ for (CORBA::ULong i=0; i < rhs.length_; i++)
+ tmp1[i] = CORBA::string_dup (tmp2[i]);
+
+ this->buffer_ = tmp1;
+}
+
+template<CORBA::ULong MAX>
+TAO_Bounded_String_Sequence<MAX>&
+TAO_Bounded_String_Sequence<MAX>::operator=
+(const TAO_Bounded_String_Sequence<MAX> &seq)
+{
+ if (this == &seq)
+ return *this;
+
+ if (this->release_)
+ {
+ char* *tmp = ACE_reinterpret_cast (char* *,this->buffer_);
+ for (CORBA::ULong i = 0; i < this->length_; ++i)
+ {
+ CORBA::string_free (tmp[i]);
+ tmp[i] = 0;
+ }
+#if 0
+ if (this->maximum_ < seq.maximum_)
+ {
+ TAO_Bounded_String_Sequence<T,MAX>::freebuf (tmp);
+ this->buffer_ =
+ TAO_Unbounded_String_Sequence<T,MAX>::allocbuf (rhs.maximum_);
+ }
+#endif /* 0 */
+ }
+ else
+ {
+ this->buffer_ =
+ TAO_Bounded_String_Sequence<T>::allocbuf (rhs.maximum_);
+ }
+ TAO_Bounded_Base_Sequence::operator= (rhs);
+
+ char* *tmp1 = ACE_reinterpret_cast(char* *,this->buffer_);
+ char* *tmp2 = ACE_reinterpret_cast(char* *,seq.buffer_);
+ for (CORBA::ULong i=0; i < seq.length_; i++)
+ tmp1[i] = CORBA::string_dup (tmp2[i]);
+ return *this;
+}
+
+template<CORBA::ULong MAX> char* *
+TAO_Bounded_String_Sequence<MAX>::allocbuf (CORBA::ULong)
+{
+ char* *buf = new char*[MAX];
+ for (CORBA::ULong i = 0; i < MAX; i++)
+ buf[i] = 0;
+ return buf;
+}
+
+template<CORBA::ULong MAX> void
+TAO_Bounded_String_Sequence<MAX>::freebuf (char* *buffer)
+{
+ // How much do we deallocate? Easy! allocbuf() always creates MAX
+ // elements and initialize them to 0 (they say NULL, yuck!). So we
+ // can be complaint and call CORBA::string_free() on each one.
+ for (CORBA::ULong i = 0; i < MAX; ++i)
+ {
+ if (buffer[i] != 0)
+ {
+ CORBA::string_free (buffer[i]);
+ buffer[i] = 0;
+ }
+ }
+ delete[] buffer;
+}
+
+template<CORBA::ULong MAX> void
+TAO_Bounded_String_Sequence<MAX>::_allocate_buffer (CORBA::ULong length)
+{
+ // For this class memory is never reallocated so the implementation
+ // is *really* simple.
+ this->buffer_ =
+ TAO_Bounded_String_Sequence<MAX>::allocbuf (MAX);
+}
+
+template<CORBA::ULong MAX>
+void TAO_Bounded_String_Sequence<MAX>::_deallocate_buffer (void)
+{
+ if (this->buffer_ == 0 || this->release_ == 0)
+ return;
+ char* *tmp = ACE_reinterpret_cast (char**,this->buffer_);
+ TAO_Bounded_String_Sequence<MAX>::freebuf (tmp);
+ this->buffer_ = 0;
+}
+
+template<CORBA::ULong MAX> void
+TAO_Bounded_String_Sequence<MAX>::_shrink_buffer (CORBA::ULong nl,
+ CORBA::ULong ol)
+{
+ char* *tmp = ACE_reinterpret_cast (char**,this->buffer_);
+ for (CORBA::ULong i = nl; i < ol; ++i)
+ {
+ CORBA::string_free (tmp[i]);
+ tmp[i] = 0;
+ }
}
#endif /* TAO_SEQUENCE_T_C */
diff --git a/TAO/tao/sequence_T.i b/TAO/tao/sequence_T.i
index f65cc2a8401..156e779be26 100644
--- a/TAO/tao/sequence_T.i
+++ b/TAO/tao/sequence_T.i
@@ -1,5 +1,8 @@
+// This may look like C, but it's really -*- C++ -*-
+
+//
// $Id$
-/* -*- C++ -*- */
+//
// ============================================================================
//
@@ -66,7 +69,7 @@ TAO_Unbounded_Sequence<T>::allocbuf (CORBA::ULong size)
template <class T> ACE_INLINE void
TAO_Unbounded_Sequence<T>::freebuf (T *buffer)
{
- delete [] buffer;
+ delete[] buffer;
}
// ***************************************************
@@ -103,15 +106,15 @@ TAO_Bounded_Sequence<T,MAX>::operator[] (CORBA::ULong i) const
}
template <class T, CORBA::ULong MAX> ACE_INLINE T *
-TAO_Bounded_Sequence<T,MAX>::allocbuf (CORBA::ULong size)
+TAO_Bounded_Sequence<T,MAX>::allocbuf (CORBA::ULong)
{
- return new T[size];
+ return new T[MAX];
}
template <class T, CORBA::ULong MAX> ACE_INLINE void
TAO_Bounded_Sequence<T,MAX>::freebuf (T *buffer)
{
- delete [] buffer;
+ delete[] buffer;
}
// *************************************************************
@@ -119,6 +122,18 @@ TAO_Bounded_Sequence<T,MAX>::freebuf (T *buffer)
// *************************************************************
template <class T> ACE_INLINE
+TAO_Object_Manager<T>::~TAO_Object_Manager (void)
+{
+}
+
+template <class T> ACE_INLINE
+TAO_Object_Manager<T>::TAO_Object_Manager (const TAO_Object_Manager &rhs)
+ : ptr_ (rhs.ptr_),
+ release_ (rhs.release_)
+{
+}
+
+template <class T> ACE_INLINE
TAO_Object_Manager<T>::TAO_Object_Manager(T** buffer, CORBA::Boolean release)
: ptr_ (buffer),
release_ (release)
@@ -126,7 +141,7 @@ TAO_Object_Manager<T>::TAO_Object_Manager(T** buffer, CORBA::Boolean release)
}
template <class T> ACE_INLINE
-TAO_Object_Manager<T>::operator const T* &() const // cast
+TAO_Object_Manager<T>::operator const T* () const // cast
{
return *this->ptr_;
}
@@ -169,20 +184,17 @@ TAO_Unbounded_Object_Sequence<T>::operator[] (CORBA::ULong index) const
// class TAO_Bounded_Object_Sequence
// *************************************************************
-template <class T, CORBA::ULong MAX> ACE_INLINE void
-TAO_Bounded_Object_Sequence<T,MAX>::freebuf (T* *seq)
+template<class T, CORBA::ULong MAX> ACE_INLINE
+TAO_Bounded_Object_Sequence<T,MAX>::~TAO_Bounded_Object_Sequence (void)
{
- delete []seq;
+ this->_deallocate_buffer ();
}
template <class T, CORBA::ULong MAX> ACE_INLINE
-TAO_Bounded_Object_Sequence<T,MAX>::TAO_Bounded_Object_Sequence (void)
-{}
-
-// constructor from data buffer
-template <class T, CORBA::ULong MAX> ACE_INLINE
-TAO_Bounded_Object_Sequence<T,MAX>::TAO_Bounded_Object_Sequence
-(CORBA::ULong length, T* *value, CORBA::Boolean release)
+TAO_Bounded_Object_Sequence<T,MAX>::
+TAO_Bounded_Object_Sequence (CORBA::ULong length,
+ T* *value,
+ CORBA::Boolean release)
: TAO_Bounded_Base_Sequence (MAX, length, value, release)
{
}
@@ -194,3 +206,31 @@ TAO_Bounded_Object_Sequence<T,MAX>::operator[] (CORBA::ULong index) const
T* tmp = ACE_reinterpret_cast (T*, this->buffer_);
return Manager(tmp + index, this->release_);
}
+
+// *************************************************************
+// class TAO_Bounded_String_Sequence
+// *************************************************************
+
+template<CORBA::ULong MAX> ACE_INLINE
+TAO_Bounded_String_Sequence<MAX>::~TAO_Bounded_String_Sequence (void)
+{
+ this->_deallocate_buffer ();
+}
+
+template<CORBA::ULong MAX> ACE_INLINE
+TAO_Bounded_String_Sequence<MAX>::
+TAO_Bounded_String_Sequence (CORBA::ULong length,
+ char* *value,
+ CORBA::Boolean release)
+ : TAO_Bounded_Base_Sequence (MAX, length, value, release)
+{
+}
+
+template<CORBA::ULong MAX> ACE_INLINE TAO_String_Manager
+TAO_Bounded_String_Sequence<MAX>::operator[] (CORBA::ULong index) const
+{
+ ACE_ASSERT (index < this->maximum_);
+ char** tmp = ACE_reinterpret_cast (char**, this->buffer_);
+ return Manager(tmp + index, this->release_);
+}
+
diff --git a/TAO/tao/servant_base.cpp b/TAO/tao/servant_base.cpp
index ad360bb1d6b..c9f5266a4dd 100644
--- a/TAO/tao/servant_base.cpp
+++ b/TAO/tao/servant_base.cpp
@@ -1,6 +1,8 @@
#include "tao/corba.h"
TAO_ServantBase::TAO_ServantBase (void)
+ : optable_ (0),
+ parent_ (0)
{
}
diff --git a/TAO/tests/Cubit/TAO/IDL_Cubit/Makefile b/TAO/tests/Cubit/TAO/IDL_Cubit/Makefile
index 94206e4c707..e77e4f8b56a 100644
--- a/TAO/tests/Cubit/TAO/IDL_Cubit/Makefile
+++ b/TAO/tests/Cubit/TAO/IDL_Cubit/Makefile
@@ -12,12 +12,12 @@
LDLIBS = -lTAO
IDL_SRC = cubitC.cpp cubitS.cpp
-PROG_SRCS = $(IDL_SRC) svr.cpp clnt.cpp
+PROG_SRCS = $(IDL_SRC) svr.cpp clnt.cpp tmplinst.cpp
LSRC = $(PROG_SRCS)
-CUBIT_SVR_OBJS = cubitC.o cubitS.o svr.o cubit_i.o
-CUBIT_CLT_OBJS = cubitC.o clnt.o
+CUBIT_SVR_OBJS = cubitC.o cubitS.o svr.o cubit_i.o tmplinst.o
+CUBIT_CLT_OBJS = cubitC.o clnt.o tmplinst.o
BIN = svr clnt
BUILD = $(BIN)
diff --git a/TAO/tests/Cubit/TAO/IDL_Cubit/README b/TAO/tests/Cubit/TAO/IDL_Cubit/README
index e24968999ae..3888349a0ef 100644
--- a/TAO/tests/Cubit/TAO/IDL_Cubit/README
+++ b/TAO/tests/Cubit/TAO/IDL_Cubit/README
@@ -17,7 +17,9 @@ The server cubit factory maintained num_of_cubit objects (default =
When the server is started and you have used the -d flag, you should
see as the first line of output something that looks like
-iiop:1.0//serverhost:10013/factory.
+ iiop:1.0//serverhost:10013/factory (using -ORBobjrefstyle url)
+or
+ IOR:000000000000001649444c3a43756269745... (using default -ORBobjrefstyle ior)
Using -d turns on debugging messages. It is additive, i.e., the more
-d options provided, the more debugging you can get. At the moment,
diff --git a/TAO/tests/Cubit/TAO/IDL_Cubit/clnt.cpp b/TAO/tests/Cubit/TAO/IDL_Cubit/clnt.cpp
index 8c7e12ba713..d96f6d8740e 100644
--- a/TAO/tests/Cubit/TAO/IDL_Cubit/clnt.cpp
+++ b/TAO/tests/Cubit/TAO/IDL_Cubit/clnt.cpp
@@ -40,7 +40,7 @@ Cubit_Client::Cubit_Client (void)
call_count_ (0),
error_count_ (0)
{
- ACE_Env_Value<unsigned long> defport(quote(TAO_DEFAULT_SERVER_PORT),
+ ACE_Env_Value<CORBA::UShort> defport(quote(TAO_DEFAULT_SERVER_PORT),
TAO_DEFAULT_SERVER_PORT);
portnum_ = defport;
}
@@ -771,7 +771,8 @@ main (int argc, char **argv)
#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
template class ACE_Env_Value<unsigned long>;
+template class ACE_Env_Value<unsigned short>;
#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
#pragma instantiate ACE_Env_Value<unsigned long>
+#pragma instantiate ACE_Env_Value<unsigned short>
#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
-
diff --git a/TAO/tests/Cubit/TAO/MT_Cubit/Makefile b/TAO/tests/Cubit/TAO/MT_Cubit/Makefile
index a516f6b3cfc..7e372e3ba2a 100644
--- a/TAO/tests/Cubit/TAO/MT_Cubit/Makefile
+++ b/TAO/tests/Cubit/TAO/MT_Cubit/Makefile
@@ -12,12 +12,17 @@
LDLIBS = -lTAO
IDL_SRC = cubitC.cpp cubitS.cpp
-PROG_SRCS = server.cpp cubit_i.cpp Task_Client.cpp client.cpp Util_Thread.cpp
+PROG_SRCS = server.cpp \
+ cubit_i.cpp \
+ Task_Client.cpp \
+ client.cpp \
+ Util_Thread.cpp \
+ tmplinst.cpp
LSRC = $(IDL_SRC) $(PROG_SRCS)
-CUBIT_SVR_OBJS = cubitC.o cubitS.o server.o cubit_i.o
-CUBIT_CLIENT_OBJS = cubitC.o Task_Client.o client.o Util_Thread.o
+CUBIT_SVR_OBJS = cubitC.o cubitS.o server.o cubit_i.o tmplinst.o
+CUBIT_CLIENT_OBJS = cubitC.o Task_Client.o client.o Util_Thread.o tmplinst.o
BIN = server client
BUILD = $(BIN)
diff --git a/TAO/tests/Cubit/TAO/MT_Cubit/README b/TAO/tests/Cubit/TAO/MT_Cubit/README
index ecf6fc3a6d1..0027aca76b9 100644
--- a/TAO/tests/Cubit/TAO/MT_Cubit/README
+++ b/TAO/tests/Cubit/TAO/MT_Cubit/README
@@ -12,7 +12,7 @@ the client or open a separate window for the client and server.
server:
-------
-./svr -p <port_num> -h <my_hostname> -t <number_of_servants>
+./server -p <port_num> -h <my_hostname> -t <number_of_servants>
port_num is the port number at which the server will start the first
(and highest priority) servant. Successive servants (with successively
@@ -25,7 +25,8 @@ by the client.
client:
-------
-./client -d <datatype> -p <port_num> -h <server_hostname> -n <num_calls> -t <num_of_clients> [-r]
+./client -ORBobjrefstyle url -p <port_num> -h <server_hostname>
+ -d <datatype> -n <num_calls> -t <num_of_clients> [-r]
<datatype> is one of the following:
diff --git a/TAO/tests/Cubit/TAO/MT_Cubit/client.cpp b/TAO/tests/Cubit/TAO/MT_Cubit/client.cpp
index 5d8ba4d0da0..4ec478f6ea9 100644
--- a/TAO/tests/Cubit/TAO/MT_Cubit/client.cpp
+++ b/TAO/tests/Cubit/TAO/MT_Cubit/client.cpp
@@ -59,8 +59,15 @@ do_priority_inversion_test (Task_State &ts)
// Now activate the high priority client.
-
+
+ // @@ The ifdef here is temporarily placed here until
+ // I figure out how to map NT's thread priorities
+ // into pthread's priorities.
+#if defined (ACE_THR_PRI_FIFO_DEF)
priority = ACE_THR_PRI_FIFO_DEF;
+#else
+ priority = ACE_DEFAULT_THREAD_PRIORITY;
+#endif
if (high_priority_client.activate (THR_BOUND | ACE_SCHED_FIFO,
1,
@@ -213,4 +220,5 @@ main (int argc, char *argv [])
do_priority_inversion_test (ts);
else
do_thread_per_rate_test (ts);
+ return 0;
}
diff --git a/TAO/tests/Cubit/TAO/MT_Cubit/server.cpp b/TAO/tests/Cubit/TAO/MT_Cubit/server.cpp
index d21f6c81194..4158bd5fc2c 100644
--- a/TAO/tests/Cubit/TAO/MT_Cubit/server.cpp
+++ b/TAO/tests/Cubit/TAO/MT_Cubit/server.cpp
@@ -168,7 +168,7 @@ Cubit_Task::create_servants ()
ACE_DEBUG ((LM_DEBUG,"Object Created at: '%ul'", obj));
CORBA::string_free (obj_str);
}
-
+ return 0;
}
// Global options used to configure various parameters.
@@ -269,7 +269,14 @@ start_servants ()
ACE_Sched_Priority priority;
+ // @@ The ifdef here is temporarily placed here until
+ // I figure out how to map NT's thread priorities
+ // into pthread's priorities.
+#if defined (ACE_THR_PRI_FIFO_DEF)
priority = ACE_THR_PRI_FIFO_DEF;
+#else
+ priority = ACE_DEFAULT_THREAD_PRIORITY;
+#endif /* ACE_THR_PRI_FIFO_DEF */
ACE_DEBUG ((LM_DEBUG,
"Creating servant with high priority\n"));