00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __ATTRREFS_H__
00025 #define __ATTRREFS_H__
00026
00027 BEGIN_NAMESPACE( classad )
00028
00029
00030 class AttributeReference : public ExprTree
00031 {
00032 public:
00033
00035 AttributeReference(const AttributeReference &ref);
00036
00038 ~AttributeReference ();
00039
00041 AttributeReference &operator=(const AttributeReference &ref);
00042
00053 static AttributeReference *MakeAttributeReference(ExprTree *expr,
00054 const std::string &attrName, bool absolute=false);
00055
00062 void GetComponents( ExprTree *&expr,std::string &attr, bool &abs ) const;
00063
00066 virtual ExprTree* Copy( ) const;
00067
00072 bool CopyFrom(const AttributeReference &ref);
00073
00078 virtual bool SameAs(const ExprTree *tree) const;
00079
00085 friend bool operator==(const AttributeReference &ref1, const AttributeReference &ref2);
00086
00087 protected:
00089 AttributeReference ();
00090
00091 private:
00092
00093 AttributeReference( ExprTree*, const std::string &, bool );
00094 virtual void _SetParentScope( const ClassAd* p );
00095 virtual bool _Evaluate( EvalState & , Value & ) const;
00096 virtual bool _Evaluate( EvalState & , Value &, ExprTree*& ) const;
00097 virtual bool _Flatten( EvalState&, Value&, ExprTree*&, int* ) const;
00098 int FindExpr( EvalState&, ExprTree*&, ExprTree*&, bool ) const;
00099
00100 ExprTree *expr;
00101 bool absolute;
00102 std::string attributeStr;
00103 };
00104
00105 END_NAMESPACE
00106
00107 #endif//__ATTRREFS_H__