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

Subversion Repositories w11

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 19 wfjm
// $Id: RtclProxyBase.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 19 wfjm
// 2013-02-09   485   1.4.2  add CommandName()
17
// 2013-02-05   483   1.4.1  ClassCmdConfig: use RtclArgs
18
// 2013-02-02   480   1.4    factor out RtclCmdBase base class
19
// 2013-02-01   479   1.3    add DispatchCmd(), support $unknown method
20 12 wfjm
// 2011-07-31   401   1.2    add ctor(type,interp,name) for direct usage
21
// 2011-04-23   380   1.1    use boost/function instead of RmethDsc
22
//                           use boost::noncopyable (instead of private dcl's)
23 10 wfjm
// 2011-02-20   363   1.0    Initial version
24
// 2011-02-11   360   0.1    First draft
25
// ---------------------------------------------------------------------------
26
 
27
/*!
28
  \file
29 19 wfjm
  \version $Id: RtclProxyBase.hpp 486 2013-02-10 22:34:43Z mueller $
30 10 wfjm
  \brief   Declaration of class RtclProxyBase.
31
*/
32
 
33
#ifndef included_Retro_RtclProxyBase
34
#define included_Retro_RtclProxyBase 1
35
 
36
#include "tcl.h"
37
 
38
#include <string>
39
#include <map>
40
 
41 19 wfjm
#include "RtclCmdBase.hpp"
42 12 wfjm
 
43 10 wfjm
#include "RtclArgs.hpp"
44
 
45
namespace Retro {
46
 
47 19 wfjm
  class RtclProxyBase : public RtclCmdBase {
48 10 wfjm
    public:
49
 
50
      explicit      RtclProxyBase(const std::string& type = std::string());
51 12 wfjm
                    RtclProxyBase(const std::string& type, Tcl_Interp* interp,
52
                                  const char* name);
53 19 wfjm
      virtual      ~RtclProxyBase();
54 10 wfjm
 
55 19 wfjm
      virtual int   ClassCmdConfig(RtclArgs& args);
56 10 wfjm
 
57
      const std::string& Type() const;
58
      Tcl_Command        Token() const;
59 19 wfjm
      std::string   CommandName() const;
60 10 wfjm
 
61
    protected:
62
      void          SetType(const std::string& type);
63
 
64
      void          CreateObjectCmd(Tcl_Interp* interp, const char* name);
65
 
66
      int           TclObjectCmd(Tcl_Interp* interp, int objc,
67
                                 Tcl_Obj* const objv[]);
68
 
69
      static int    ThunkTclObjectCmd(ClientData cdata, Tcl_Interp* interp,
70
                                      int objc, Tcl_Obj* const objv[]);
71
      static void   ThunkTclCmdDeleteProc(ClientData cdata);
72
      static void   ThunkTclExitProc(ClientData cdata);
73
 
74
    protected:
75
      std::string   fType;                  //!< proxied type name
76
      Tcl_Interp*   fInterp;                //!< tcl interpreter
77
      Tcl_Command   fCmdToken;              //!< cmd token for object command
78
  };
79
 
80
} // end namespace Retro
81
 
82
#include "RtclProxyBase.ipp"
83
 
84
#endif

powered by: WebSVN 2.1.0

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