hello all,
recently,I am researching linkage between NS and
it's c++ source.
but, Confused by two questions below,I desire
for an answer.
1)how to create class TclObject and class TclClass by
global procedure new{}
e.g.(in packet.cc)
/* manages active packet header types
*/
class PacketHeaderManager : public TclObject { public: PacketHeaderManager() { bind("hdrlen_", &Packet::hdrlen_); } }; static class PacketHeaderManagerClass : public TclClass
{
public: PacketHeaderManagerClass() : TclClass("PacketHeaderManager") {} TclObject* create(int, const char*const*) { return (new PacketHeaderManager); } } class_packethdr_mgr; 2)when creating a static unicast topology ,whether or not
NS generates a table
that saved all target_ object address,for running
target_->recv(p,h).
because I find
that class object attached target_ address is generated,
as using xemacs+gdb to trace it.
e.g.
class xxx {this =0x...,packet=0x...,h=....}
{
name_=...
target_=0x...,
...
}
any help is appreciated.
Best regards
Jim Yang
|