DataTable.cpp

Go to the documentation of this file.
00001 ///
00002 /// \file   DataTable.cpp
00003 /// \brief  Implementation of stream output for errors from DataTable class
00004 /// \author Kent Holsinger
00005 /// \date   2005-05-18
00006 ///
00007 
00008 // This file is part of MCMC++, a library for constructing C++ programs
00009 // that implement MCMC analyses of Bayesian statistical models.
00010 // Copyright (c) 2004-2006 Kent E. Holsinger
00011 //
00012 // MCMC++ is free software; you can redistribute it and/or modify
00013 // it under the terms of the GNU General Public License as published by
00014 // the Free Software Foundation; either version 2 of the License, or
00015 // (at your option) any later version.
00016 //
00017 // MCMC++ is distributed in the hope that it will be useful,
00018 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00019 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020 // GNU General Public License for more details.
00021 //
00022 // You should have received a copy of the GNU General Public License
00023 // along with MCMC++; if not, write to the Free Software
00024 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025 //
00026 
00027 // local includes
00028 #include "mcmc++/DataTable.h"
00029 
00030 /// Stream output for DataTable errors
00031 ///
00032 /// \param out     The stream for output
00033 /// \param result  The error identifier
00034 ///
00035 std::ostream& operator<< (std::ostream& out, 
00036                           enum DataTableResult result) 
00037 {
00038   std::string s;
00039   switch (result) {
00040     case readSuccess:
00041       s = "Success";
00042       break;
00043     case labelError:
00044       s = "Label error";
00045       break;
00046     case valueError:
00047       s = "Value error";
00048       break;
00049     case openError:
00050       s = "Open error";
00051       break;
00052     case grammarError:
00053       s = "Parsing error\n";
00054       break;
00055     default:
00056       s = "Unrecognized internal error";
00057       break;
00058   }
00059   return out << s;
00060 }
00061 
00062 

Generated on Tue Mar 27 16:03:38 2007 for mcmc by  doxygen 1.5.1