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

Subversion Repositories w11

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 19 wfjm
// $Id: RtclContext.hpp 490 2013-02-22 18:43:26Z 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-01-12   474   1.0.3  add FindProxy() method
17 12 wfjm
// 2011-04-24   380   1.0.2  use boost::noncopyable (instead of private dcl's)
18 10 wfjm
// 2011-03-12   368   1.0.1  drop fExitSeen, get exit handling right
19
// 2011-02-18   362   1.0    Initial version
20
// 2011-02-18   362   0.1    First draft
21
// ---------------------------------------------------------------------------
22
 
23
/*!
24
  \file
25 19 wfjm
  \version $Id: RtclContext.hpp 490 2013-02-22 18:43:26Z mueller $
26 10 wfjm
  \brief   Declaration of class RtclContext.
27
*/
28
 
29
#ifndef included_Retro_RtclContext
30
#define included_Retro_RtclContext 1
31
 
32
#include "tcl.h"
33
 
34
#include <string>
35
#include <set>
36
#include <map>
37
 
38 12 wfjm
#include "boost/utility.hpp"
39
 
40 10 wfjm
#include "RtclClassBase.hpp"
41
#include "RtclProxyBase.hpp"
42
 
43
namespace Retro {
44
 
45 12 wfjm
  class RtclContext : private boost::noncopyable {
46 10 wfjm
    public:
47
      typedef std::set<RtclClassBase*> cset_t;
48
      typedef cset_t::iterator         cset_it_t;
49
      typedef std::set<RtclProxyBase*> pset_t;
50
      typedef pset_t::iterator         pset_it_t;
51
      typedef std::map<Tcl_Interp*, RtclContext*>  xmap_t;
52
      typedef xmap_t::iterator                     xmap_it_t;
53
      typedef xmap_t::value_type                   xmap_val_t;
54
 
55
      explicit      RtclContext(Tcl_Interp* interp);
56 19 wfjm
      virtual      ~RtclContext();
57 10 wfjm
 
58
      void          RegisterClass(RtclClassBase* pobj);
59
      void          UnRegisterClass(RtclClassBase* pobj);
60
 
61
      void          RegisterProxy(RtclProxyBase* pobj);
62
      void          UnRegisterProxy(RtclProxyBase* pobj);
63
      bool          CheckProxy(RtclProxyBase* pobj);
64
      bool          CheckProxy(RtclProxyBase* pobj, const std::string& type);
65
 
66
      void          ListProxy(std::vector<RtclProxyBase*>& list,
67
                              const std::string& type);
68 19 wfjm
      RtclProxyBase* FindProxy(const std::string& type,
69
                               const std::string& name);
70 10 wfjm
 
71
      static RtclContext&  Find(Tcl_Interp* interp);
72
 
73
      static void   ThunkTclExitProc(ClientData cdata);
74
 
75
    protected:
76
 
77
      Tcl_Interp*   fInterp;                //!< associated tcl interpreter
78
      cset_t        fSetClass;              //!< set for Class objects
79
      pset_t        fSetProxy;              //!< set for Proxy objects
80
 
81
      static xmap_t fMapContext;            //!< map of contexts
82
  };
83
 
84
} // end namespace Retro
85
 
86 19 wfjm
//#include "RtclContext.ipp"
87 10 wfjm
 
88
#endif

powered by: WebSVN 2.1.0

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