Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1835348
  • 博文数量: 343
  • 博客积分: 10342
  • 博客等级: 上将
  • 技术积分: 2892
  • 用 户 组: 普通用户
  • 注册时间: 2008-08-15 12:34
个人简介

你必须非常努力,才能看起来毫不费力!

文章存档

2012年(3)

2011年(5)

2010年(2)

2009年(40)

2008年(293)

分类: 系统运维

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_;

阅读(1597) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~