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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.6/] [tools/] [src/] [librtcltools/] [RtclClassBase.hpp] - Blame information for rev 19

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

Line No. Rev Author Line
1 19 wfjm
// $Id: RtclClassBase.hpp 486 2013-02-10 22:34:43Z mueller $
2 10 wfjm
//
3 19 wfjm
// Copyright 2011-2013 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4 10 wfjm
//
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 12 wfjm
// 2011-04-24   380   1.0.1  use boost::noncopyable (instead of private dcl's)
17 10 wfjm
// 2011-02-20   363   1.0    Initial version
18
// 2011-02-11   360   0.1    First draft
19
// ---------------------------------------------------------------------------
20
 
21
/*!
22
  \file
23 19 wfjm
  \version $Id: RtclClassBase.hpp 486 2013-02-10 22:34:43Z mueller $
24 10 wfjm
  \brief   Declaration of class RtclClassBase.
25
*/
26
 
27
#ifndef included_Retro_RtclClassBase
28
#define included_Retro_RtclClassBase 1
29
 
30 12 wfjm
#include "boost/utility.hpp"
31
 
32 10 wfjm
#include "tcl.h"
33
 
34
namespace Retro {
35
 
36 12 wfjm
  class RtclClassBase : private boost::noncopyable {
37 10 wfjm
    public:
38
 
39
      explicit      RtclClassBase(const std::string& type = std::string());
40
      virtual       ~RtclClassBase();
41
 
42
      const std::string& Type() const;
43
      Tcl_Command        Token() const;
44
 
45 19 wfjm
    // some constants (also defined in cpp)
46
      static const int kOK  = TCL_OK;       //<!
47
      static const int kERR = TCL_ERROR;    //<!
48
 
49 10 wfjm
    protected:
50
      void          SetType(const std::string& type);
51
 
52
      void          CreateClassCmd(Tcl_Interp* interp, const char* name);
53
 
54
      virtual int   TclClassCmd(Tcl_Interp* interp, int objc,
55
                                Tcl_Obj* const objv[]);
56
 
57
      virtual int   ClassCmdList(Tcl_Interp* interp);
58
      virtual int   ClassCmdDelete(Tcl_Interp* interp, const char* name);
59
      virtual int   ClassCmdCreate(Tcl_Interp* interp, int objc,
60
                                   Tcl_Obj* const objv[]) = 0;
61
 
62
      static int    ThunkTclClassCmd(ClientData cdata, Tcl_Interp* interp,
63
                                     int objc, Tcl_Obj* const objv[]);
64
 
65
      static void   ThunkTclCmdDeleteProc(ClientData cdata);
66
      static void   ThunkTclExitProc(ClientData cdata);
67
 
68
    protected:
69
      std::string   fType;                  //!< classed type name
70
      Tcl_Interp*   fInterp;                //!< tcl interpreter
71
      Tcl_Command   fCmdToken;              //!< cmd token for class command
72
  };
73
 
74
} // end namespace Retro
75
 
76
#include "RtclClassBase.ipp"
77
 
78
#endif

powered by: WebSVN 2.1.0

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