71 reinterpret_cast<ClientData
>(
this),
75 reinterpret_cast<ClientData
>(
this));
83 Tcl_Obj*
const objv[])
91 const char* name = Tcl_GetString(objv[1]);
92 if (objc == 3 && strcmp(Tcl_GetString(objv[2]),
"-delete")==0) {
99 Tcl_AppendResult(interp,
"-E: command name '", name,
100 "' exists already as RtclProxy of type '",
101 pprox->
Type().c_str(),
"'",
nullptr);
115 std::vector<RtclProxyBase*> list;
117 RtclOPtr rlist(Tcl_NewListObj(0,
nullptr));
119 for (
size_t i=0; i<list.size(); i++) {
120 const char* cmdname = Tcl_GetCommandName(interp, list[i]->
Token());
121 RtclOPtr rval(Tcl_NewStringObj(cmdname, -1));
122 if (Tcl_ListObjAppendElement(interp, rlist, rval) !=
kOK)
return kERR;
125 Tcl_SetObjResult(interp, rlist);
136 if (Tcl_GetCommandInfo(interp, name, &cinfo) == 0) {
137 Tcl_AppendResult(interp,
"-E: unknown command name '", name,
"'",
nullptr);
143 Tcl_AppendResult(interp,
"-E: command '", name,
"' is not a RtclProxy",
149 Tcl_AppendResult(interp,
"-E: command '", name,
150 "' is not a RtclProxy of type '",
151 Type().c_str(),
"'",
nullptr);
155 int irc = Tcl_DeleteCommand(interp, name);
156 if (irc !=
kOK) Tcl_AppendResult(interp,
"-E: failed to delete '", name,
165 int objc, Tcl_Obj*
const objv[])
168 Tcl_AppendResult(interp,
"-E: BUG! ThunkTclClassCmd called with cdata == 0",
176 }
catch (exception& e) {
178 Tcl_AppendResult(interp,
"-E: exception caught in ThunkTclClassCmd: '",
179 e.what(),
"'",
nullptr);
void CreateClassCmd(Tcl_Interp *interp, const char *name)
FIXME_docs.
RtclClassBase(const std::string &type=std::string())
Default constructor.
Tcl_Command fCmdToken
cmd token for class command
Tcl_Command Token() const
FIXME_docs.
static void ThunkTclCmdDeleteProc(ClientData cdata)
FIXME_docs.
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.
static void ThunkTclExitProc(ClientData cdata)
FIXME_docs.
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.
void UnRegisterClass(RtclClassBase *pobj)
FIXME_docs.
void ListProxy(std::vector< RtclProxyBase * > &list, const std::string &type)
FIXME_docs.
RtclProxyBase * FindProxy(const std::string &type, const std::string &name)
FIXME_docs.
bool CheckProxy(RtclProxyBase *pobj)
FIXME_docs.
static RtclContext & Find(Tcl_Interp *interp)
FIXME_docs.
void RegisterClass(RtclClassBase *pobj)
FIXME_docs.
Implemenation (inline) of RtclOPtr.
const std::string & Type() const
FIXME_docs.
void AppendResultNewLines(Tcl_Interp *interp)
Declaration of class ReventLoop.