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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.6/] [tools/] [src/] [librwxxtpp/] [RtclRw11CntlFactory.cpp] - Blame information for rev 36

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 21 wfjm
// $Id: RtclRw11CntlFactory.cpp 515 2013-05-04 17:28:59Z 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 21 wfjm
// 2013-05-01   513   1.0.1  add LP11
17 19 wfjm
// 2013-03-06   495   1.0    Initial version
18
// 2013-02-09   489   0.1    First draft
19
// ---------------------------------------------------------------------------
20
 
21
/*!
22
  \file
23 21 wfjm
  \version $Id: RtclRw11CntlFactory.cpp 515 2013-05-04 17:28:59Z mueller $
24 19 wfjm
  \brief   Implemenation of global function RtclRw11CntlFactory.
25
*/
26
 
27
#include "tcl.h"
28
 
29
#include "RtclRw11CntlFactory.hpp"
30
 
31
#include "RtclRw11CntlDL11.hpp"
32 20 wfjm
#include "RtclRw11CntlRK11.hpp"
33 21 wfjm
#include "RtclRw11CntlLP11.hpp"
34
#include "RtclRw11CntlPC11.hpp"
35 19 wfjm
 
36
using namespace std;
37
 
38
// all method definitions in namespace Retro (avoid using in includes...)
39
namespace Retro {
40
 
41
//------------------------------------------+-----------------------------------
42
//! FIXME_docs
43
 
44
int RtclRw11CntlFactory(RtclArgs& args, RtclRw11Cpu& cpu)
45
{
46
  string type;
47
  if (!args.GetArg("type", type)) return TCL_ERROR;
48
 
49
  // 'factory section', create concrete Rw11Cntl objects
50
  if        (type == "dl11") {              // dl11 --------------------------
51
    unique_ptr<RtclRw11CntlDL11> pobj(new RtclRw11CntlDL11());
52
    if(pobj->FactoryCmdConfig(args, cpu) != TCL_OK) return TCL_ERROR;
53
    pobj.release();
54
 
55 20 wfjm
  } else if (type == "rk11") {              // rk11 --------------------------
56
    unique_ptr<RtclRw11CntlRK11> pobj(new RtclRw11CntlRK11());
57
    if(pobj->FactoryCmdConfig(args, cpu) != TCL_OK) return TCL_ERROR;
58
    pobj.release();
59 19 wfjm
 
60 21 wfjm
  } else if (type == "lp11") {              // lp11 --------------------------
61
    unique_ptr<RtclRw11CntlLP11> pobj(new RtclRw11CntlLP11());
62
    if(pobj->FactoryCmdConfig(args, cpu) != TCL_OK) return TCL_ERROR;
63
    pobj.release();
64
 
65
  } else if (type == "pc11") {              // pc11 --------------------------
66
    unique_ptr<RtclRw11CntlPC11> pobj(new RtclRw11CntlPC11());
67
    if(pobj->FactoryCmdConfig(args, cpu) != TCL_OK) return TCL_ERROR;
68
    pobj.release();
69
 
70 19 wfjm
  } else {                                  // unknown cntl type -------------
71
    return args.Quit(string("-E: unknown controller type '") + type + "'");
72
  }
73
 
74
  return TCL_OK;
75
}
76
 
77
} // end namespace Retro

powered by: WebSVN 2.1.0

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