00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __CLASSAD_MATCH_CLASSAD_H__
00022 #define __CLASSAD_MATCH_CLASSAD_H__
00023
00024 #include "classad/classad.h"
00025
00026 BEGIN_NAMESPACE( classad )
00027
00028
00068 class MatchClassAd : public ClassAd
00069 {
00070 public:
00072 MatchClassAd();
00077 MatchClassAd( ClassAd* al, ClassAd* ar );
00079 virtual ~MatchClassAd();
00080
00087 static MatchClassAd *MakeMatchClassAd( ClassAd* al, ClassAd* ar );
00088
00095 bool InitMatchClassAd( ClassAd* al, ClassAd *ar );
00096
00099 bool symmetricMatch();
00100
00103 bool rightMatchesLeft();
00104
00107 bool leftMatchesRight();
00108
00114 bool ReplaceLeftAd( ClassAd *al );
00115
00121 bool ReplaceRightAd( ClassAd *ar );
00122
00126 ClassAd *GetLeftAd();
00127
00131 ClassAd *GetRightAd();
00132
00137 ClassAd *GetLeftContext( );
00138
00143 ClassAd *GetRightContext( );
00144
00151 ClassAd *RemoveLeftAd( );
00152
00159 ClassAd *RemoveRightAd( );
00160
00171 static bool OptimizeRightAdForMatchmaking( ClassAd *ad, std::string *error_msg );
00172
00183 static bool OptimizeLeftAdForMatchmaking( ClassAd *ad, std::string *error_msg );
00184
00189 static bool UnoptimizeAdForMatchmaking( ClassAd *ad );
00190
00191 protected:
00192 const ClassAd *ladParent, *radParent;
00193 ClassAd *lCtx, *rCtx, *lad, *rad;
00194 ExprTree *symmetric_match, *right_matches_left, *left_matches_right;
00195
00196 private:
00197
00198
00199
00200
00201 MatchClassAd(const MatchClassAd &) : ClassAd(){ return; }
00202 MatchClassAd &operator=(const MatchClassAd &) { return *this; }
00203
00215 static bool OptimizeAdForMatchmaking( ClassAd *ad, bool is_right, std::string *error_msg );
00216
00220 bool EvalMatchExpr(ExprTree *match_expr);
00221 };
00222
00223 END_NAMESPACE
00224
00225 #endif