TAO_PortableGroup
2.0.8
|
#include <PG_Properties_Support.h>
This Properties Support object manages Property Sets (TAO::PG_Property_Set).
One set, default_properties_, acts as a "global" default set of properties.
The collection, properties_map_, contains a set of properties for each PortableGroup::type_id. The default set acts as a "parent" for each of these type_id sets.
Expected use: When an object group is created that implements the interface identified by type_id, the corresponding typed_id propery set acts as a parent to the Property set contained in the PG_Object_Group.
This heirarchy of property sets provides the correct property behavior. A request for a propery to an ObjectGroup will be satisfied from: by the object group group property set, or the typed_id property set, or the default property set, or the request will fail..
Note that changes to type_id or default properties will be visible immediately at the ObjectGroup level.
typedef ACE_Hash_Map_Manager< ACE_CString, ::TAO::PG_Property_Set *, TAO_SYNCH_MUTEX> TAO::PG_Properties_Support::Properties_Map [private] |
typedef ACE_Hash_Map_Iterator< ACE_CString, ::TAO::PG_Property_Set *, TAO_SYNCH_MUTEX> TAO::PG_Properties_Support::Properties_Map_Iterator [private] |
TAO::PG_Properties_Support::PG_Properties_Support | ( | ) |
TAO::PG_Properties_Support::~PG_Properties_Support | ( | ) |
TAO::PG_Property_Set * TAO::PG_Properties_Support::find_typeid_properties | ( | const char * | type_id | ) |
Export the property set in a PortableGroup::Properties format.
This method is intended to provide a parent for the property set in a newly-created Object Group of the given type_id.
Callers who intend to send the property set across a CORBA interface should use the get_type_properties method.
type_id | identifies the set of properties to be found. |
PortableGroup::Properties * TAO::PG_Properties_Support::get_default_properties | ( | void | ) |
Export the default properties in PortableGroup::Properties format.
This produces the properties in a format suitable for use across a CORBA interface. The caller owns the resulting Properties and must release it to avoid resource leaks.
PortableGroup::Properties * TAO::PG_Properties_Support::get_type_properties | ( | const char * | type_id | ) |
Export the property set in a PortableGroup::Properties format.
This produces the properties associated with a type_id -- including any default properties that have not been overridden at the type_id level in a format suitable for use across a CORBA interface.
The caller owns the resulting Properties and must release it to avoid resource leaks.
Compare this method to find_typeid_properties which returns a pointer to the internal representation of the properties in TAO::PG_Property_Set format. This is more efficient, but suitable only for internal use.
type_id | identifies the set of properties to be exported. |
void TAO::PG_Properties_Support::remove_default_properties | ( | const PortableGroup::Properties & | props | ) |
Undefine default properties that appear in props.
Properties that are defined in props are removed from the default property set. Removal is done by name. The property values do not have to match. There is no penalty for attempting to remove a property that does not exist.
props | a set of propertys to be removed by name. |
void TAO::PG_Properties_Support::remove_type_properties | ( | const char * | type_id, |
const PortableGroup::Properties & | props | ||
) |
Undefine default properties that appear in props.
Properties that are defined in props are removed from the type_id property set. Removal is done by name. The property values do not have to match. There is no penalty for attempting to remove a property that does not exist.
props | a set of propertys to be removed by name from the type_id set. |
void TAO::PG_Properties_Support::set_default_properties | ( | const PortableGroup::Properties & | props | ) |
Update the default property set.
Properties that appear in props are replaced in or added to the default property set. Properties that do not appear in props are unchanged.
props | the set of properties to update the defaults. |
void TAO::PG_Properties_Support::set_default_property | ( | const char * | name, |
const PortableGroup::Value & | value | ||
) |
Set a single default property. Overwriting any value previously set for that property. Leaving all other properties untouched.
name | the name of the property to set an Any containing the value. |
void TAO::PG_Properties_Support::set_type_properties | ( | const char * | type_id, |
const PortableGroup::Properties & | overrides | ||
) |
Override or define properties associated with a type_id.
If a property set does not exist for type_id, a new one will be created. Any property included in overrides will be set or replaced in the type_id property set. Any property not in overrides will be unchanged.
Contrary to the "throws" specification, this method does not attempt to validate the properties because doing so would unnecessarily constrain the uses to which this class could be put (although one could strategize the validation.)
TAO::PG_Property_Set TAO::PG_Properties_Support::default_properties_ [private] |
The default property set.
TAO_SYNCH_MUTEX TAO::PG_Properties_Support::internals_ [private] |
Protect internal state.
Properties_Map TAO::PG_Properties_Support::properties_map_ [private] |
A collection of property sets indexed by type_id.