Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

l1394_message.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002                           l1394_message.cpp  -  description
00003                              -------------------
00004     begin                : Wed Mar 7 2001
00005     copyright            : (C) 2001-2004 by Michael Repplinger
00006     email                : repplix@studcs.uni-sb.de
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #include "l1394_message.h"
00019 
00020 #include <iostream>
00021 
00022 using namespace std;
00023 
00024 namespace L1394{
00025 namespace internal{
00026 
00027 Message::Message()
00028 {
00029   default_stream  = new ofstream();
00030   default_stream->open("/dev/null", ios::out);
00031   error_stream     = &cout;
00032   debug_stream     = default_stream;
00033   warning_stream   = &cout;
00034   message_stream  = default_stream;
00035 }
00036 
00037 Message::~Message()
00038 {
00039   default_stream->close();
00040   delete default_stream;
00041 }
00042 
00043 
00044 void Message::setErrorStream(ostream* o)
00045 {
00046   if (o == NULL)
00047   {
00048     error_stream = default_stream;
00049     return;
00050   }
00051   error_stream = o;
00052 }
00053 
00054 void Message::setDebugStream(ostream* o)
00055 {
00056   if (o == NULL)
00057   {
00058     debug_stream = default_stream;
00059     return;
00060   }
00061   debug_stream = o;
00062 }
00063 
00064 void Message::setWarningStream(ostream* o)
00065 {
00066   if (o == NULL)
00067   {
00068     warning_stream = default_stream;
00069     return;
00070   }
00071   warning_stream = o;
00072 }
00073 
00074 void Message::setMessageStream(ostream* o)
00075 {
00076   if (o == NULL)
00077   {
00078     message_stream = default_stream;
00079     return;
00080   }
00081   message_stream = o;
00082 }
00083 ostream& Message::errorStream()  const
00084 {
00085   return (*error_stream <<   "L1394 ERROR_MESSAGE   : " );
00086 }
00087 ostream& Message::warningStream()  const
00088 {
00089   return (*warning_stream << "L1394 WARNING_MESSAGE : " );
00090 }
00091 ostream& Message::messageStream() const
00092 {
00093   return (*message_stream << "L1394 MESSAGE         : " );
00094 }
00095 ostream& Message::debugStream() const
00096 {
00097   return (*debug_stream <<   "L1394 DEBUG_MESSAGE   : " );
00098 }
00099 
00100 
00101 ostream& Message::errorStream(const Node* ) const
00102 {
00103   return (*error_stream <<   "L1394 ERROR_MESSAGE   : " );
00104 }
00105 ostream& Message::warningStream(const Node* ) const
00106 {
00107   return (*warning_stream << "L1394 WARNING_MESSAGE : " );
00108 }
00109 ostream& Message::messageStream(const Node* ) const
00110 {
00111   return (*message_stream << "L1394 MESSAGE         : " );
00112 }
00113 ostream& Message::debugStream(const Node* ) const
00114 {
00115   return (*debug_stream <<   "L1394 DEBUG_MESSAGE   : " );
00116 }
00117 }
00118 }

Generated on Wed Aug 24 00:36:40 2005 for L1394 by doxygen 1.4.2
L1394 library (NMM) grahics.cs.uni-sb.de/~repplix/l1394_home/