error while using EnableAsciiAll () method

268 views
Skip to first unread message

Meena sharma

unread,
Sep 2, 2010, 7:07:21 AM9/2/10
to ns-3-...@googlegroups.com
Hi,
    while trying to create a trace file I added the line
std::ofstream ascii;
  ascii.open ("first.tr");
  PointToPointHelper::EnableAsciiAll (ascii);
but while /i buid it using ./waf
it gives the following error

/scratch/first.cc: In function ‘int main(int, char**)’:
../scratch/first.cc:74: error: no matching function for call to ‘ns3::AsciiTraceHelperForDevice::EnableAsciiAll(std::ofstream&)’
debug/ns3/trace-helper.h:541: note: candidates are: void ns3::AsciiTraceHelperForDevice::EnableAsciiAll(std::string)
debug/ns3/trace-helper.h:550: note:                 void ns3::AsciiTraceHelperForDevice::EnableAsciiAll(ns3::Ptr<ns3::OutputStreamWrapper>)

Please help.
Meena

Salvador Climent Bayarri

unread,
Sep 2, 2010, 7:14:49 AM9/2/10
to ns-3-...@googlegroups.com
I think you just have to give the filename to the helper and it will
take care of the rest:

PointToPointHelper.EnableAsciiAll("first.tr");

> --
> You received this message because you are subscribed to the Google Groups
> "ns-3-users" group.
> To post to this group, send email to ns-3-...@googlegroups.com.
> To unsubscribe from this group, send email to
> ns-3-users+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/ns-3-users?hl=en.
>

Meena sharma

unread,
Sep 2, 2010, 7:36:57 AM9/2/10
to ns-3-...@googlegroups.com
Hi,
    I used the object of   PointToPointHelper pointToPoint and called the method and pass the file name.
pointToPoint.EnableAsciiAll ("first.tr");
I got 3 files in the top level directory as first.tr, first.tr-0-0.tr, first.tr-1-0.tr.
Thanks,
Meena

Craig Dowell

unread,
Sep 2, 2010, 5:53:35 PM9/2/10
to ns-3-...@googlegroups.com
> while trying to create a trace file I added the line
> std::ofstream ascii;
> ascii.open ("first.tr");
> PointToPointHelper::EnableAsciiAll (ascii);
> but while /i buid it using ./waf
> it gives the following error

[ ... ]

There are probably dozens of examples of how this is done in the ns-3
examples. Try doing something like,

cd ns-3-dev
find . -name '*.cc' | xargs grep EnableAsciiAll

and you will find your answer. You need to do something like,

p2p.EnableAsciiAll (ascii.CreateFileStream ("tcp-large-transfer.tr"));

You are currently trying to use an old ASCII trace API that was in place
prior to ns-3.8 which no longer works.

Look at the examples.

-- Craig


Reply all
Reply to author
Forward
0 new messages