Main Page | Class Hierarchy | Class List | File List | Class Members

ClassAd Class Reference

The ClassAd object represents a parsed ClassAd. More...

#include <classad.h>

Inheritance diagram for ClassAd:

Inheritance graph
[legend]
Collaboration diagram for ClassAd:

Collaboration graph
[legend]
List of all members.

STL-like Iterators

typedef AttrList::iterator iterator
 Define an iterator we can use on a ClassAd.

typedef AttrList::const_iterator const_iterator
 Define a constatnt iterator we can use on a ClassAd.

iterator begin ()
 Returns an iterator pointing to the beginning of the attribute/value pairs in the ClassAd.

const_iterator begin () const
 Returns a constant iterator pointing to the beginning of the attribute/value pairs in the ClassAd.

iterator end ()
 Returns aniterator pointing past the end of the attribute/value pairs in the ClassAd.

const_iterator end () const
 Returns a constant iterator pointing past the end of the attribute/value pairs in the ClassAd.

iterator find (std::string const &attrName)
 Return an interator pointing to the attribute with a particular name.

const_iterator find (std::string const &attrName) const
 Return a constant interator pointing to the attribute with a particular name.

int size (void) const
 Return the number of attributes at the root level of this ClassAd.


Dirty Tracking

typedef DirtyAttrList::iterator dirtyIterator
void EnableDirtyTracking (void)
 Turn on dirty tracking for this ClassAd.

void DisableDirtyTracking (void)
 Turn off ditry tracking for this ClassAd.

void ClearAllDirtyFlags (void)
 Mark all attributes in the ClassAd as not dirty.

void MarkAttributeDirty (const std::string &name)
 Mark a particular attribute as dirty.

void MarkAttributeClean (const std::string &name)
 Mark a particular attribute as not dirty.

bool IsAttributeDirty (const std::string &name)
 Return true if an attribute is dirty.

dirtyIterator dirtyBegin ()
 Return an interator to the first dirty attribute so all dirty attributes can be iterated through.

dirtyIterator dirtyEnd ()
 Return an iterator past the last dirty attribute.


Constructors/Destructor

 ClassAd ()
 Default constructor.

 ClassAd (const ClassAd &ad)
 ad The ClassAd to copy

 ~ClassAd ()
 Destructor.


Insertion Methods

bool Insert (const std::string &attrName, ExprTree *expr)
 Inserts an attribute into the ClassAd.

bool DeepInsert (ExprTree *scopeExpr, const std::string &attrName, ExprTree *expr)
 Inserts an attribute into a nested classAd.

bool InsertAttr (const std::string &attrName, int value, Value::NumberFactor f=Value::NO_FACTOR)
 Inserts an attribute into the ClassAd.

bool DeepInsertAttr (ExprTree *scopeExpr, const std::string &attrName, int value, Value::NumberFactor f=Value::NO_FACTOR)
 Inserts an attribute into a nested classad.

bool InsertAttr (const std::string &attrName, double value, Value::NumberFactor f=Value::NO_FACTOR)
 Inserts an attribute into the ClassAd.

bool DeepInsertAttr (ExprTree *scopeExpr, const std::string &attrName, double value, Value::NumberFactor f=Value::NO_FACTOR)
 Inserts an attribute into a nested classad.

bool InsertAttr (const std::string &attrName, bool value)
 Inserts an attribute into the ClassAd.

bool DeepInsertAttr (ExprTree *scopeExpr, const std::string &attrName, bool value)
 Inserts an attribute into a nested classad.

bool InsertAttr (const std::string &attrName, const char *value)
 Inserts an attribute into the ClassAd.

bool DeepInsertAttr (ExprTree *scopeExpr, const std::string &attrName, const char *value)
 Inserts an attribute into a nested classad.

bool InsertAttr (const std::string &attrName, const std::string &value)
 Inserts an attribute into the ClassAd.

bool DeepInsertAttr (ExprTree *scopeExpr, const std::string &attrName, const std::string &value)
 Inserts an attribute into a nested classad.


Lookup Methods

ExprTreeLookup (const std::string &attrName) const
 Finds the expression bound to an attribute name.

ExprTreeLookupInScope (const std::string &attrName, const ClassAd *&ad) const
 Finds the expression bound to an attribute name.


