Role Class Reference

Represents a single role. More...

#include <role.h>

Collaboration diagram for Role:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Role (unsigned _id, ROLE_TYPE _type, unsigned _basing_var, unsigned _basing_fsa, PathExpression *_rel_path, PathExpression *_var_path)
 Constructor.
virtual ~Role ()
void print (OutputStream &dos) const
 Prints this single role.
virtual void printExtended (OutputStream &dos)
 Prints this single role with extended informations.
unsigned getId ()
 Returns the unique role ID.
void setId (unsigned _id)
 Sets the unique role ID.
ROLE_TYPE getType ()
 Returns the type of this single role.
unsigned getBasingVar ()
 Returns the basing variable of this single role.
unsigned getBasingFSA ()
 Returns the basing first straight ancestor (FSA) variable of this single role.
PathExpressiongetConcatenationPath ()
 Returns the concatenated path of this single role.
SignOffExpressiongetSignOffExpression ()
 Returns the corresponding signOff-statement of this single role.
bool isPosRole ()
 Returns if this single role derives from a [position()=1] PathStepAttributePosition.
bool isDosRole ()
 Returns if this single role derives from a /dos::node() PathStepExpression.

Private Attributes

unsigned id
 The unique role ID.
ROLE_TYPE type
 The type of this single role.
unsigned basing_var
 The basing variable of this single role.
unsigned basing_fsa
 The basing first straight ancestor (FSA) variable of this single role.
PathExpressionrel_path
 The relative path of this single role.
PathExpressionvar_path
 The path of the variable of this single role.
PathExpressionconcat_path
 The constructed concatenated path of this single role.


Detailed Description

Represents a single role.

Represents a single role, which is removed from BufferNode by a SignOffExpression.

Note:
Variables are internally represented by numbers!
Author:
Michael Schmidt

Gunnar Jehl

Version:
2.1
License:
Software License Agreement (BSD License)

Definition at line 57 of file role.h.


Constructor & Destructor Documentation

Role::Role ( unsigned  _id,
ROLE_TYPE  _type,
unsigned  _basing_var,
unsigned  _basing_fsa,
PathExpression _rel_path,
PathExpression _var_path 
)

Constructor.

Constructor - creating object for a role ID, a ROLE_TYPE, a basing variable, a basing first straight ancestor (FSA) variable and two PathExpression.

Parameters:
[in] _id Unique role ID.
[in] _type ROLE_TYPE.
[in] _basing_var Basing variable.
[in] _basing_fsa Basing first straight ancestor (FSA) variable.
[in] _rel_path Relative path.
[in] _var_path Path of the variable.

Definition at line 39 of file role.cpp.

References PathExpression::addPathStep(), PathExpression::clone(), concat_path, PathExpression::getPathSteps(), rel_path, and var_path.

Role::~Role (  )  [virtual]

Destructor.

Definition at line 59 of file role.cpp.

References concat_path, rel_path, and var_path.


Member Function Documentation

unsigned Role::getBasingFSA (  )  [inline]

Returns the basing first straight ancestor (FSA) variable of this single role.

Returns the basing first straight ancestor (FSA) variable of this single role, i.e. returns the member variable.

Return values:
unsigned Basing first straight ancestor (FSA) variable of this single role.

Definition at line 135 of file role.h.

References basing_fsa.

unsigned Role::getBasingVar (  )  [inline]

Returns the basing variable of this single role.

Returns the basing variable of this single role, i.e. returns the member variable.

Return values:
unsigned Basing variable of this single role.

Definition at line 126 of file role.h.

References basing_var.

Referenced by ProjectionTreeNode::print().

PathExpression * Role::getConcatenationPath (  )  [inline]

Returns the concatenated path of this single role.

Returns the concatenated path of this single role, which is the resulting PathExpression on concatenating the relative path (rel_path) with the path of the variable (var_path).

Return values:
PathExpression* Pointer to a PathExpression obejct.

Definition at line 145 of file role.h.

References concat_path.

unsigned Role::getId (  )  [inline]

Returns the unique role ID.

Returns the unique role ID, i.e. returns the member variable.

Return values:
unsigned Unique role ID of this single role.

Definition at line 100 of file role.h.

References id.

Referenced by ProjectionTreeNode::print(), DependencyTuple::print(), and BufferNode::removeRoleFromNode().

