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 10

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

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

powered by: WebSVN 2.1.0

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