真正的安全感,来自你对自己的信心,是你每个阶段性目标的实现,而真正的归属感,在于你的内心深处,对自己命运的把控,因为你最大的对手永远都是自己。| Network+Security+Database.
全部博文(285)
分类: 系统运维
2008-12-15 18:49:37
第一类接口:
tcl中的语句:
set chan($j) [new WimshChannel]
c++对应的语句:
1.定义WimshChannel类
class WimshChannel : public TclObject {};
2.做好两层的接口
static class WimshChannelClass : public TclClass {
public:
WimshChannelClass() : TclClass("WimshChannel") {}
TclObject* create(int, const char*const*) {
return (new WimshChannel);
}
} class_wimsh_channel;
第二类接口:
tcl中的语句:
$chan($j) topology $topo
c++中对应的语句
int WimshChannel::command(int argc, const char*const* argv)
if ( argc == 3 && strcmp (argv[1], "topology") == 0 ) {
topology_ = (WimshTopologySimple*) TclObject::lookup(argv[2]);
return TCL_OK;
}
第三类接口:
tcl中的语句:
Mac/802_11e set basicRate_ 1Mb
c++中对应的语句:
Tcl& tcl = Tcl::instance();
tcl.evalf("Mac/802_11e set basicRate_");
if (strcmp(tcl.result(), "0") != 0)
bind_bw("basicRate_", &basicRate_);
else
basicRate_ = bandwidth_;