TAO_CosTrader  2.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
TAO_Offer_Filter Class Reference

The purpose of this class is to ensure that offers that shouldn't be considered by the TAO_Constraint_Interpreter aren't. More...

#include <Trader_Utils.h>

Collaboration diagram for TAO_Offer_Filter:
Collaboration graph

Public Member Functions

 TAO_Offer_Filter (TAO_Policies &policies)
void configure_type (CosTradingRepos::ServiceTypeRepository::TypeStruct *type_struct)
CORBA::Boolean ok_to_consider (CosTrading::Offer *offer)
CORBA::Boolean ok_to_consider_more (void)
void matched_offer (void)
CosTrading::PolicyNameSeqlimits_applied (void)
CORBA::ULong search_card_remaining (void) const
 Accessors to retrieve the adjusted cardinalities. More...
CORBA::ULong match_card_remaining (void) const

Private Member Functions

 TAO_Offer_Filter (const TAO_Offer_Filter &)
TAO_Offer_Filteroperator= (const TAO_Offer_Filter &)

Private Attributes

TAO_String_Set not_mod_props_
 The set of the name of modifiable properties. More...
TAO_String_Set limits_
 Cardinality and property limitations applied. More...
CORBA::ULong search_card_
 Keep track of the cardinalities. More...
CORBA::ULong match_card_
CORBA::ULong return_card_
CORBA::Boolean dp_
CORBA::Boolean mod_

Detailed Description

The purpose of this class is to ensure that offers that shouldn't be considered by the TAO_Constraint_Interpreter aren't.

There two classes of reasons why an offer for a correct type shouldn't be considered: 1) The default parameters of the Trader or policies passed to the Lookup::query method deem it inappropriate to consider offers with modifiable (i.e., not readonly) or dynamic properties. 2) We've exceeded the default or provided cardinality constraints. TAO_Offer_Filter ensures that violation of policies doesn't occur. It's the enforcer.

Constructor & Destructor Documentation

TAO_Offer_Filter::TAO_Offer_Filter ( TAO_Policies policies)

Glean from the TypeStruct and Policy setting the appropriate way to screen unsuitable offers from consideration.

TAO_Offer_Filter::TAO_Offer_Filter ( const TAO_Offer_Filter )

Member Function Documentation

void TAO_Offer_Filter::configure_type ( CosTradingRepos::ServiceTypeRepository::TypeStruct type_struct)

Set the offer filter to screen for offers containing properties that aren't marked as readonly in this TypeStruct.

CosTrading::PolicyNameSeq * TAO_Offer_Filter::limits_applied ( void  )

BEGIN SPEC If any cardinality or other limits were applied by one or more traders in responding to a particular query, then the "limits_applied" parameter will contain the names of the policies which limited the query. The sequence of names returned in "limits_applied" from any federated or proxy queries must be concatenated onto the names of limits applied locally and returned. END SPEC

CORBA::ULong TAO_Offer_Filter::match_card_remaining ( void  ) const
void TAO_Offer_Filter::matched_offer ( void  )

Signal that the Lookup method has matched an offer; decrement the match_card.

CORBA::Boolean TAO_Offer_Filter::ok_to_consider ( CosTrading::Offer offer)

Determine whether the poicies contained in the given policy object allow the Lookup interface to consider the offer. That is, if use_modifiable_properties is false, and the offer contains modifiable properties as designated in the type struct, return false. If use_dynamic_properties is false, and the offer contains dynamic properties, then return false. If the lookup interface is safe in considering this offer, return true and subtract from the search card value. When the search card value falls to zero, ok_to_consider always returns false.

CORBA::Boolean TAO_Offer_Filter::ok_to_consider_more ( void  )

It's ok to consider more offers when lookup hasn't exceeded the cardinality values for searching and matching offers.

TAO_Offer_Filter& TAO_Offer_Filter::operator= ( const TAO_Offer_Filter )
CORBA::ULong TAO_Offer_Filter::search_card_remaining ( void  ) const

Accessors to retrieve the adjusted cardinalities.

Member Data Documentation

CORBA::Boolean TAO_Offer_Filter::dp_

Keep track of property limitations: modifiable or dynamic ones may be bad.

TAO_String_Set TAO_Offer_Filter::limits_

Cardinality and property limitations applied.

CORBA::ULong TAO_Offer_Filter::match_card_
CORBA::Boolean TAO_Offer_Filter::mod_
TAO_String_Set TAO_Offer_Filter::not_mod_props_

The set of the name of modifiable properties.

CORBA::ULong TAO_Offer_Filter::return_card_
CORBA::ULong TAO_Offer_Filter::search_card_

Keep track of the cardinalities.

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