Bug 565 - contrib/stats data output filename interface
contrib/stats data output filename interface
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: general
ns-3-dev
All All
: P5 minor
Assigned To: ns-bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-05-09 10:26 UTC by Tommaso Pecorella
Modified: 2009-06-24 10:47 UTC (History)
1 user (show)

See Also:


Attachments
patch to src/contrib/stats to have consistent file naming functions (5.86 KB, patch)
2009-05-09 10:26 UTC, Tommaso Pecorella
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tommaso Pecorella 2009-05-09 10:26:55 UTC
Created attachment 437 [details]
patch to src/contrib/stats to have consistent file naming functions

Hi,

I'm not totally happy with contrib/stats functions to set the output file name.

OmnetDataOutput class have a void SetFilePrefix(const std::string prefix), and it allows to set a filename prefix (the real file name is prefix.sca).

SqliteDataOutput class uses a void SetDBFile(const std::string file), allowing to set a filename regardless of the "extension" (it's not an extension, I know). The SQLite convention is to end the filename in .db anyway.

If you want to do multiple batch runs with this method, you'll be forced to do strange things in the main code, like "if the output is OmnetDataOutput, change the prefix, either add a ".db" at end and change the filename. Horrible.

Thus, I moved the SetFilePrefix method to the DataOutputInterface and changed slightly both classes to use it.

I did it in a qwick and dirty way tho, so double check it.

Cheers
Comment 1 Faker Moatamri 2009-05-20 06:32:43 UTC
Hello,
I added your patch to be reviewed on this web page and I sent an email to reviewers with your comments attached.
http://codereview.appspot.com/67079
Best regards
Faker Moatamri
Comment 2 Joe Kopena 2009-06-24 10:47:03 UTC
These changes have been incorporated into the main branch.  Thanks!


For archival reference: Note that this patch cannot be directly applied---it's backwards and the directories structured oddly.