Attribute Deletion Methods

void Clear ()
 Clears the ClassAd of all attributes.

bool Delete (const std::string &attrName)
 Deletes the named attribute from the ClassAd.

bool DeepDelete (const std::string &scopeExpr, const std::string &attrName)
 Deletes the named attribute from a nested classAd.

bool DeepDelete (ExprTree *scopeExpr, const std::string &attrName)
 Deletes the named attribute from a nested classAd.

ExprTreeRemove (const std::string &attrName)
 Similar to Delete, but the expression is returned rather than deleted from the classad.

ExprTreeDeepRemove (const std::string &scopeExpr, const std::string &attrName)
 Similar to DeepDelete, but the expression is returned rather than deleted from the classad.

ExprTreeDeepRemove (ExprTree *scopeExpr, const std::string &attrName)
 Similar to DeepDelete, but the expression is returned rather than deleted from the classad.


Evaluation Methods

bool EvaluateAttr (const std::string &attrName, Value &result) const
 Evaluates expression bound to an attribute.

bool EvaluateExpr (const std::string &buf, Value &result) const
 Evaluates an expression.

bool EvaluateExpr (const ExprTree *expr, Value &result) const
 Evaluates an expression.

bool EvaluateExpr (const ExprTree *expr, Value &result, ExprTree *&sig) const
 Evaluates an expression, and returns the significant subexpressions encountered during the evaluation.

bool EvaluateAttrInt (const std::string &attr, int &intValue) const
 Evaluates an attribute to an integer.

bool EvaluateAttrReal (const std::string &attr, double &realValue) const
 Evaluates an attribute to a real.

bool EvaluateAttrNumber (const std::string &attr, int &intValue) const
 Evaluates an attribute to an integer.

bool EvaluateAttrNumber (const std::string &attr, double &realValue) const
 Evaluates an attribute to a real.

bool EvaluateAttrString (const std::string &attr, char *buf, int len) const
 Evaluates an attribute to a string.

bool EvaluateAttrString (const std::string &attr, std::string &buf) const
 Evaluates an attribute to a string.

bool EvaluateAttrBool (const std::string &attr, bool &boolValue) const
 Evaluates an attribute to a boolean.

bool EvaluateAttrClassAd (const std::string &attr, ClassAd *&classad) const
 Evaluates an attribute to a ClassAd.

bool EvaluateAttrList (const std::string &attr, ExprList *&l) const
 Evaluates an attribute to an ExprList.


Miscellaneous

void GetComponents (std::vector< std::pair< std::string, ExprTree * > > &vec) const
 Deconstructor to get the components of a classad.

void Update (const ClassAd &ad)
 Make sure everything in the ad is in this ClassAd.

