Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members

# TAO_Property_Evaluator Class Reference

This class abstracts away the details of obtaining property values and property types. Since the procedure for obtaining the value or type of a dynamic property is disparate from the method for a static property, TAO_Property_Evaluator provides methods that will unify the two approaches under a single interface. Since dynamic properties aren't necessarily supported by a trader, this class accounts for that contingency. The use of indexed lookups allows them to occur in constant time on the CORBA sequences, but requires that the client know the layout of properties ahead of time. More...

`#include <Trader_Utils.h>`

Inheritance diagram for TAO_Property_Evaluator:

[legend]
List of all members.

## Public Methods
| TAO_Property_Evaluator (const CosTrading::PropertySeq &properties, CORBA::Boolean supports_dp=1)
| TAO_Property_Evaluator (CosTrading::Offer &offer, CORBA::Boolean supports_dp=1)
virtual | ~TAO_Property_Evaluator (void)
| Clean up dynamic properties. More...
int | is_dynamic_property (int index)
| Returns 1 if the property at index <index> is dynamic. Returns a 0 when the index is out of bounds. More...
CORBA::Any * | property_value (int index ACE_ENV_ARG_DECL) throw (CosTradingDynamic::DPEvalFailure)
CORBA::TypeCode_ptr | property_type (int index)
## Protected Types
typedef CosTradingDynamic::DynamicProp | DP_Struct
typedef CosTradingDynamic::DynamicPropEval | DP_Eval
## Protected Attributes
const CosTrading::PropertySeq & | props_
| The offer from which the TAO_Property_Evaluator extracts property information. More...
int | supports_dp_
CORBA::Any ** | dp_cache_
## Private Methods
| TAO_Property_Evaluator (const TAO_Property_Evaluator &)
TAO_Property_Evaluator & | operator= (const TAO_Property_Evaluator &)

## Detailed Description

This class abstracts away the details of obtaining property values and property types. Since the procedure for obtaining the value or type of a dynamic property is disparate from the method for a static property, TAO_Property_Evaluator provides methods that will unify the two approaches under a single interface. Since dynamic properties aren't necessarily supported by a trader, this class accounts for that contingency. The use of indexed lookups allows them to occur in constant time on the CORBA sequences, but requires that the client know the layout of properties ahead of time.

## Member Typedef Documentation

typedef CosTradingDynamic::DynamicPropEval TAO_Property_Evaluator::DP_Eval`[protected]`

typedef CosTradingDynamic::DynamicProp TAO_Property_Evaluator::DP_Struct`[protected]`

## Constructor & Destructor Documentation

TAO_Property_Evaluator::TAO_Property_Evaluator | ( | const CosTrading::PropertySeq & | props,
|  | CORBA::Boolean | supports_dp = 1
| ) |

TAO_Property_Evaluator::TAO_Property_Evaluator | ( | CosTrading::Offer & | offer,
|  | CORBA::Boolean | supports_dp = 1
| ) |

| Construct an instance of TAO_Property_Evaluator that operates on an <offer> where the support for dynamic properties is dictated by <supports_dynamic_properties>.

TAO_Property_Evaluator::~TAO_Property_Evaluator | ( | void |  | ) | `[virtual]`

| Clean up dynamic properties.

TAO_Property_Evaluator::TAO_Property_Evaluator | ( | const TAO_Property_Evaluator & |  | ) | `[private]`

## Member Function Documentation

int TAO_Property_Evaluator::is_dynamic_property | ( | int | index | ) |

| Returns 1 if the property at index <index> is dynamic. Returns a 0 when the index is out of bounds.

TAO_Property_Evaluator& TAO_Property_Evaluator::operator= | ( | const TAO_Property_Evaluator & |  | ) | `[private]`

CORBA::TypeCode_ptr TAO_Property_Evaluator::property_type | ( | int | index | ) |

| Returns the type of the property whose index is <index>. If the property is dynamic and the trader supports dynamic properties, then the method returns the <returned_type> field of the CosTradingDynamic::DynamicProp struct associated with the property name. If the index is out of bounds, the method returns a null pointer (that is, 0).

CORBA::Any * TAO_Property_Evaluator::property_value | ( | int index | ACE_ENV_ARG_DECL | ) | throw (CosTradingDynamic::DPEvalFailure)

| Returns value of the property whose index is <index>. If the property at that index is dynamic and the trader supports dynamic properties, then the property_value method will obtain the value of the dynamic property using the evalDP method on the CosTradingDynamic::DynamicPropEval interface, passing on a CosTradingDynamic::DPEvalFailure exception on failure. If the property index is undefined, the method returns a null pointer.

## Member Data Documentation

CORBA::Any** TAO_Property_Evaluator::dp_cache_`[protected]`

| In order for the client to treat the results of property_value uniformly, we need to collect the dynamically allocated anys retrieved from dynamic properties and free them upon deletion. If we didn't do this, then the property_value method would leak or cause seg faults, since the client wouldn't be able to tell whether or not the return value should be freed.

const CosTrading::PropertySeq& TAO_Property_Evaluator::props_`[protected]`

| The offer from which the TAO_Property_Evaluator extracts property information.

int TAO_Property_Evaluator::supports_dp_`[protected]`

The documentation for this class was generated from the following files:

- Trader_Utils.h
- Trader_Utils.cpp