[Ns-developers] Problems with ObjectFactory

Mathieu Lacage mathieu.lacage at sophia.inria.fr
Fri Mar 6 04:23:44 PST 2009


On Fri, 2009-03-06 at 13:15 +0100, Mirko Banchi wrote:
> > yes, it's an easy one :) 
> > 
> > You need to add a call to AddConstructor<MsgStandardAggregator> () in
> > MsduStandardAggregator::GetTypeId
> > 
> 
> I have already this...:(
> MsduStandardAggregator::GetTypeId appears like this:
> 
> TypeId
> MsduStandardAggregator::GetTypeId (void)
> {
>   static TypeId tid = TypeId ("ns3::MsduStandardAggregator")
>     .SetParent<MsduAggregator> ()
>     .AddConstructor<MsduStandardAggregator> ()
>     .AddAttribute ("MaxAmsduSize", "Max length in byte of an A-MSDU",
>                    UintegerValue (7935),
>                    MakeUintegerAccessor
> (&MsduStandardAggregator::m_maxAmsduLength),
>                    MakeUintegerChecker<uint32_t> ())
>     ;
>   return tid;
> }
> 
> I don't know the reason but seems that m_tid field in ObjectFactory
> (returned by TypeId::LookupByName method) contains an uid referring to
> ns3::Node.

uh, weird. You are saying that:
TypeId::LookupByName ("ns3::MsduStandardAggregator").GetName () 
returns "ns3::Node" ?

Maybe you should try to add NS_OBJECT_ENSURE_REGISTERED
(MsduStandardAggregator) in msdu-standard-aggregator.cc

Are you sure that GetTypeId is declared a static member of
MsduStandardAggregator ?

Mathieu



More information about the Ns-developers mailing list