void Modify (ClassAd &ad)
 Modify this ClassAd in a specific way Ad is a ClassAd that looks like: [ Context = expr; // Sub-ClassAd to operate on Replace = classad; // ClassAd to Update() replace context Updates = classad; // ClassAd to merge into context (via Update()) Deletes = {a1, a2}; // A list of attribute names to delete from the context.

virtual ExprTreeCopy () const
 Makes a deep copy of the ClassAd.

ClassAdoperator= (const ClassAd &rhs)
 Make a deep copy of the ClassAd, via the == operator.

bool CopyFrom (const ClassAd &ad)
 Fill in this ClassAd with the contents of the other ClassAd.

virtual bool SameAs (const ExprTree *tree) const
 Is this ClassAd the same as the tree? Two ClassAds are identical if they have the same number of elements, and each is the SameAs() the other.

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

bool FlattenAndInline (const ExprTree *expr, Value &val, ExprTree *&fexpr) const
bool GetExternalReferences (const ExprTree *tree, References &refs, bool fullNames)
 Return a list of attribute references in the expression that are not contained within this ClassAd.

bool GetExternalReferences (const ExprTree *tree, PortReferences &refs)
 Return a list of attribute references in the expression that are not contained within this ClassAd.

ClassAdMakeClassAd (std::vector< std::pair< std::string, ExprTree * > > &vec)
 Factory method to make a classad.

bool operator== (ClassAd &list1, ClassAd &list2)
 Are the two ClassAds the same? Uses SameAs() to decide if they are the same.


Deprecated functions (only for use within Condor)

int Insert (const char *str)
 Insert an attribute/value into the ClassAd.

int InsertOrUpdate (const char *expr)
 Insert an attribute/value into the ClassAd.

int LookupString (const char *name, char *value) const
 Lookup (don't evaluate) an attribute that is a string.

int LookupString (const char *name, char *value, int max_len) const
 Lookup (don't evaluate) an attribute that is a string.

int LookupString (const char *name, char **value) const
 Lookup (don't evaluate) an attribute that is a string.

int LookupInteger (const char *name, int &value) const
 Lookup (don't evaluate) an attribute that is an integer.

int LookupFloat (const char *name, float &value) const
 Lookup (don't evaluate) an attribute that is a float.

int LookupBool (const char *name, int &value) const
 Lookup (don't evaluate) an attribute that can be considered a boolean.

int LookupBool (const char *name, bool &value) const
 Lookup (don't evaluate) an attribute that can be considered a boolean.

int EvalString (const char *name, class ClassAd *target, char *value)
 Lookup and evaluate an attribute in the ClassAd that is a string.

int EvalInteger (const char *name, class ClassAd *target, int &value)
 Lookup and evaluate an attribute in the ClassAd that is an integer.

int EvalFloat (const char *name, class ClassAd *target, float &value)
 Lookup and evaluate an attribute in the ClassAd that is a float.

int EvalBool (const char *name, class ClassAd *target, int &value)
 Lookup and evaluate an attribute in the ClassAd that is a boolean.

 ClassAd (FILE *, char *, int &, int &, int &)
 A constructor that reads old ClassAds from a FILE.

void SetMyTypeName (const char *)
 Set the MyType attribute.

const char * GetMyTypeName ()
 Get the value of the MyType attribute.

void SetTargetTypeName (const char *)
 Set the value of the TargetType attribute.

const char * GetTargetTypeName ()
 Get the value of the TargetType attribtute.

int put (Stream &s)
 Print the ClassAd as an old ClassAd to the stream.

int initFromStream (Stream &s)
 Read the old ClassAd from the stream, and fill in this ClassAd.

virtual int fPrint (FILE *file)
 Print the ClassAd as an old ClassAd to the FILE.

void dPrint (int level)
 Print the ClassAd as an old ClasAd with dprintf.

bool AddExplicitConditionals (ExprTree *expr, ExprTree *&newExpr)
ClassAdAddExplicitTargetRefs ()

Chaining functions

void ChainToAd (ClassAd *new_chain_parent_ad)
 Chain this ad to the parent ad.

void Unchain (void)
 If we are chained to a parent ad, remove the chain.


Friends

class AttributeReference
class ExprTree
class EvalState
class ClassAdIterator

Detailed Description

The ClassAd object represents a parsed ClassAd.


Member Function Documentation

void ClassAd::ChainToAd ClassAd new_chain_parent_ad  ) 
 

Chain this ad to the parent ad.

After chaining, any attribute we look for that is not in this ad will be looked for in the parent ad. This is a simple form of compression: many ads can be linked to a parent ad that contains common attributes between the ads. If an attribute is in both this ad and the parent, a lookup will only show it in the parent. If we make any modifications to this ad, it will not affect the parent.

Parameters:
new_chain_parent_ad the parent ad we are chained too.

virtual ExprTree* ClassAd::Copy  )  const [virtual]
 

Makes a deep copy of the ClassAd.

Returns:
A deep copy of the ClassAd, or NULL on failure.

Implements ExprTree.

bool ClassAd::CopyFrom const ClassAd ad  ) 
 

Fill in this ClassAd with the contents of the other ClassAd.

This ClassAd is cleared of its contents before the copy happens.

Returns:
true if the copy succeeded, false otherwise.

bool ClassAd::DeepDelete ExprTree scopeExpr,
const std::string &  attrName
 

Deletes the named attribute from a nested classAd.

The scope expression is evaluated to obtain a nested classad, and the attribute is then deleted from this ad. Only attributes from the local ClassAd are considered; scoping information is ignored. The expression bound to the attribute is deleted.

Parameters:
scopeExpr The scope expression.
attrName The name of the attribute to be delete.
Returns:
true if the attribute previously existed and was successfully removed, false otherwise.

bool ClassAd::DeepDelete const std::string &  scopeExpr,
const std::string &  attrName
 

Deletes the named attribute from a nested classAd.

The scope expression is evaluated to obtain a nested classad, and the attribute is then deleted from this ad. Only attributes from the local ClassAd are considered; scoping information is ignored. The expression bound to the attribute is deleted.

Parameters:
scopeExpr String representation of the scope expression.
attrName The name of the attribute to be delete.
Returns:
true if the attribute previously existed and was successfully removed, false otherwise.

bool ClassAd::DeepInsert ExprTree scopeExpr,
const std::string &  attrName,
ExprTree expr
 

Inserts an attribute into a nested classAd.

The scope expression is evaluated to obtain a nested classad, and the attribute is inserted into this subclassad. The setParentScope() method is invoked on the inserted expression.

Parameters:
scopeExpr The scope expression.
attrName The name of the attribute.
expr The expression bound to the name.
Returns:
true if the operation succeeded, false otherwise.
See also:
ExprTree::setParentScope

bool ClassAd::DeepInsertAttr ExprTree scopeExpr,
const std::string &  attrName,
const std::string &  value
 

Inserts an attribute into a nested classad.

The scope expression is evaluated to obtain a nested classad, and the insertion is made in the nested classad. The string value is converted into a Literal expression to yield the expression to be inserted.

Parameters:
scopeExpr The scope expression.
attrName The name of the attribute.
value The string attribute

bool ClassAd::DeepInsertAttr ExprTree scopeExpr,
const std::string &  attrName,
const char *  value
 

Inserts an attribute into a nested classad.

The scope expression is evaluated to obtain a nested classad, and the insertion is made in the nested classad. The string value is converted into a Literal expression to yield the expression to be inserted.

Parameters:
scopeExpr The scope expression.
attrName The name of the attribute.
value The string attribute

bool ClassAd::DeepInsertAttr ExprTree scopeExpr,
const std::string &  attrName,
bool  value
 

Inserts an attribute into a nested classad.

The scope expression is evaluated to obtain a nested classad, and the insertion is made in the nested classad. The boolean value is converted into a Literal expression to yield the expression to be inserted.

Parameters:
scopeExpr The scope expression.
attrName The name of the attribute. This string is always duplicated internally.
value The string attribute

bool ClassAd::DeepInsertAttr ExprTree scopeExpr,
const std::string &  attrName,
double  value,
Value::NumberFactor  f = Value::NO_FACTOR
 

Inserts an attribute into a nested classad.

The scope expression is evaluated to obtain a nested classad, and the insertion is made in the nested classad. The double value is converted into a Literal expression to yield the expression to be inserted.

Parameters:
scopeExpr String representation of the scope expression.
attrName The name of the attribute.
value The string attribute
f A multipler for the number.
See also:
Value::NumberFactor
Returns:
true on success, false otherwise

bool ClassAd::DeepInsertAttr ExprTree scopeExpr,
const std::string &  attrName,
int  value,
Value::NumberFactor  f = Value::NO_FACTOR
 

Inserts an attribute into a nested classad.

The scope expression is evaluated to obtain a nested classad, and the attribute is inserted into this subclassad. The integer value is converted into a Literal expression, and then inserted into the nested classad.

Parameters:
scopeExpr The scope expression.
attrName The name of the attribute.
value The integer value of the attribute.
f The multiplicative factor to be attached to value.
See also:
Value::NumberFactor

ExprTree* ClassAd::DeepRemove ExprTree scopeExpr,
const std::string &  attrName
 

Similar to DeepDelete, but the expression is returned rather than deleted from the classad.

Parameters:
scopeExpr The scope expression
attrName The name of the attribute to be extricated.
Returns:
The expression tree of the named attribute, or NULL if the attribute could not be found.
See also:
Delete

ExprTree* ClassAd::DeepRemove const std::string &  scopeExpr,
const std::string &  attrName
 

Similar to DeepDelete, but the expression is returned rather than deleted from the classad.

Parameters:
scopeExpr String representation of the scope expression
attrName The name of the attribute to be extricated.
Returns:
The expression tree of the named attribute, or NULL if the attribute could not be found.
See also:
Delete

bool ClassAd::Delete const std::string &  attrName  ) 
 

Deletes the named attribute from the ClassAd.

Only attributes from the local ClassAd are considered; scoping information is ignored. The expression bound to the attribute is deleted.

Parameters:
attrName The name of the attribute to be delete.
Returns:
true if the attribute previously existed and was successfully removed, false otherwise.

void ClassAd::dPrint int  level  ) 
 

Print the ClassAd as an old ClasAd with dprintf.

Parameters:
level The dprintf level.

void ClassAd::EnableDirtyTracking void   )  [inline]
 

Turn on dirty tracking for this ClassAd.

If tracking is on, every insert will label the attribute that was inserted as dirty. Dirty tracking is always turned off during Copy() and CopyFrom().

int ClassAd::EvalBool const char *  name,
class ClassAd target,
int &  value
 

Lookup and evaluate an attribute in the ClassAd that is a boolean.

Parameters:
name The name of the attribute
target A ClassAd to resolve MY or other references
value Where we a 1 (if the value is non-zero) or a 1.
Returns:
1 on success, 0 if the attribute doesn't exist, or if it does exist but is not a number.

int ClassAd::EvalFloat const char *  name,
class ClassAd target,
float &  value
 

Lookup and evaluate an attribute in the ClassAd that is a float.

Parameters:
name The name of the attribute
target A ClassAd to resolve MY or other references
value Where we the copy the value. Danger: we just use strcpy.
Returns:
1 on success, 0 if the attribute doesn't exist, or if it does exist but is not a float.

int ClassAd::EvalInteger const char *  name,
class ClassAd target,
int &  value
 

Lookup and evaluate an attribute in the ClassAd that is an integer.

Parameters:
name The name of the attribute
target A ClassAd to resolve MY or other references
value Where we the copy the value.
Returns:
1 on success, 0 if the attribute doesn't exist, or if it does exist but is not an integer

int ClassAd::EvalString const char *  name,
class ClassAd target,
char *  value
 

Lookup and evaluate an attribute in the ClassAd that is a string.

Parameters:
name The name of the attribute
target A ClassAd to resolve MY or other references
value Where we the copy the string. Danger: we just use strcpy.
Returns:
1 on success, 0 if the attribute doesn't exist, or if it does exist but is not a string.

bool ClassAd::EvaluateAttr const std::string &  attrName,
Value result
const
 

Evaluates expression bound to an attribute.

Parameters:
attrName The name of the attribute in the ClassAd.
result The result of the evaluation.

bool ClassAd::EvaluateAttrBool const std::string &  attr,
bool &  boolValue
const
 

Evaluates an attribute to a boolean.

A pointer to the string is returned.

Parameters:
attr The name of the attribute.
boolValue The value of the attribute.
Returns:
true if attrName evaluated to a boolean value, false otherwise.

bool ClassAd::EvaluateAttrClassAd const std::string &  attr,
ClassAd *&  classad
const
 

Evaluates an attribute to a ClassAd.

A pointer to the ClassAd is returned. You do not own the ClassAd--do not free it.

Parameters:
attr The name of the attribute.
classad The value of the attribute.
Returns:
true if attrName evaluated to a ClassAd, false otherwise.

bool ClassAd::EvaluateAttrInt const std::string &  attr,
int &  intValue
const
 

Evaluates an attribute to an integer.

Parameters:
attr The name of the attribute.
intValue The value of the attribute.
Returns:
true if attrName evaluated to an integer, false otherwise.

bool ClassAd::EvaluateAttrList const std::string &  attr,
ExprList *&  l
const
 

Evaluates an attribute to an ExprList.

A pointer to the ExprList is returned. You do not own the ExprList--do not free it.

Parameters:
attr The name of the attribute.
l The value of the attribute.
Returns:
true if attrName evaluated to a ExprList, false otherwise.

bool ClassAd::EvaluateAttrNumber const std::string &  attr,
double &  realValue
const
 

Evaluates an attribute to a real.

If the attribute evaluated to an integer, it is promoted to a real.

Parameters:
attr The name of the attribute.
realValue The value of the attribute.
Returns:
true if attrName evaluated to a number, false otherwise.

bool ClassAd::EvaluateAttrNumber const std::string &  attr,
int &  intValue
const
 

Evaluates an attribute to an integer.

If the attribute evaluated to a real, it is truncated to an integer.

Parameters:
attr The name of the attribute.
intValue The value of the attribute.
Returns:
true if attrName evaluated to an number, false otherwise.

bool ClassAd::EvaluateAttrReal const std::string &  attr,
double &  realValue
const
 

Evaluates an attribute to a real.

Parameters:
attr The name of the attribute.
realValue The value of the attribute.
Returns:
true if attrName evaluated to a real, false otherwise.

bool ClassAd::EvaluateAttrString const std::string &  attr,
std::string &  buf
const
 

Evaluates an attribute to a string.

If the string value does not fit into the buffer, only the portion that does fit is copied over.

Parameters:
attr The name of the attribute.
buf The buffer for the string value.
Returns:
true iff attrName evaluated to a string

bool ClassAd::EvaluateAttrString const std::string &  attr,
char *  buf,
int  len
const
 

Evaluates an attribute to a string.

If the string value does not fit into the buffer, only the portion that does fit is copied over.

Parameters:
attr The name of the attribute.
buf The buffer for the string value.
len Size of buffer
Returns:
true iff attrName evaluated to a string

bool ClassAd::EvaluateExpr const ExprTree expr,
Value result,
ExprTree *&  sig
const
 

Evaluates an expression, and returns the significant subexpressions encountered during the evaluation.

If the expression doesn't already live in this ClassAd, call the setParentScope() method on it first.

Parameters:
expr The expression to be evaluated.
result The result of the evaluation.
sig The significant subexpressions of the evaluation.

bool ClassAd::EvaluateExpr const ExprTree expr,
Value result
const
 

Evaluates an expression.

If the expression doesn't already live in this ClassAd, the setParentScope() method must be called on it first.

Parameters:
expr The expression to be evaluated.
result The result of the evaluation.

bool ClassAd::EvaluateExpr const std::string &  buf,
Value result
const
 

Evaluates an expression.

Parameters:
buf Buffer containing the external representation of the expression. This buffer is parsed to yield the expression to be evaluated.
result The result of the evaluation.
Returns:
true if the operation succeeded, false otherwise.

bool ClassAd::Flatten const ExprTree expr,
Value val,
ExprTree *&  fexpr
const
 

Flattens (a partial evaluation operation) the given expression in the context of the classad.

Parameters:
expr The expression to be flattened.
val The value after flattening, if the expression was completely flattened. This value is valid if and only if fexpr is NULL.
fexpr The flattened expression tree if the expression did not flatten to a single value, and NULL otherwise.
Returns:
true if the flattening was successful, and false otherwise.

virtual int ClassAd::fPrint FILE *  file  )  [virtual]
 

Print the ClassAd as an old ClassAd to the FILE.

Parameters:
file The file handle to print to.
Returns:
TRUE

void ClassAd::GetComponents std::vector< std::pair< std::string, ExprTree * > > &  vec  )  const
 

