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 STREAMMANAGER_H 00036 #define STREAMMANAGER_H 00037 00038 #include "inputstream.h" 00039 #include "outputstream.h" 00040 00042 using namespace std; 00043 00053 class StreamManager { 00054 00055 public: 00066 static void initInstance(InputStream * _query_istream, 00067 InputStream * _xml_istream, 00068 OutputStream * _debug_ostream, 00069 OutputStream * _eval_ostream); 00070 00077 static StreamManager *getInstance(); 00078 00082 virtual ~ StreamManager(); 00083 00089 void print(); 00090 00096 inline InputStream *getQueryInputStream() { 00097 return query_istream; 00098 } inline InputStream *getXMLInputStream() { 00104 return xml_istream; 00105 } 00106 00112 inline OutputStream *getDebugOutputStream() { 00113 return debug_ostream; 00114 } 00115 00121 inline OutputStream *getEvalOutputStream() { 00122 return eval_ostream; 00123 } 00124 00125 private: 00130 static StreamManager *instance; 00131 00139 StreamManager(InputStream * _query_istream, InputStream * _xml_istream, 00140 OutputStream * _debug_ostream, OutputStream * _eval_ostream); 00141 00146 InputStream *query_istream; 00147 00152 InputStream *xml_istream; 00153 00158 OutputStream *debug_ostream; 00159 00164 OutputStream *eval_ostream; 00165 }; 00166 00167 #endif // STREAMMANAGER_H