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 BUFFER_H 00036 #define BUFFER_H 00037 00038 #include "buffernode.h" 00039 #include "projectiondfa.h" 00040 00051 class Buffer { 00052 00053 public: 00058 Buffer(ProjectionDFA * _pdfa); 00059 00063 virtual ~ Buffer(); 00064 00071 void appendTag(TAG tag); 00072 00081 void appendTag(TAG tag, vector < unsigned >*_cumulative_roles, 00082 vector < unsigned >*_non_cumulative_roles); 00083 00090 void appendPCData(const char *data); 00091 00100 void appendPCData(const char *data, vector < unsigned >*_cumulative_roles, 00101 vector < unsigned >*_non_cumulative_roles); 00102 00109 void appendRoles(vector < unsigned >*_cumulative_roles, 00110 vector < unsigned >*_non_cumulative_roles); 00111 00118 void print(OutputStream & dos); 00119 00127 void printCurrent(OutputStream & dos); 00128 00136 void debugPrint(OutputStream & dos); 00137 00143 inline BufferNode *getRoot() { 00144 return root; 00145 } inline BufferNode *getCurrent() { 00152 return cur; 00153 } 00154 00160 void closeTag(); 00161 00162 private: 00167 BufferNode * root; 00168 00174 BufferNode *cur; 00175 }; 00176 00177 #endif // BUFFER_H