Deconstructor to get the components of a classad.

Parameters:
vec A vector of (name,expression) pairs which are the attributes of the classad

bool ClassAd::GetExternalReferences const ExprTree tree,
PortReferences &  refs
 

Return a list of attribute references in the expression that are not contained within this ClassAd.

Parameters:
tree The ExprTree for the expression that has references that you are wish to know about.
refs The list of references
Returns:
true on success, false on failure.

bool ClassAd::GetExternalReferences const ExprTree tree,
References &  refs,
bool  fullNames
 

Return a list of attribute references in the expression that are not contained within this ClassAd.

Parameters:
tree The ExprTree for the expression that has references that you are wish to know about.
refs The list of references
fullNames true if you want full names (like other.foo)
Returns:
true on success, false on failure.

int ClassAd::initFromStream Stream &  s  ) 
 

Read the old ClassAd from the stream, and fill in this ClassAd.

Parameters:
s the stream

int ClassAd::Insert const char *  str  ) 
 

Insert an attribute/value into the ClassAd.

Parameters:
str A string of the form "Attribute = Value"

bool ClassAd::Insert const std::string &  attrName,
ExprTree expr
 

Inserts an attribute into the ClassAd.

The setParentScope() method is invoked on the inserted expression.

Parameters:
attrName The name of the attribute.
expr The expression bound to the name.
Returns:
true if the operation succeeded, false otherwise.
See also:
ExprTree::setParentScope

