In file matchClassad.h:

class MatchClassAd : public ClassAd

Special case of a ClassAd which sets up the scope names for bilateral matching

Inheritance:

MatchClassAd < ClassAd < ExprTree


Public Methods

ClassAd* GetLeftAd()
Gets the ad in the left context
ClassAd* GetLeftContext( )
Gets the left context ad
ClassAd* GetRightAd()
Gets the ad in the right context
ClassAd* GetRightContext( )
Gets the right context ad
bool InitMatchClassAd( ClassAd* al, ClassAd *ar )
Method to initialize a MatchClassad given two ClassAds
static MatchClassAd* MakeMatchClassAd( ClassAd* al, ClassAd* ar )
Factory method to make a MatchClassad given two ClassAds to be matched
MatchClassAd()
Default constructor
MatchClassAd( ClassAd* al, ClassAd* ar )
Constructor which builds the CondorClassad given two ads
ClassAd* RemoveLeftAd( )
Removes the left candidate from the match classad
ClassAd* RemoveRightAd( )
Removes the right candidate from the match classad
bool ReplaceLeftAd( ClassAd *al )
Replaces ad in the left context, or insert one if an ad did not previously exist
bool ReplaceRightAd( ClassAd *ar )
Replaces ad in the right context, or insert one if an ad did not previously exist
~MatchClassAd()
Default destructor

Inherited from ClassAd:

Public Methods

void GetComponents( vector< pair< string, ExprTree *> > &vec )
ClassAd* MakeClassAd( vector< pair< string, ExprTree* > > &vec )

Public

Attribute Deletion Methods

void Clear( )
Clears the ClassAd of all attributes
bool Delete( const string &attrName )
Deletes the named attribute from the ClassAd
bool DeepDelete( const string &scopeExpr, const string &attrName )
Deletes the named attribute from a nested classAd
bool DeepDelete( ExprTree *scopeExpr, const string &attrName )
Deletes the named attribute from a nested classAd
ExprTree* Remove( const string &attrName )
Similar to Delete, but the expression is returned rather than deleted from the classad
ExprTree* DeepRemove( const string &scopeExpr, const string &attrName )
Similar to DeepDelete, but the expression is returned rather than deleted from the classad
ExprTree* DeepRemove( ExprTree *scopeExpr, const string &attrName )
Similar to DeepDelete, but the expression is returned rather than deleted from the classad

Constructors/Destructor

ClassAd()
Default constructor
ClassAd(const ClassAd &)
Copy constructor
~ClassAd()
Destructor

Evaluation Methods

bool EvaluateAttr( const string& attrName, Value &result )
Evaluates expression bound to an attribute
bool EvaluateExpr( const string& buf, Value &result )
Evaluates an expression
bool EvaluateExpr( ExprTree* expr, Value &result )
Evaluates an expression
bool EvaluateExpr( ExprTree* expr, Value &result, ExprTree *&sig)
Evaluates an expression, and returns the significant subexpressions encountered during the evaluation
bool EvaluateAttrInt( const string &attrName, int& intValue )
Evaluates an attribute to an integer
bool EvaluateAttrReal( const string &attrName, double& realValue )
Evaluates an attribute to a real
bool EvaluateAttrNumber( const string &attrName, int& intValue )
Evaluates an attribute to an integer
bool EvaluateAttrNumber(const string &attrName, double& realValue)
Evaluates an attribute to a real
bool EvaluateAttrString( const string &attrName, char *buf, int len)
Evaluates an attribute to a string
bool EvaluateAttrString( const string &attrName, string &buf )
Evaluates an attribute to a string
bool EvaluateAttrBool( const string &attrName, bool& boolValue )
Evaluates an attribute to a boolean

Inherited virtual methods

virtual ClassAd* Copy( )
Makes a deep copy of the expression tree

Insertion Methods

bool Insert( const string &attrName, ExprTree *expr )
Inserts an attribute into the ClassAd
bool DeepInsert( ExprTree *scopeExpr, const string &attrName, ExprTree *expr )
Inserts an attribute into a nested classAd
bool InsertAttr( const string &attrName, int value, Value::NumberFactor f=Value::NO_FACTOR )
Inserts an attribute into the ClassAd
bool DeepInsertAttr( ExprTree *scopeExpr, const string &attrName, int value, Value::NumberFactor f=Value::NO_FACTOR )
Inserts an attribute into a nested classad
bool InsertAttr( const string &attrName, double value, Value::NumberFactor f=Value::NO_FACTOR)
Inserts an attribute into the ClassAd
bool DeepInsertAttr( ExprTree *scopeExpr, const string &attrName, double value, Value::NumberFactor f=Value::NO_FACTOR)
Inserts an attribute into a nested classad
bool InsertAttr( const string &attrName, bool value )
Inserts an attribute into the ClassAd
bool DeepInsertAttr( ExprTree *scopeExpr, const string &attrName, bool value )
Inserts an attribute into a nested classad
bool InsertAttr( const string &attrName, const string &value )
Inserts an attribute into the ClassAd
bool DeepInsertAttr( ExprTree *scopeExpr, const string &attrName, const string &value )
Inserts an attribute into a nested classad

