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

Subversion Repositories w11

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

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

Line No. Rev Author Line
1 20 wfjm
// $Id: RtclCmdBase.hpp 511 2013-04-27 13:51:46Z mueller $
2 10 wfjm
//
3 19 wfjm
// Copyright 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 20 wfjm
// 2013-04-26   511   1.0.1  AddMeth() now public
17 19 wfjm
// 2013-02-02   480   1.0    Initial version (refactored out from ProxyBase)
18 10 wfjm
// ---------------------------------------------------------------------------
19
 
20
/*!
21
  \file
22 20 wfjm
  \version $Id: RtclCmdBase.hpp 511 2013-04-27 13:51:46Z mueller $
23 19 wfjm
  \brief   Declaration of class RtclCmdBase.
24 10 wfjm
*/
25
 
26 19 wfjm
#ifndef included_Retro_RtclCmdBase
27
#define included_Retro_RtclCmdBase 1
28 10 wfjm
 
29
#include "tcl.h"
30
 
31
#include <string>
32
#include <map>
33
 
34 12 wfjm
#include "boost/utility.hpp"
35
#include "boost/function.hpp"
36
 
37 10 wfjm
#include "RtclArgs.hpp"
38
 
39
namespace Retro {
40
 
41 19 wfjm
  class RtclCmdBase : private boost::noncopyable {
42 10 wfjm
    public:
43 12 wfjm
      typedef boost::function<int(RtclArgs&)> methfo_t;
44
 
45
      typedef std::map<std::string, methfo_t> mmap_t;
46 10 wfjm
      typedef mmap_t::iterator         mmap_it_t;
47
      typedef mmap_t::const_iterator   mmap_cit_t;
48
      typedef mmap_t::value_type       mmap_val_t;
49
 
50 19 wfjm
                    RtclCmdBase();
51
      virtual      ~RtclCmdBase();
52 10 wfjm
 
53 19 wfjm
      int           DispatchCmd(RtclArgs& args);
54 20 wfjm
      void          AddMeth(const std::string& name, const methfo_t& methfo);
55 10 wfjm
 
56 19 wfjm
    // some constants (also defined in cpp)
57
      static const int kOK  = TCL_OK;       //<!
58
      static const int kERR = TCL_ERROR;    //<!
59 10 wfjm
 
60
    protected:
61
 
62
    protected:
63
      mmap_t        fMapMeth;               //!< map for named methods
64
  };
65
 
66
} // end namespace Retro
67
 
68 19 wfjm
//#include "RtclCmdBase.ipp"
69 10 wfjm
 
70
#endif

powered by: WebSVN 2.1.0

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