OpenCores
URL https://opencores.org/ocsvn/w11/w11/trunk

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.7/] [tools/] [src/] [librtools/] [RlogFileCatalog.cpp] - Blame information for rev 33

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 29 wfjm
// $Id: RlogFileCatalog.cpp 631 2015-01-09 21:36:51Z mueller $
2 19 wfjm
//
3
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4
//
5
// This program is free software; you may redistribute and/or modify it under
6
// the terms of the GNU General Public License as published by the Free
7
// Software Foundation, either version 2, or at your option any later version.
8
//
9
// This program is distributed in the hope that it will be useful, but
10
// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
11
// or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12
// for complete details.
13
// 
14
// Revision History: 
15
// Date         Rev Version  Comment
16
// 2013-02-22   491   1.0    Initial version
17
// ---------------------------------------------------------------------------
18
 
19
/*!
20
  \file
21 29 wfjm
  \version $Id: RlogFileCatalog.cpp 631 2015-01-09 21:36:51Z mueller $
22 19 wfjm
  \brief   Implemenation of RlogFileCatalog.
23
*/
24
 
25
#include <iostream> 
26
 
27
#include "RlogFileCatalog.hpp"
28
 
29
using namespace std;
30
 
31
/*!
32
  \class Retro::RlogFileCatalog
33
  \brief FIXME_docs
34
*/
35
 
36
// all method definitions in namespace Retro
37
namespace Retro {
38
 
39
//------------------------------------------+-----------------------------------
40
//! FIXME_docs
41
 
42
RlogFileCatalog& RlogFileCatalog::Obj()
43
{
44 22 wfjm
  static RlogFileCatalog obj;               // lazy creation singleton
45 19 wfjm
  return obj;
46
}
47
 
48
//------------------------------------------+-----------------------------------
49
//! FIXME_docs
50
 
51
const boost::shared_ptr<RlogFile>&
52
  RlogFileCatalog::FindOrCreate(const std::string& name)
53
{
54
  map_cit_t it = fMap.find(name);
55
  if (it != fMap.end()) return it->second;
56
 
57
  boost::shared_ptr<RlogFile> sptr(new RlogFile());
58
  it = fMap.insert(fMap.begin(), map_val_t(name, sptr));
59
 
60
  return it->second;
61
}
62
 
63
//------------------------------------------+-----------------------------------
64
//! FIXME_docs
65
 
66
void RlogFileCatalog::Delete(const std::string& name)
67
{
68
  fMap.erase(name);
69
  return;
70
}
71
 
72
//------------------------------------------+-----------------------------------
73
//! Default constructor
74
 
75
RlogFileCatalog::RlogFileCatalog()
76
{
77 29 wfjm
  FindOrCreate("cout")->UseStream(&cout);
78
  FindOrCreate("cerr")->UseStream(&cerr);
79 19 wfjm
}
80
 
81
//------------------------------------------+-----------------------------------
82
//! Destructor
83
 
84
RlogFileCatalog::~RlogFileCatalog()
85
{}
86
 
87
} // end namespace Retro

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.