summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Mesnier <mesnier_p@ociweb.com>2013-02-25 17:40:02 +0000
committerPhil Mesnier <mesnier_p@ociweb.com>2013-02-25 17:40:02 +0000
commitf48c86ccb384982513c88811c974c82327cb6f24 (patch)
tree56f392a3a31b9ad7e94d72a6b19d25b0dbe9dfe7
parenta18a931c129b12763fe4a29d6f0e9f9d99598003 (diff)
downloadATCD-f48c86ccb384982513c88811c974c82327cb6f24.tar.gz
Mon Feb 25 17:32:02 UTC 2013 Phil Mesnier <mesnier_p@ociweb.com>
-rw-r--r--TAO/ChangeLog25
-rw-r--r--TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.cpp5
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.cpp10
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_PG_Group_Factory.cpp4
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_PG_Group_Factory.h3
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_PG_Object_Group_Storable.cpp4
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_PG_Object_Group_Storable.h3
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.cpp12
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.h8
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.cpp5
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.h4
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group_Storable.cpp6
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group_Storable.h3
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Support.cpp55
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Support.h8
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set.cpp14
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set.h20
17 files changed, 92 insertions, 97 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 5a01ff69672..9567e721663 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,28 @@
+Mon Feb 25 17:32:02 UTC 2013 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * orbsvcs/FT_ReplicationManager/FT_ReplicationManager.cpp:
+
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.cpp:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_PG_Group_Factory.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_PG_Group_Factory.cpp:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_PG_Object_Group_Storable.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_PG_Object_Group_Storable.cpp:
+
+ * orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.h:
+ * orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.cpp:
+ * orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.h:
+ * orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.cpp:
+ * orbsvcs/orbsvcs/PortableGroup/PG_Object_Group_Storable.h:
+ * orbsvcs/orbsvcs/PortableGroup/PG_Object_Group_Storable.cpp:
+ * orbsvcs/orbsvcs/PortableGroup/PG_Properties_Support.h:
+ * orbsvcs/orbsvcs/PortableGroup/PG_Properties_Support.cpp:
+ * orbsvcs/orbsvcs/PortableGroup/PG_Property_Set.h:
+ * orbsvcs/orbsvcs/PortableGroup/PG_Property_Set.cpp:
+
+ Refactor the ownership of PG_Property_Set and defaults. This reverts
+ the change that introduced an ownership flag, and instead uses a
+ reference counted pointer to manage the default sets.
+
Fri Feb 22 19:32:58 UTC 2013 Douglas C. Schmidt <schmidt@dre.vanderbilt.edu>
* orbsvcs/orbsvcs/Trader/Service_Type_Repository.cpp (list_types):
diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.cpp b/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.cpp
index 25b3a352da9..f5f1e4087f6 100644
--- a/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.cpp
+++ b/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.cpp
@@ -858,7 +858,7 @@ TAO::FT_ReplicationManager::create_object (
////////////////////////////////
// find the properties for this
// type of object group
- TAO::PG_Property_Set * typeid_properties
+ TAO::PG_Property_Set_var typeid_properties
= this->properties_support_.find_typeid_properties (
type_id);
@@ -866,8 +866,7 @@ TAO::FT_ReplicationManager::create_object (
= this->group_factory_.create_group (
type_id,
the_criteria,
- typeid_properties,
- false);
+ typeid_properties);
group->initial_populate ();
//@@ on error we should remove the group from the Group_Factory
diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.cpp b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.cpp
index ba5b5f8aa20..d2aaabc01b2 100644
--- a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.cpp
+++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.cpp
@@ -672,17 +672,11 @@ TAO_FT_Naming_Manager::create_object (
////////////////////////////////
// find the properties for this
// type of object group
- ACE_Auto_Ptr<TAO::PG_Property_Set> typeid_properties
+ TAO::PG_Property_Set_var typeid_properties =
(this->properties_support_.find_typeid_properties (type_id));
TAO::PG_Object_Group * group = this->group_factory_.create_group
- ( type_id,
- the_criteria,
- typeid_properties.get (),
- true);
-
- // The group now owns the properties.
- typeid_properties.release ();
+ ( type_id, the_criteria, typeid_properties);
group->set_name (object_name);
diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_PG_Group_Factory.cpp b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_PG_Group_Factory.cpp
index 93b03929f61..5890db3344d 100644
--- a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_PG_Group_Factory.cpp
+++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_PG_Group_Factory.cpp
@@ -95,8 +95,7 @@ TAO::FT_PG_Group_Factory::create_persistent_group (
const PortableGroup::TagGroupTaggedComponent & tagged_component,
const char * type_id,
const PortableGroup::Criteria & the_criteria,
- TAO::PG_Property_Set * type_properties,
- bool give_properties,
+ const TAO::PG_Property_Set_var & type_properties,
TAO::Storable_Factory & storable_factory)
{
TAO::PG_Object_Group_Storable * objectGroup = 0;
@@ -111,7 +110,6 @@ TAO::FT_PG_Group_Factory::create_persistent_group (
type_id,
the_criteria,
type_properties,
- give_properties,
storable_factory
),
CORBA::NO_MEMORY());
diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_PG_Group_Factory.h b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_PG_Group_Factory.h
index b84f79f560b..4c411ed4e4d 100644
--- a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_PG_Group_Factory.h
+++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_PG_Group_Factory.h
@@ -62,8 +62,7 @@ namespace TAO
const PortableGroup::TagGroupTaggedComponent & tagged_component,
const char * type_id,
const PortableGroup::Criteria & the_criteria,
- TAO::PG_Property_Set * type_properties,
- bool give_properties,
+ const TAO::PG_Property_Set_var & type_properties,
TAO::Storable_Factory & storable_factory);
virtual PG_Object_Group_Storable * restore_persistent_group (
diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_PG_Object_Group_Storable.cpp b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_PG_Object_Group_Storable.cpp
index 8328eeccd61..546e1a7e54d 100644
--- a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_PG_Object_Group_Storable.cpp
+++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_PG_Object_Group_Storable.cpp
@@ -16,8 +16,7 @@ TAO::FT_PG_Object_Group_Storable::FT_PG_Object_Group_Storable (
const PortableGroup::TagGroupTaggedComponent & tagged_component,
const char * type_id,
const PortableGroup::Criteria & the_criteria,
- TAO::PG_Property_Set * type_properties,
- bool give_properties,
+ const TAO::PG_Property_Set_var & type_properties,
TAO::Storable_Factory & storable_factory)
: PG_Object_Group_Storable(orb,
factory_registry,
@@ -27,7 +26,6 @@ TAO::FT_PG_Object_Group_Storable::FT_PG_Object_Group_Storable (
type_id,
the_criteria,
type_properties,
- give_properties,
storable_factory)
, stale_ (false)
, file_created_ (false)
diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_PG_Object_Group_Storable.h b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_PG_Object_Group_Storable.h
index 463299b70df..e5e146441ce 100644
--- a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_PG_Object_Group_Storable.h
+++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_PG_Object_Group_Storable.h
@@ -58,8 +58,7 @@ namespace TAO
const PortableGroup::TagGroupTaggedComponent & tagged_component,
const char * type_id,
const PortableGroup::Criteria & the_criteria,
- TAO::PG_Property_Set * type_properties,
- bool give_properties,
+ const TAO::PG_Property_Set_var & type_properties,
TAO::Storable_Factory & storable_factory);
/**
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.cpp
index a076a89352f..50c7f85edcc 100644
--- a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.cpp
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.cpp
@@ -102,8 +102,7 @@ void TAO::PG_Group_Factory::init (
TAO::PG_Object_Group * TAO::PG_Group_Factory::create_group (
const char * type_id,
const PortableGroup::Criteria & the_criteria,
- TAO::PG_Property_Set * typeid_properties,
- bool give_properties)
+ const TAO::PG_Property_Set_var & typeid_properties)
{
///////////////////////////////////
// Create an empty group reference
@@ -151,7 +150,6 @@ TAO::PG_Object_Group * TAO::PG_Group_Factory::create_group (
type_id,
the_criteria,
typeid_properties,
- give_properties,
*storable_factory_);
this->list_store_->add(group_id);
@@ -168,9 +166,7 @@ TAO::PG_Object_Group * TAO::PG_Group_Factory::create_group (
tagged_component,
type_id,
the_criteria,
- typeid_properties,
- give_properties
- ),
+ typeid_properties),
CORBA::NO_MEMORY());
}
@@ -452,8 +448,7 @@ TAO::PG_Group_Factory::create_persistent_group (
const PortableGroup::TagGroupTaggedComponent & tagged_component,
const char * type_id,
const PortableGroup::Criteria & the_criteria,
- TAO::PG_Property_Set * type_properties,
- bool give_properties,
+ const TAO::PG_Property_Set_var & type_properties,
TAO::Storable_Factory & storable_factory)
{
TAO::PG_Object_Group_Storable * objectGroup = 0;
@@ -468,7 +463,6 @@ TAO::PG_Group_Factory::create_persistent_group (
type_id,
the_criteria,
type_properties,
- give_properties,
storable_factory
),
CORBA::NO_MEMORY());
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.h
index 0c857a1c46d..faefba948b0 100644
--- a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.h
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.h
@@ -23,6 +23,7 @@
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "orbsvcs/PortableGroup/PG_Object_Group_Manipulator.h"
+#include "orbsvcs/PortableGroup/PG_Property_Set.h"
#include "orbsvcs/PortableGroupC.h"
#include "tao/PortableServer/PortableServer.h"
@@ -37,7 +38,6 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL
// Forward references
namespace TAO
{
- class PG_Property_Set;
class PG_Group_List_Store;
class PG_Object_Group_Storable;
class Storable_Factory;
@@ -91,8 +91,7 @@ namespace TAO
TAO::PG_Object_Group * create_group (
const char * type_id,
const PortableGroup::Criteria & the_criteria,
- TAO::PG_Property_Set * typeid_properties,
- bool give_props);
+ const TAO::PG_Property_Set_var & typeid_properties);
void delete_group (PortableGroup::ObjectGroup_ptr object_group);
@@ -183,8 +182,7 @@ namespace TAO
const PortableGroup::TagGroupTaggedComponent & tagged_component,
const char * type_id,
const PortableGroup::Criteria & the_criteria,
- TAO::PG_Property_Set * type_properties,
- bool give_properties,
+ const TAO::PG_Property_Set_var & type_properties,
TAO::Storable_Factory & storable_factory);
/**
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.cpp
index 0af413fc6b1..22e1f86fcc8 100644
--- a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.cpp
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.cpp
@@ -59,8 +59,7 @@ TAO::PG_Object_Group::PG_Object_Group (
const PortableGroup::TagGroupTaggedComponent & tagged_component,
const char * type_id,
const PortableGroup::Criteria & the_criteria,
- TAO::PG_Property_Set * type_properties,
- bool give_properties)
+ const TAO::PG_Property_Set_var & type_properties)
: internals_()
, orb_ (CORBA::ORB::_duplicate (orb))
, factory_registry_ (PortableGroup::FactoryRegistry::_duplicate (factory_registry))
@@ -74,7 +73,7 @@ TAO::PG_Object_Group::PG_Object_Group (
, group_name_ (0)
, members_ ()
, primary_location_(0)
- , properties_ (the_criteria, type_properties, give_properties)
+ , properties_ (the_criteria, type_properties)
, initial_number_members_ (0)
, minimum_number_members_ (0)
, group_specific_factories_ ()
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.h
index 921577917f8..47cb2d1e0cb 100644
--- a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.h
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.h
@@ -126,9 +126,7 @@ namespace TAO
const PortableGroup::TagGroupTaggedComponent & tagged_component,
const char * type_id,
const PortableGroup::Criteria & the_criteria,
- TAO::PG_Property_Set * type_properties,
- bool give_proprerties);
-
+ const TAO::PG_Property_Set_var & type_properties);
/**
* This constructor is to be used for initialization when
* reading the object group from a stream.
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group_Storable.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group_Storable.cpp
index 02c641822bc..ea14855054b 100644
--- a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group_Storable.cpp
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group_Storable.cpp
@@ -150,8 +150,7 @@ TAO::PG_Object_Group_Storable::PG_Object_Group_Storable (
const PortableGroup::TagGroupTaggedComponent & tagged_component,
const char * type_id,
const PortableGroup::Criteria & the_criteria,
- TAO::PG_Property_Set * type_properties,
- bool give_properties,
+ const TAO::PG_Property_Set_var & type_properties,
TAO::Storable_Factory & storable_factory)
: PG_Object_Group(orb,
factory_registry,
@@ -160,8 +159,7 @@ TAO::PG_Object_Group_Storable::PG_Object_Group_Storable (
tagged_component,
type_id,
the_criteria,
- type_properties,
- give_properties)
+ type_properties)
, group_previously_stored_(false)
, group_id_previously_stored_(0)
, storable_factory_ (storable_factory)
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group_Storable.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group_Storable.h
index 5002315a946..ad44d4a98d8 100644
--- a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group_Storable.h
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group_Storable.h
@@ -65,8 +65,7 @@ namespace TAO
const PortableGroup::TagGroupTaggedComponent & tagged_component,
const char * type_id,
const PortableGroup::Criteria & the_criteria,
- TAO::PG_Property_Set * type_properties,
- bool give_properties,
+ const TAO::PG_Property_Set_var & type_properties,
TAO::Storable_Factory & storable_factory);
/**
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Support.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Support.cpp
index 34854b00079..625182a319d 100644
--- a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Support.cpp
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Support.cpp
@@ -18,22 +18,27 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL
TAO::PG_Properties_Support::PG_Properties_Support ()
{
+ TAO::PG_Property_Set *props;
+ ACE_NEW_THROW_EX (props,
+ TAO::PG_Property_Set (),
+ CORBA::NO_MEMORY());
+ this->default_properties_.reset (props);
}
TAO::PG_Properties_Support::~PG_Properties_Support ()
{
-
+ this->properties_map_.unbind_all ();
}
void TAO::PG_Properties_Support::set_default_property (const char * name,
const PortableGroup::Value & value)
{
- this->default_properties_.set_property(name, value);
+ this->default_properties_->set_property(name, value);
}
void TAO::PG_Properties_Support::set_default_properties (const PortableGroup::Properties & props)
{
- this->default_properties_.decode (props);
+ this->default_properties_->decode (props);
}
PortableGroup::Properties *
@@ -41,14 +46,14 @@ TAO::PG_Properties_Support::get_default_properties ()
{
PortableGroup::Properties_var result;
ACE_NEW_THROW_EX ( result, PortableGroup::Properties(), CORBA::NO_MEMORY());
- this->default_properties_.export_properties (*result);
+ this->default_properties_->export_properties (*result);
return result._retn ();
}
void TAO::PG_Properties_Support::remove_default_properties (
const PortableGroup::Properties & props)
{
- this->default_properties_.remove (props);
+ this->default_properties_->remove (props);
}
void
@@ -58,13 +63,15 @@ TAO::PG_Properties_Support::set_type_properties (
{
ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->internals_);
- TAO::PG_Property_Set * typeid_properties = 0;
+ TAO::PG_Property_Set_var typeid_properties;
if ( 0 != this->properties_map_.find (type_id, typeid_properties))
{
- ACE_NEW_THROW_EX (
- typeid_properties,
- TAO::PG_Property_Set (overrides, & this->default_properties_, false),
- CORBA::NO_MEMORY());
+ TAO::PG_Property_Set *props;
+ ACE_NEW_THROW_EX (props,
+ TAO::PG_Property_Set (overrides,
+ this->default_properties_),
+ CORBA::NO_MEMORY());
+ typeid_properties.reset (props);
this->properties_map_.bind (type_id, typeid_properties);
}
typeid_properties->clear ();
@@ -80,7 +87,7 @@ TAO::PG_Properties_Support::get_type_properties (
ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, this->internals_, 0);
- TAO::PG_Property_Set * typeid_properties = 0;
+ TAO::PG_Property_Set_var typeid_properties;
if ( 0 != this->properties_map_.find (type_id, typeid_properties))
{
typeid_properties->export_properties (*result);
@@ -100,7 +107,7 @@ TAO::PG_Properties_Support::remove_type_properties (
ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->internals_);
- TAO::PG_Property_Set * typeid_properties = 0;
+ TAO::PG_Property_Set_var typeid_properties;
if ( 0 != this->properties_map_.find (type_id, typeid_properties))
{
typeid_properties->remove (props);
@@ -108,22 +115,22 @@ TAO::PG_Properties_Support::remove_type_properties (
}
-TAO::PG_Property_Set *
-TAO::PG_Properties_Support::find_typeid_properties (
- const char *type_id)
+TAO::PG_Property_Set_var
+TAO::PG_Properties_Support::find_typeid_properties (const char *type_id)
{
- ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, this->internals_, 0);
+ TAO::PG_Property_Set_var result;
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, this->internals_, result);
- TAO::PG_Property_Set * typeid_properties = 0;
- if ( 0 != this->properties_map_.find (type_id, typeid_properties))
+ if ( 0 != this->properties_map_.find (type_id, result))
{
- ACE_NEW_THROW_EX (
- typeid_properties,
- TAO::PG_Property_Set (& this->default_properties_, false),
- CORBA::NO_MEMORY());
- this->properties_map_.bind (type_id, typeid_properties);
+ TAO::PG_Property_Set * props;
+ ACE_NEW_THROW_EX (props,
+ TAO::PG_Property_Set (this->default_properties_),
+ CORBA::NO_MEMORY());
+ result.reset (props);
+ this->properties_map_.bind (type_id, result);
}
- return typeid_properties;
+ return result;
}
TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Support.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Support.h
index 7af594f10f0..a59d33b7b89 100644
--- a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Support.h
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Support.h
@@ -54,11 +54,11 @@ namespace TAO
{
typedef ACE_Hash_Map_Manager<
ACE_CString,
- ::TAO::PG_Property_Set *,
+ ::TAO::PG_Property_Set_var,
TAO_SYNCH_MUTEX> Properties_Map;
typedef ACE_Hash_Map_Iterator<
ACE_CString,
- ::TAO::PG_Property_Set *,
+ ::TAO::PG_Property_Set_var,
TAO_SYNCH_MUTEX> Properties_Map_Iterator;
public:
@@ -157,7 +157,7 @@ namespace TAO
* @param type_id identifies the set of properties to be found.
* @returns a pointer to a Property_Set owned by this Properties_Support object.
*/
- TAO::PG_Property_Set * find_typeid_properties (
+ TAO::PG_Property_Set_var find_typeid_properties (
const char *type_id);
/**
@@ -182,7 +182,7 @@ namespace TAO
TAO_SYNCH_MUTEX internals_;
/// The default property set.
- TAO::PG_Property_Set default_properties_;
+ TAO::PG_Property_Set_var default_properties_;
/// A collection of property sets indexed by type_id.
Properties_Map properties_map_;
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set.cpp
index d49b666346c..5acf71e1773 100644
--- a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set.cpp
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set.cpp
@@ -33,27 +33,21 @@ TAO::PG_Property_Set::PG_Property_Set (const PortableGroup::Properties & ps)
}
TAO::PG_Property_Set::PG_Property_Set (const PortableGroup::Properties & ps,
- PG_Property_Set * defaults,
- bool own_defaults)
- : defaults_ (defaults),
- own_defaults_ (own_defaults)
+ const PG_Property_Set_var & defaults)
+ : defaults_ (defaults)
{
this->decode (ps);
}
-TAO::PG_Property_Set::PG_Property_Set (PG_Property_Set * defaults,
- bool own_defaults)
- : defaults_ (defaults),
- own_defaults_ (own_defaults)
+TAO::PG_Property_Set::PG_Property_Set (const PG_Property_Set_var & defaults)
+ : defaults_ (defaults)
{
}
TAO::PG_Property_Set::~PG_Property_Set ()
{
this->clear ();
- if (this->own_defaults_)
- delete this->defaults_;
}
void
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set.h
index 2ebac7767ad..bc712a1b5ca 100644
--- a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set.h
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set.h
@@ -27,12 +27,16 @@
#include "ace/Hash_Map_Manager.h"
#include "ace/SString.h"
#include "ace/Null_Mutex.h"
+#include "ace/Refcounted_Auto_Ptr.h"
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
namespace TAO
{
+ class PG_Property_Set;
+ typedef ACE_Refcounted_Auto_Ptr<PG_Property_Set, TAO_SYNCH_MUTEX> PG_Property_Set_var;
+
/**
* The PG_Property_Set captures the set of properties from a
* PortableGroup::Properties structure in a more usable format (a
@@ -78,17 +82,14 @@ namespace TAO
* @param defaults a propert set decoder that supplies default values.
*/
PG_Property_Set (const PortableGroup::Properties & property_set,
- PG_Property_Set * defaults,
- bool own_defaults);
+ const PG_Property_Set_var & defaults);
/**
* constructor with defaults, but no properties (yet)
* (note this is not a copy constructor)
* @param defaults a propert set decoder that supplies default values.
*/
- PG_Property_Set (PG_Property_Set * defaults,
- bool own_defaults);
-
+ PG_Property_Set (const PG_Property_Set_var & defaults);
~PG_Property_Set ();
@@ -102,7 +103,7 @@ namespace TAO
* @param pValue an out parameter to receive a pointer to the Any containing the value
* @returns boolean true if found
*/
- int find (const ACE_CString & key, const PortableGroup::Value *& pValue)const;
+ int find (const ACE_CString & key, const PortableGroup::Value *& pValue) const;
/**
@@ -166,13 +167,8 @@ namespace TAO
/**
* a parent to another property decoder that provides default values
* these can be chained indefinitely.
- * @todo reference counted pointers would be a good idea here.
- */
- PG_Property_Set * defaults_;
- /**
- * flag denoting ownership of the defaults.
*/
- bool own_defaults_;
+ PG_Property_Set_var defaults_;
};