Stxxl  1.4.0
include/stxxl/bits/common/log.h
Go to the documentation of this file.
00001 /***************************************************************************
00002  *  include/stxxl/bits/common/log.h
00003  *
00004  *  Part of the STXXL. See http://stxxl.sourceforge.net
00005  *
00006  *  Copyright (C) 2004-2005 Roman Dementiev <dementiev@ira.uka.de>
00007  *  Copyright (C) 2009 Andreas Beckmann <beckmann@cs.uni-frankfurt.de>
00008  *
00009  *  Distributed under the Boost Software License, Version 1.0.
00010  *  (See accompanying file LICENSE_1_0.txt or copy at
00011  *  http://www.boost.org/LICENSE_1_0.txt)
00012  **************************************************************************/
00013 
00014 #ifndef STXXL_LOG_HEADER
00015 #define STXXL_LOG_HEADER
00016 
00017 #include <iostream>
00018 #include <fstream>
00019 
00020 #include <stxxl/bits/namespace.h>
00021 #include <stxxl/bits/singleton.h>
00022 
00023 
00024 __STXXL_BEGIN_NAMESPACE
00025 
00026 class logger : public singleton<logger>
00027 {
00028     friend class singleton<logger>;
00029 
00030     std::ofstream log_stream_;
00031     std::ofstream errlog_stream_;
00032     std::ofstream * waitlog_stream_;
00033 
00034     logger();
00035     ~logger();
00036 
00037 public:
00038     inline std::ofstream & log_stream()
00039     {
00040         return log_stream_;
00041     }
00042 
00043     inline std::ofstream & errlog_stream()
00044     {
00045         return errlog_stream_;
00046     }
00047 
00048     inline std::ofstream * waitlog_stream()
00049     {
00050         return waitlog_stream_;
00051     }
00052 };
00053 
00054 __STXXL_END_NAMESPACE
00055 
00056 #endif // !STXXL_LOG_HEADER
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines