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

The TAO_Preference_Interpreter will, given a valid preference string and offers, will order the offers based on the offers' compliance with the preferences. More...

#include <Constraint_Interpreter.h>

Inheritance diagram for TAO_Preference_Interpreter:
Inheritance graph
Collaboration diagram for TAO_Preference_Interpreter:
Collaboration graph

Classes

struct  Preference_Info
 

Public Types

typedef ACE_Unbounded_Queue
< Preference_Info
Ordered_Offers
 

Public Member Functions

 TAO_Preference_Interpreter (const CosTradingRepos::ServiceTypeRepository::TypeStruct &ts, const char *preference)
 
 TAO_Preference_Interpreter (TAO_Constraint_Validator &validator, const char *preference)
 
 ~TAO_Preference_Interpreter (void)
 Destructor. More...
 
void order_offer (CosTrading::Offer *offer, CosTrading::OfferId offer_id=0)
 
void order_offer (TAO_Constraint_Evaluator &evaluator, CosTrading::Offer *offer, CosTrading::OfferId offer_id=0)
 
int remove_offer (CosTrading::Offer *&offer, CosTrading::OfferId &offer_id)
 
int remove_offer (CosTrading::Offer *&offer)
 
size_t num_offers (void)
 Return the number of offers remaining in the ordering. More...
 

Private Member Functions

 TAO_Preference_Interpreter (const TAO_Preference_Interpreter &)
 Disallow copying. More...
 
TAO_Preference_Interpreteroperator= (const TAO_Preference_Interpreter &)
 

Private Attributes

Ordered_Offers offers_
 The ordered list of offers. More...
 

Additional Inherited Members

- Protected Member Functions inherited from TAO_Interpreter
 TAO_Interpreter (void)
 Constructor. More...
 
 ~TAO_Interpreter (void)
 Destructor. More...
 
int build_tree (const char *preferences)
 
- Static Protected Member Functions inherited from TAO_Interpreter
static int is_empty_string (const char *str)
 
- Protected Attributes inherited from TAO_Interpreter
TAO_Constraintroot_
 

Detailed Description

The TAO_Preference_Interpreter will, given a valid preference string and offers, will order the offers based on the offers' compliance with the preferences.

Each time the order_offer method is invoked, the TAO_Preference_Interpreter stores the offer reference in the order dictated by its evaluation of the preference string. After the TAO_Preference_Interpreter client has finished ordering all the offers, it will extract the offers in order using the remove_offer method.

Member Typedef Documentation

Constructor & Destructor Documentation

TAO_Preference_Interpreter::TAO_Preference_Interpreter ( const CosTradingRepos::ServiceTypeRepository::TypeStruct ts,
const char *  preference 
)
TAO_Preference_Interpreter::TAO_Preference_Interpreter ( TAO_Constraint_Validator validator,
const char *  preference 
)

Parse the preference string, determining first if it's valid. Throw an IllegalPreference exception if the preference doesn't conform to the BNF grammar for preferences.

TAO_Preference_Interpreter::~TAO_Preference_Interpreter ( void  )

Destructor.

TAO_Preference_Interpreter::TAO_Preference_Interpreter ( const TAO_Preference_Interpreter )
private

Disallow copying.

Member Function Documentation

size_t TAO_Preference_Interpreter::num_offers ( void  )

Return the number of offers remaining in the ordering.

TAO_Preference_Interpreter& TAO_Preference_Interpreter::operator= ( const TAO_Preference_Interpreter )
private
void TAO_Preference_Interpreter::order_offer ( CosTrading::Offer offer,
CosTrading::OfferId  offer_id = 0 
)
void TAO_Preference_Interpreter::order_offer ( TAO_Constraint_Evaluator evaluator,
CosTrading::Offer offer,
CosTrading::OfferId  offer_id = 0 
)

Evaluate the offer, and order it internally based on the results of the evaluation.

int TAO_Preference_Interpreter::remove_offer ( CosTrading::Offer *&  offer,
CosTrading::OfferId offer_id 
)
int TAO_Preference_Interpreter::remove_offer ( CosTrading::Offer *&  offer)

Remove the next offer. The offer returned will be the next in the ordering determined by the preference string.

Member Data Documentation

Ordered_Offers TAO_Preference_Interpreter::offers_
private

The ordered list of offers.


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