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>
List of all members.
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
Constructor & Destructor Documentation
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.
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.
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 | ) |
|
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
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.
The documentation for this class was generated from the following files: