Bug 565

Summary: contrib/stats data output filename interface
Product: ns-3 Reporter: Tommaso Pecorella <tommaso.pecorella>
Component: generalAssignee: ns-bugs <ns-bugs>
Status: RESOLVED FIXED    
Severity: minor CC: tjkopena
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   
Attachments: patch to src/contrib/stats to have consistent file naming functions

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.