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

AttributeReference Class Reference

Represents a attribute reference node (like .b) in the expression tree. More...

#include <attrrefs.h>

Inheritance diagram for AttributeReference:

Inheritance graph
[legend]
Collaboration diagram for AttributeReference:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 AttributeReference (const AttributeReference &ref)
 Copy Constructor.

 ~AttributeReference ()
 Destructor.

AttributeReferenceoperator= (const AttributeReference &ref)
 Assignment operator.

void GetComponents (ExprTree *&expr, std::string &attr, bool &abs) const
 Deconstructor to get the components of an attribute reference.

virtual ExprTreeCopy () const
 Return a copy of this attribute reference.

bool CopyFrom (const AttributeReference &ref)
 Copy from the given reference into this reference.

virtual bool SameAs (const ExprTree *tree) const
 Is this attribute reference the same as another?


Static Public Member Functions

AttributeReferenceMakeAttributeReference (ExprTree *expr, const std::string &attrName, bool absolute=false)
 Factory method to create attribute reference nodes.


Protected Member Functions

 AttributeReference ()
 Constructor.


Friends

bool operator== (const AttributeReference &ref1, const AttributeReference &ref2)
 Are the two attribute references the same?


Detailed Description

Represents a attribute reference node (like .b) in the expression tree.


Member Function Documentation

bool AttributeReference::CopyFrom const AttributeReference ref  ) 
 

Copy from the given reference into this reference.

Parameters:
ref The reference to copy from.
Returns:
true if the copy succeeded, false otherwise.

void AttributeReference::GetComponents ExprTree *&  expr,
std::string &  attr,
bool &  abs
const
 

Deconstructor to get the components of an attribute reference.

Parameters:
expr The expression part of the reference (NULL for absolute or simple references)
attr The name of the attribute being referred to
abs true iff the reference is absolute (i.e., .attr)

AttributeReference* AttributeReference::MakeAttributeReference ExprTree expr,
const std::string &  attrName,
bool  absolute = false
[static]
 

Factory method to create attribute reference nodes.

Parameters:
expr The expression part of the reference (i.e., in case of expr.attr). This parameter is NULL if the reference is absolute (i.e., .attr) or simple (i.e., attr).
attrName The name of the reference. This string is duplicated internally.
absolute True if the reference is an absolute reference (i.e., in case of .attr). This parameter cannot be true if expr is not NULL

virtual bool AttributeReference::SameAs const ExprTree tree  )  const [virtual]
 

Is this attribute reference the same as another?

Parameters:
tree The reference to compare with
Returns:
true if they are the same, false otherwise.

Implements ExprTree.


Friends And Related Function Documentation

bool operator== const AttributeReference ref1,
const AttributeReference ref2
[friend]
 

Are the two attribute references the same?

Parameters:
ref1 An attribute reference
ref2 Another attribute reference
Returns:
true if they are the same, false otherwise.


The documentation for this class was generated from the following file: