00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Trader_Constraint_Visitors.h 00006 * 00007 * Trader_Constraint_Visitors.h,v 1.11 2006/03/14 06:14:35 jtc Exp 00008 * 00009 * @author Seth Widoff <sbw1@cs.wustl.edu> 00010 */ 00011 //============================================================================= 00012 00013 00014 #ifndef TAO_TRADER_CONSTRAINT_VISITOR_H 00015 #define TAO_TRADER_CONSTRAINT_VISITOR_H 00016 #include /**/ "ace/pre.h" 00017 00018 #include "orbsvcs/Trader/Constraint_Visitors.h" 00019 #include "orbsvcs/Trader/Trader.h" 00020 #include "orbsvcs/Trader/Trader_Utils.h" 00021 #include "orbsvcs/CosTradingC.h" 00022 00023 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00024 00025 class TAO_Trading_Serv_Export TAO_Trader_Constraint_Validator 00026 : public TAO_Constraint_Validator 00027 { 00028 public: 00029 /** 00030 * The constructor creates a map of property names to their values 00031 * from the Type Description retrieved from the 00032 * ServiceTypeRepository. The ServiceTypeRepository throws 00033 * exceptions when it's displeased with the type name provided to 00034 * it. The map allows O(lg n) associative access, rather than the 00035 * O(n) sequential lookup from the CORBA data structures. 00036 */ 00037 TAO_Trader_Constraint_Validator (const CosTradingRepos::ServiceTypeRepository::TypeStruct& 00038 type_struct); 00039 00040 /// Desctructor. 00041 virtual ~TAO_Trader_Constraint_Validator (void); 00042 00043 }; 00044 00045 class TAO_Trading_Serv_Export TAO_Trader_Constraint_Evaluator : public TAO_Constraint_Evaluator 00046 { 00047 public: 00048 /// Constructor. 00049 TAO_Trader_Constraint_Evaluator (CosTrading::Offer* offer, 00050 CORBA::Boolean supports_dynamic_properties = 1); 00051 00052 virtual int visit_property (TAO_Property_Constraint* literal); 00053 00054 private: 00055 /// Utility with which to evaluate the properties of an offer, be 00056 /// they dyanmic or static. 00057 TAO_Property_Evaluator prop_eval_; 00058 }; 00059 00060 TAO_END_VERSIONED_NAMESPACE_DECL 00061 00062 #include /**/ "ace/post.h" 00063 #endif /* TAO_TRADER_CONSTRAINT_VISITOR_H */