bool ClassAd::InsertAttr const std::string &  attrName,
const std::string &  value
 

Inserts an attribute into the ClassAd.

The string value is converted into a Literal expression, and then inserted into the classad.

Parameters:
attrName The name of the attribute.
value The string attribute

bool ClassAd::InsertAttr const std::string &  attrName,
const char *  value
 

Inserts an attribute into the ClassAd.

The string value is converted into a Literal expression, and then inserted into the classad.

Parameters:
attrName The name of the attribute.
value The string attribute

bool ClassAd::InsertAttr const std::string &  attrName,
bool  value
 

Inserts an attribute into the ClassAd.

The boolean value is converted into a Literal expression, and then inserted into the classad.

Parameters:
attrName The name of the attribute.
value The boolean value of the attribute.

bool ClassAd::InsertAttr const std::string &  attrName,
double  value,
Value::NumberFactor  f = Value::NO_FACTOR
 

Inserts an attribute into the ClassAd.

The real value is converted into a Literal expression, and then inserted into the classad.

Parameters:
attrName The name of the attribute.
value The real value of the attribute.
f The multiplicative factor to be attached to value.
See also:
Value::NumberFactor
Returns:
true on success, false otherwise

bool ClassAd::InsertAttr const std::string &  attrName,
int  value,
Value::NumberFactor  f = Value::NO_FACTOR
 