Lookup Methods

ExprTree* Lookup( const string &attrName )
Finds the expression bound to an attribute name
ExprTree* LookupInScope(const string &attrName, const ClassAd *&ad)
Finds the expression bound to an attribute name

Miscellaneous

bool Flatten( const ExprTree* expr, Value& val, ExprTree *&fexpr )
Flattens (a partial evaluation operation) the given expression in the context of the classad

Inherited from ExprTree:

Public Classes

enum NodeKind
LITERAL_NODE
Literal node (string, integer, real, boolean, undefined, error)
ATTRREF_NODE
Attribute reference node (attr, .attr, expr.attr)
OP_NODE
Expression operation node (unary, binary, ternary)/
FN_CALL_NODE
Function call node
CLASSAD_NODE
ClassAd node
EXPR_LIST_NODE
Expression list node

Public Methods

virtual ExprTree* Copy( )
NodeKind GetKind(void)
const ClassAd* GetParentScope( )
void Puke( )
void SetParentScope( const ClassAd* p )

Public

enum NodeKind
LITERAL_NODE
Literal node (string, integer, real, boolean, undefined, error)
ATTRREF_NODE
Attribute reference node (attr, .attr, expr.attr)
OP_NODE
Expression operation node (unary, binary, ternary)/
FN_CALL_NODE
Function call node
CLASSAD_NODE
ClassAd node
EXPR_LIST_NODE
Expression list node

Documentation

Special case of a ClassAd which sets up the scope names for bilateral matching. The top-level scope is defined as follows:
|   [
|      symmetricMatch   = leftMatchesRight && rightMatchesLeft;
|      leftMatchesRight = adcr.ad.requirements;
|      rightMatchesLeft = adcl.ad.requirements;
|      leftRankValue    = adcl.ad.rank;
|      rightRankValue   = adcr.ad.rank;
|      adcl             =
|          [
|              other    = .adcr.ad;
|              my       = ad;       // for condor backwards compatibility
|              target   = other;    // for condor backwards compatibility
|              ad       = 
|                 [
|                     // the ``left'' match candidate goes here
|                 ]
|   	   ];
|      adcl             =
|          [
|              other    = .adcl.ad;
|              my       = ad;       // for condor backwards compatibility
|              target   = other;    // for condor backwards compatibility
|              ad       = 
|                 [
|                     // the ``right'' match candidate goes here
|                 ]
|   	   ];
|   ]
MatchClassAd( ClassAd* al, ClassAd* ar )
Constructor which builds the CondorClassad given two ads
Parameters:
al - The left candidate ad
ar - The right candidate ad

static MatchClassAd* MakeMatchClassAd( ClassAd* al, ClassAd* ar )
Factory method to make a MatchClassad given two ClassAds to be matched
Returns:
A CondorClassad, or NULL if the operation failed.
Parameters:
al - The ad to be placed in the left context.
ar - The ad to be placed in the right context.

bool InitMatchClassAd( ClassAd* al, ClassAd *ar )
Method to initialize a MatchClassad given two ClassAds. The old expressions in the classad are deleted.
Returns:
true if the operation succeeded, false otherwise
Parameters:
al - The ad to be placed in the left context.
ar - The ad to be placed in the right context.

bool ReplaceLeftAd( ClassAd *al )
Replaces ad in the left context, or insert one if an ad did not previously exist
Returns:
true if the operation succeeded and false otherwise.
Parameters:
al - The ad to be placed in the left context.

bool ReplaceRightAd( ClassAd *ar )
Replaces ad in the right context, or insert one if an ad did not previously exist
Returns:
true if the operation succeeded and false otherwise.
Parameters:
ar - The ad to be placed in the right context.

ClassAd* GetLeftAd()
Gets the ad in the left context
Returns:
The ClassAd, or NULL if the ad doesn't exist.

ClassAd* GetRightAd()
Gets the ad in the right context
Returns:
The ClassAd, or NULL if the ad doesn't exist.

ClassAd* GetLeftContext( )
Gets the left context ad. (.adcl in the above example)
Returns:
The left context ad, or NULL if the MatchClassAd is not valid

ClassAd* GetRightContext( )
Gets the right context ad. (.adcr in the above example)
Returns:
The left context ad, or NULL if the MatchClassAd is not valid

ClassAd* RemoveLeftAd( )
Removes the left candidate from the match classad. If the candidate ``lives'' in another data structure, this method should be called so that the match classad doesn't delete the candidate.
Returns:
The left candidate ad.

ClassAd* RemoveRightAd( )
Removes the right candidate from the match classad. If the candidate ``lives'' in another data structure, this method should be called so that the match classad doesn't delete the candidate.
Returns:
The right candidate ad.


This class has no child classes.

alphabetic index hierarchy of classes


Condor Home Page

generated by doc++