54 auto ret =
fMap.emplace(make_pair(name, move(upset)));
55 if (ret.second ==
false)
57 string(
"Bad args: duplicate name: '") + name +
"'");
75 Tcl_Interp* interp = args.
Interp();
77 if (!args.
GetArg(
"pname", pname))
return TCL_ERROR;
80 if (!args.
AllDone())
return TCL_ERROR;
81 RtclOPtr rlist(Tcl_NewListObj(0,
nullptr));
82 for (
const auto& kv :
fMap) {
83 RtclOPtr pele(Tcl_NewStringObj(kv.first.c_str(), -1));
84 Tcl_ListObjAppendElement(
nullptr, rlist, pele);
86 Tcl_SetObjResult(interp, rlist);
90 auto it =
fMap.lower_bound(pname);
93 if (it ==
fMap.end() || pname != it->first.substr(0,pname.length())) {
94 Tcl_AppendResult(interp,
"-E: unknown property '", pname.c_str(),
95 "': must be ",
nullptr);
96 const char* delim =
"";
98 Tcl_AppendResult(interp, delim, o.first.c_str(),
nullptr);
107 if (it1!=
fMap.end() && pname==it1->first.substr(0,pname.length())) {
108 Tcl_AppendResult(interp,
"-E: ambiguous property name '", pname.c_str(),
109 "': must be ",
nullptr);
110 const char* delim =
"";
111 for (it1=it; it1!=
fMap.end() &&
112 pname==it1->first.substr(0,pname.length()); it1++) {
113 Tcl_AppendResult(interp, delim, it1->first.c_str(),
nullptr);
121 if (!args.
GetArg(
"val", pobj))
return TCL_ERROR;
122 if (!args.
AllDone())
return TCL_ERROR;
125 (it->second)->
operator()(args);
127 Tcl_AppendResult(args.
Interp(),
"-E: ", e.
ErrMsg().
Text().c_str(),
nullptr);
129 }
catch (exception& e) {
130 Tcl_AppendResult(args.
Interp(),
"-E: ", e.
what(),
nullptr);
const std::string & Text() const
FIXME_docs.
virtual const char * what() const noexcept
FIXME_docs.
const RerrMsg & ErrMsg() const
FIXME_docs.
bool GetArg(const char *name, Tcl_Obj *&pval)
FIXME_docs.
Tcl_Interp * Interp() const
FIXME_docs.
bool AllDone()
FIXME_docs.
Implemenation (inline) of RtclOPtr.
virtual ~RtclSetList()
FIXME_docs.
void Add(const std::string &name, set_uptr_t &&upset)
FIXME_docs.
int M_set(RtclArgs &args)
FIXME_docs.
std::unique_ptr< RtclSetBase > set_uptr_t
Declaration of class ReventLoop.