00001 00002 /* 00003 | Author: Michael Schmidt; 00004 | Gunnar Jehl 00005 | 00006 | ************************* SOFTWARE LICENSE AGREEMENT *********************** 00007 | This source code is published under the BSD License. 00008 | 00009 | See file 'LICENSE.txt' that comes with this distribution or 00010 | http://dbis.informatik.uni-freiburg.de/index.php?project=GCX/license.php 00011 | for the full license agreement. 00012 | 00013 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00014 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00015 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00016 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00017 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00018 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00019 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00020 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00021 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00022 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00023 | POSSIBILITY OF SUCH DAMAGE. 00024 | **************************************************************************** 00025 */ 00026 00035 #ifndef ROLELIST_H 00036 #define ROLELIST_H 00037 00038 #include <vector> 00039 #include "role.h" 00040 00041 // forward declarations 00042 class PathEnvironment; 00043 00055 class RoleList { 00056 00057 public: 00065 static void initInstance(PathEnvironment * _penv); 00066 00073 static RoleList *getInstance(); 00074 00078 virtual ~ RoleList(); 00079 00085 inline vector < Role * >*getRoles() { 00086 return &roles; 00087 } Role *getFreshRole(unsigned basing_var, ROLE_TYPE type, 00096 PathExpression * from_var); 00097 00103 unsigned getMaxRoleId(); 00104 00111 bool removeRole(Role * role); 00112 00118 void sortRolesForSignOffs(); 00119 00120 private: 00126 void computeMaxRoleId(); 00127 00132 static RoleList *instance; 00133 00138 RoleList(PathEnvironment * _penv); 00139 00144 vector < Role * >roles; 00145 00150 PathEnvironment *penv; 00151 00156 unsigned max_role_id; 00157 00163 bool max_role_id_computed; 00164 }; 00165 00166 #endif // ROLELIST_H