RoleList Class Reference

Represents a list of all used roles. More...

#include <rolelist.h>

Collaboration diagram for RoleList:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual ~RoleList ()
vector< Role * > * getRoles ()
 Returns all used roles.
RolegetFreshRole (unsigned basing_var, ROLE_TYPE type, PathExpression *from_var)
 Returns a fresh unused role for use.
unsigned getMaxRoleId ()
 Returns the maximum id of all used roles.
bool removeRole (Role *role)
 Removes a single role.
void sortRolesForSignOffs ()
 Sorts roles, which belong together, for better/faster SignOffExpression execution.

Static Public Member Functions

static void initInstance (PathEnvironment *_penv)
 Initializes instance of RoleList.
static RoleListgetInstance ()
 Returns instance of RoleList.

Private Member Functions

void computeMaxRoleId ()
 Computes the maximum id of all used roles (max_role_id).
 RoleList (PathEnvironment *_penv)
 Constructor.

Private Attributes

vector< Role * > roles
 All used roles.
PathEnvironmentpenv
 The entered PathEnvironment.
unsigned max_role_id
bool max_role_id_computed
 Indicates if the maximum id of all used roles has been computed.

Static Private Attributes

static RoleListinstance = NULL
 Instance of RoleList.


Detailed Description

Represents a list of all used roles.

Represents a list of all used roles, i.e. of all used Role, e.g. ri or rj (whereas i != j), which takes a PathEnvironment as arguments.

Note:
SINGLETON PATTERN!
Author:
Michael Schmidt

Gunnar Jehl

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

Definition at line 55 of file rolelist.h.


Constructor & Destructor Documentation

RoleList::~RoleList (  )  [virtual]

Destructor.

Definition at line 52 of file rolelist.cpp.

References roles.

RoleList::RoleList ( PathEnvironment _penv  )  [private]

Constructor.

Constructor - creating object for a PathEnvironment.

Parameters:
[in] _penv Pointer to a PathEnvironment object.

Definition at line 48 of file rolelist.cpp.

Referenced by initInstance().


Member Function Documentation

void RoleList::computeMaxRoleId (  )  [private]

Computes the maximum id of all used roles (max_role_id).

Computes the maximum id of all used roles (max_role_id).

Return values:
void 

Definition at line 145 of file rolelist.cpp.

References max_role_id, max_role_id_computed, and roles.

Referenced by getMaxRoleId().

Role * RoleList::getFreshRole ( unsigned  basing_var,
ROLE_TYPE  type,
PathExpression from_var 
)

Returns a fresh unused role for use.

Returns a fresh unused role for use.

Parameters:
[in] basing_var The underlying (numeric value of a) variable for the PathExpression, which is the third argument of this method.
[in] type ROLE_TYPE.
[in] from_var Pointer to a PathExpression object.
Return values:
Role* Pointer to a Role object.

Definition at line 58 of file rolelist.cpp.

References getInstance(), PathEnvironment::getPathBetween(), penv, and roles.

Referenced by ProjectionTree::createProjectionTree().

static RoleList * RoleList::getInstance (  )  [static]

Returns instance of RoleList.

Returns instance of RoleList, i.e. of this object.

Note:
DO NOT CALL THIS METHOD BEFORE METHOD initInstance(PathEnvironment* _penv) WAS CALLED!
Return values:
RoleList* Pointer to a RoleList object.

Definition at line 44 of file rolelist.cpp.

References instance.

Referenced by Executor::buildSignOffQuery(), ProjectionTree::createProjectionTree(), getFreshRole(), IntMultiSet::IntMultiSet(), ProjectionTreeNode::removeSubtreeExclSelf(), ProjectionTreeNode::removeSubtreeInclSelf(), ProjectionTreeNode::setRedundantRoleSelf(), and Executor::~Executor().

unsigned RoleList::getMaxRoleId (  ) 

Returns the maximum id of all used roles.

Returns the maximum id of all used roles.

Return values:
unsigned Maximum id of all used roles.

Definition at line 72 of file rolelist.cpp.

References computeMaxRoleId(), max_role_id, and max_role_id_computed.

Referenced by IntMultiSet::IntMultiSet().

vector< Role * > * RoleList::getRoles (  )  [inline]

Returns all used roles.

Returns all used roles, i.e. returns the member variable.

Return values:
vector<Role*>* Pointer to a vector object containing pointer of Role objects.

Definition at line 85 of file rolelist.h.

References roles.

Referenced by Executor::buildSignOffQuery().

static void RoleList::initInstance ( PathEnvironment _penv  )  [static]

Initializes instance of RoleList.

Initializes instance of RoleList, i.e. initializes this object.

Note:
CALL THIS METHOD BEFORE METHOD getInstance()!
Parameters:
[in] _penv Pointer to a PathEnvironment object.
Return values:
void 

Definition at line 40 of file rolelist.cpp.

References instance, and RoleList().

Referenced by Executor::collectQueryInformation().

bool RoleList::removeRole ( Role role  ) 

Removes a single role.

Removes a single role in this list, i.e. removes a single role in this object.

Parameters:
[in] role Pointer to a Role object (role which should be removed).
Return values:
bool true if Role was successfully removed, false otherwise.

Definition at line 80 of file rolelist.cpp.

References roles.

Referenced by ProjectionTreeNode::removeSubtreeExclSelf(), and ProjectionTreeNode::removeSubtreeInclSelf().

void RoleList::sortRolesForSignOffs (  ) 

Sorts roles, which belong together, for better/faster SignOffExpression execution.

Sorts roles, which belong together, for better/faster SignOffExpression execution.

Return values:
void 

Definition at line 95 of file rolelist.cpp.

References roles.

Referenced by Executor::buildSignOffQuery().


Member Data Documentation

static RoleList * RoleList::instance = NULL [static, private]

Instance of RoleList.

Instance of RoleList to avoid duplicate existence of this object.

Definition at line 132 of file rolelist.h.

Referenced by getInstance(), and initInstance().

unsigned RoleList::max_role_id [private]

The maximum id of all used roles.

Definition at line 156 of file rolelist.h.

Referenced by computeMaxRoleId(), and getMaxRoleId().

Indicates if the maximum id of all used roles has been computed.

Indicates if the maximum id of all used roles has been computed, i.e. true if it has been computed, false otherwise.

Definition at line 163 of file rolelist.h.

Referenced by computeMaxRoleId(), and getMaxRoleId().

The entered PathEnvironment.

The entered PathEnvironment, which is the argument of the constructor.

Definition at line 150 of file rolelist.h.

Referenced by getFreshRole().

vector< Role * > RoleList::roles [private]

All used roles.

All used roles, i.e. all used Role.

Definition at line 144 of file rolelist.h.

Referenced by computeMaxRoleId(), getFreshRole(), getRoles(), removeRole(), sortRolesForSignOffs(), and ~RoleList().


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