SignOffExpression * Role::getSignOffExpression (  ) 

Returns the corresponding signOff-statement of this single role.

Returns the corresponding signOff-statement of this single role.

Return values:
SignOffExpression* Pointer to a SignOffExpression object.

Definition at line 79 of file role.cpp.

References basing_fsa, PathExpression::clone(), concat_path, PathExpression::isEmptyPath(), and VarExpression::setId().

ROLE_TYPE Role::getType (  )  [inline]

Returns the type of this single role.

Returns the type of this single role.

Return values:
ROLE_TYPE. 

Definition at line 117 of file role.h.

References type.

Referenced by ProjectionTreeNode::print().

bool Role::isDosRole (  ) 

Returns if this single role derives from a /dos::node() PathStepExpression.

Returns if this single role derives from a /dos::node() PathStepExpression.

Return values:
bool true if this single role derives from a /dos::node() PathStepExpression, false otherwise.

Definition at line 100 of file role.cpp.

References PathExpression::getTailPathStep(), PathStepExpression::isDosNodeStep(), PathExpression::isEmptyPath(), and var_path.

Referenced by ProjectionTreeNode::isDosDepNode(), and BufferNode::removeRoleFromNode().

bool Role::isPosRole (  ) 

Returns if this single role derives from a [position()=1] PathStepAttributePosition.

Returns if this single role derives from a [position()=1] PathStepAttributePosition.

Return values:
bool true if this single role derives from a [position()=1] PathStepAttributePosition, false otherwise.

Definition at line 94 of file role.cpp.

References PathStepExpression::getAttribute(), PathExpression::getTailPathStep(), PathStepAttribute::getType(), PathStepExpression::hasAttribute(), and var_path.

Referenced by ProjectionTreeNode::isPosDepNode().

void Role::print ( OutputStream dos  )  const

Prints this single role.

Prints this single role.

Parameters:
[in] dos Pointer to a OutputStream object.
Return values:
void 

Definition at line 65 of file role.cpp.

References id.

Referenced by operator<<().

void Role::printExtended ( OutputStream dos  )  [virtual]

Prints this single role with extended informations.

Prints this single role with extended informations.

Parameters:
[in] dos Pointer to a OutputStream object.
Return values:
void 

Definition at line 69 of file role.cpp.

References basing_fsa, basing_var, VarName::getInstance(), VarName::getVarname(), PathExpression::isEmptyPath(), rel_path, and var_path.

void Role::setId ( unsigned  _id  )  [inline]

Sets the unique role ID.

Sets the unique role ID, i.e. sets the member variable.

Parameters:
[in] _id New unique role ID.
Return values:
void 

Definition at line 108 of file role.h.


Member Data Documentation

unsigned Role::basing_fsa [private]

The basing first straight ancestor (FSA) variable of this single role.

The basing first straight ancestor (FSA) variable of this single role, which is the fourth argument of the constructor.

Definition at line 195 of file role.h.

Referenced by getBasingFSA(), getSignOffExpression(), and printExtended().

unsigned Role::basing_var [private]

The basing variable of this single role.

The basing variable of this single role, which is the third argument of the constructor.

Definition at line 189 of file role.h.

Referenced by getBasingVar(), and printExtended().

The constructed concatenated path of this single role.

The constructed concatenated path of this single role, which has been done in the constructor.

Definition at line 214 of file role.h.

Referenced by getConcatenationPath(), getSignOffExpression(), Role(), and ~Role().

unsigned Role::id [private]

The unique role ID.

The unique role ID, which is the first argument of the constructor.

Definition at line 177 of file role.h.

Referenced by getId(), and print().

The relative path of this single role.

The relative path of this single role, which is the fifth argument of the constructor.

Definition at line 201 of file role.h.

Referenced by printExtended(), Role(), and ~Role().

ROLE_TYPE Role::type [private]

The type of this single role.

The type of this single role, which is the second argument of the constructor.

Definition at line 183 of file role.h.

Referenced by getType().

The path of the variable of this single role.

The path of the variable of this single role, which is the sixth argument of the constructor. This member variable may be NULL.

Definition at line 208 of file role.h.

Referenced by isDosRole(), isPosRole(), printExtended(), Role(), and ~Role().


Generated on Sun May 24 20:20:29 2009 for G(arbage) C(ollected) X(Query) Engine by  doxygen 1.5.9