Bug 565 - contrib/stats data output filename interface
: contrib/stats data output filename interface
Status: RESOLVED FIXED
: ns-3
general
: ns-3-dev
: All All
: P5 minor
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2009-05-09 10:26 EDT by
Modified: 2009-06-24 10:47 EDT (History)


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


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2009-05-09 10:26:55 EDT
Created an attachment (id=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 From 2009-05-20 06:32:43 EDT -------
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 From 2009-06-24 10:47:03 EDT -------
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.