Inserts an attribute into the ClassAd.

The integer value is converted into a Literal expression, and then inserted into the classad.

Parameters:
attrName The name of the attribute.
value The integer value of the attribute.
f The multiplicative factor to be attached to value.
See also:
Value::NumberFactor e

int ClassAd::InsertOrUpdate const char *  expr  )  [inline]
 

Insert an attribute/value into the ClassAd.

Parameters:
expr A string of the form "Attribute = Value"

bool ClassAd::IsAttributeDirty const std::string &  name  ) 
 

Return true if an attribute is dirty.

Parameters:
name The attribute name
Returns:
true if the attribute is dirty, false otherwise

ExprTree* ClassAd::Lookup const std::string &  attrName  )  const
 

Finds the expression bound to an attribute name.

The lookup only involves this ClassAd; scoping information is ignored.

Parameters:
attrName The name of the attribute.
Returns:
The expression bound to the name in the ClassAd, or NULL otherwise.

int ClassAd::LookupBool const char *  name,
bool &  value
const
 

Lookup (don't evaluate) an attribute that can be considered a boolean.

Parameters:
name The attribute
value false if the attribute is 0, true otherwise
Returns:
true if the attribute exists and is a boolean/integer, false otherwise

int ClassAd::LookupBool const char *  name,
int &  value
const
 

Lookup (don't evaluate) an attribute that can be considered a boolean.

Parameters:
name The attribute
value 0 if the attribute is 0, 1 otherwise
Returns:
true if the attribute exists and is a boolean/integer, false otherwise

int ClassAd::LookupFloat const char *  name,
float &  value
const
 

Lookup (don't evaluate) an attribute that is a float.

Parameters:
name The attribute
value The integer
Returns:
true if the attribute exists and is a float, false otherwise

ExprTree* ClassAd::LookupInScope const std::string &  attrName,
const ClassAd *&  ad
const
 

Finds the expression bound to an attribute name.

The lookup uses the scoping structure (including super attributes) to determine the expression bound to the given attribute name in the closest enclosing scope. The closest enclosing scope is also returned.

Parameters:
attrName The name of the attribute.
ad The closest enclosing scope of the returned expression, or NULL if no expression was found.
Returns:
The expression bound to the name in the ClassAd, or NULL otherwise.

int ClassAd::LookupInteger const char *  name,
int &  value
const
 

Lookup (don't evaluate) an attribute that is an integer.

Parameters:
name The attribute
value The integer
Returns:
true if the attribute exists and is an integer, false otherwise

int ClassAd::LookupString const char *  name,
char **  value
const
 

Lookup (don't evaluate) an attribute that is a string.

Parameters:
name The attribute
value The string, allocated with malloc() not new.
Returns:
true if the attribute exists and is a string, false otherwise