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

Subversion Repositories w11

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

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

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

powered by: WebSVN 2.1.0

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