w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
RtclClassBase.hpp
Go to the documentation of this file.
1// $Id: RtclClassBase.hpp 1186 2019-07-12 17:49:59Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2011-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4//
5// Revision History:
6// Date Rev Version Comment
7// 2018-12-16 1084 1.0.2 use =delete for noncopyable instead of boost
8// 2011-04-24 380 1.0.1 use boost::noncopyable (instead of private dcl's)
9// 2011-02-20 363 1.0 Initial version
10// 2011-02-11 360 0.1 First draft
11// ---------------------------------------------------------------------------
12
17#ifndef included_Retro_RtclClassBase
18#define included_Retro_RtclClassBase 1
19
20#include "tcl.h"
21
22namespace Retro {
23
25 public:
26
27 explicit RtclClassBase(const std::string& type = std::string());
28 virtual ~RtclClassBase();
29
30 RtclClassBase(const RtclClassBase&) = delete; // noncopyable
31 RtclClassBase& operator=(const RtclClassBase&) = delete; // noncopyable
32
33 const std::string& Type() const;
34 Tcl_Command Token() const;
35
36 // some constants (also defined in cpp)
37 static const int kOK = TCL_OK;
38 static const int kERR = TCL_ERROR;
39
40 protected:
41 void SetType(const std::string& type);
42
43 void CreateClassCmd(Tcl_Interp* interp, const char* name);
44
45 virtual int TclClassCmd(Tcl_Interp* interp, int objc,
46 Tcl_Obj* const objv[]);
47
48 virtual int ClassCmdList(Tcl_Interp* interp);
49 virtual int ClassCmdDelete(Tcl_Interp* interp, const char* name);
50 virtual int ClassCmdCreate(Tcl_Interp* interp, int objc,
51 Tcl_Obj* const objv[]) = 0;
52
53 static int ThunkTclClassCmd(ClientData cdata, Tcl_Interp* interp,
54 int objc, Tcl_Obj* const objv[]);
55
56 static void ThunkTclCmdDeleteProc(ClientData cdata);
57 static void ThunkTclExitProc(ClientData cdata);
58
59 protected:
60 std::string fType;
61 Tcl_Interp* fInterp;
62 Tcl_Command fCmdToken;
63 };
64
65} // end namespace Retro
66
67#include "RtclClassBase.ipp"
68
69#endif
void CreateClassCmd(Tcl_Interp *interp, const char *name)
FIXME_docs.
void SetType(const std::string &type)
FIXME_docs.
Tcl_Command fCmdToken
cmd token for class command
Tcl_Command Token() const
FIXME_docs.
static const int kOK
static void ThunkTclCmdDeleteProc(ClientData cdata)
FIXME_docs.
std::string fType
classed type name
virtual int ClassCmdCreate(Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])=0
virtual int TclClassCmd(Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
FIXME_docs.
virtual int ClassCmdDelete(Tcl_Interp *interp, const char *name)
FIXME_docs.
RtclClassBase(const RtclClassBase &)=delete
static void ThunkTclExitProc(ClientData cdata)
FIXME_docs.
static const int kERR
virtual int ClassCmdList(Tcl_Interp *interp)
FIXME_docs.
const std::string & Type() const
FIXME_docs.
Tcl_Interp * fInterp
tcl interpreter
static int ThunkTclClassCmd(ClientData cdata, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
FIXME_docs.
virtual ~RtclClassBase()
Destructor.
RtclClassBase & operator=(const RtclClassBase &)=delete
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47