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 ROLE_H 00036 #define ROLE_H 00037 00038 #include "typeenums.h" 00039 00040 // forward declarations 00041 class PathExpression; 00042 class SignOffExpression; 00043 class OutputStream; 00044 00046 using namespace std; 00047 00057 class Role { 00058 00059 public: 00070 Role(unsigned _id, ROLE_TYPE _type, unsigned _basing_var, 00071 unsigned _basing_fsa, PathExpression * _rel_path, 00072 PathExpression * _var_path); 00073 00077 virtual ~ Role(); 00078 00085 void print(OutputStream & dos) const; 00086 00093 virtual void printExtended(OutputStream & dos); 00094 00100 inline unsigned getId() { 00101 return id; 00102 } inline void setId(unsigned _id) { 00109 id = _id; 00110 } 00111 00117 inline ROLE_TYPE getType() { 00118 return type; 00119 } 00120 00126 inline unsigned getBasingVar() { 00127 return basing_var; 00128 } 00129 00135 inline unsigned getBasingFSA() { 00136 return basing_fsa; 00137 } 00138 00145 inline PathExpression *getConcatenationPath() { 00146 return concat_path; 00147 } 00148 00154 SignOffExpression *getSignOffExpression(); 00155 00162 bool isPosRole(); 00163 00170 bool isDosRole(); 00171 00172 private: 00177 unsigned id; 00178 00183 ROLE_TYPE type; 00184 00189 unsigned basing_var; 00190 00195 unsigned basing_fsa; 00196 00201 PathExpression *rel_path; 00202 00208 PathExpression *var_path; 00209 00214 PathExpression *concat_path; 00215 }; 00216 00217 #endif // ROLE_H