w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
RtclClassOwned.ipp
Go to the documentation of this file.
1// $Id: RtclClassOwned.ipp 1186 2019-07-12 17:49:59Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2011-2013 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4//
5// Revision History:
6// Date Rev Version Comment
7// 2013-01-13 474 1.0.1 ClassCmdCreate(): fix configuration failed logic
8// 2011-02-20 363 1.0 Initial version
9// 2011-02-11 360 0.1 First draft
10// ---------------------------------------------------------------------------
11
16#include <iostream>
17#include <string>
18
19#include "RtclProxyBase.hpp"
20#include "RtclArgs.hpp"
21
27// all method definitions in namespace Retro
28namespace Retro {
29
30//------------------------------------------+-----------------------------------
32
33template <class TP>
34inline RtclClassOwned<TP>::RtclClassOwned(const std::string& type)
35 : RtclClassBase(type)
36{}
37
38//------------------------------------------+-----------------------------------
40
41template <class TP>
43{}
44
45//------------------------------------------+-----------------------------------
47
48template <class TP>
49inline int RtclClassOwned<TP>::ClassCmdCreate(Tcl_Interp* interp, int objc,
50 Tcl_Obj* const objv[])
51{
52 RtclArgs args(interp, objc, objv, 1);
53 std::string name;
54 if (!args.GetArg("name", name)) return kERR;
55
56 // create new proxy object
57 TP* pobj = new TP(interp, name.c_str());
58 // execute configure, delete command in case configure failed
59 // Note: deleting the command will implicitely delete the object..
60 if (pobj->ClassCmdConfig(args) != kOK) {
61 ClassCmdDelete(interp, name.c_str());
62 return kERR;
63 }
64 return kOK;
65}
66
67//------------------------------------------+-----------------------------------
69
70template <class TP>
71inline void RtclClassOwned<TP>::CreateClass(Tcl_Interp* interp,
72 const char* name,
73 const std::string& type)
74{
76 p->CreateClassCmd(interp, name);
77 return;
78}
79
80} // end namespace Retro
FIXME_docs.
Definition: RtclArgs.hpp:41
bool GetArg(const char *name, Tcl_Obj *&pval)
FIXME_docs.
Definition: RtclArgs.cpp:114
void CreateClassCmd(Tcl_Interp *interp, const char *name)
FIXME_docs.
Implemenation (inline) of class RtclClassOwned.
RtclClassOwned(const std::string &type=std::string())
Default constructor.
int ClassCmdCreate(Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
FIXME_docs.
static void CreateClass(Tcl_Interp *interp, const char *name, const std::string &type)
FIXME_docs.
~RtclClassOwned()
Destructor.
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47
static const int kERR
Definition: RtclBvi.cpp:38
static const int kOK
Definition: RtclBvi.cpp:37