OMNeT++/OMNEST Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000101OMNeT++command line toolspublic2009-09-02 14:212010-05-09 19:41
Assigned Toandras 
PlatformOSOS Version
Product Version4.0 
Target VersionFixed in Version4.1rc1 
Summary0000101: Add a message property @sizetype() to msgc to specify to specify the type of the array size variable
DescriptionCurrently msgc stores the size of an array in an "int". In OverSim we use msgc generated messages also for real world communication by serializing them with parsim pack()/unpack() methods. In this case using a 32 bit integer is a waste of network communication bandwidth, if we know that an array will only contain a few elements.

I've made a small patch to msgc to support the @sizetype property to specify the C++ type of the array size variable.


packet BaseRpcMessage
    unsigned int nonce;
    NodeHandle srcNode;
    AuthBlock authBlock[] @sizetype(uint8_t);

TagsNo tags attached.
Attached Filespatch file icon msgc_sizetype.patch [^] (949 bytes) 2009-09-02 14:21 [Show Content]

- Relationships

-  Notes
baumgart (reporter)
2009-09-11 09:55

The above patch seems to break neddoc generation. For all messages which appear after a message with the new @sizetype property in the same .msg file, there is no neddoc generated.

BTW, I don't see any error messages or warnings (e.g. undocumented parameters) in the IDE when trying to generate neddoc. Is this not available or is it simply hidden in some place?
andras (administrator)
2010-05-09 18:43
edited on: 2010-05-09 18:49

Implemented @sizetype() for array parameters. Unlike in the attached patch, the specified type is also used in the signatures of the field getter/setter methods (as index), and as return type and arg type in the array size getter/setter methods.

The IDE neddoc error seems to have been fixed since 4.0, as I could not reproduce it. Documentation from types containing @sizetype was correctly generated.

andras (administrator)
2010-05-09 19:41

Update: I could reproduce the neddoc error: it occurred when @sizetype contained a keyword like "int", "short", "unsigned", etc. It was caused by a parse error: the grammar did not allow these keywords in property values. The workaround would have been to put these types in quotes (like this: @sizetype("unsigned char")). I extended the grammar to include these keywords, so it should now work without quotes as well.

- Issue History
Date Modified Username Field Change
2009-09-02 14:21 baumgart New Issue
2009-09-02 14:21 baumgart File Added: msgc_sizetype.patch
2009-09-11 09:55 baumgart Note Added: 0000173
2010-05-09 18:43 andras Note Added: 0000291
2010-05-09 18:43 andras Status new => resolved
2010-05-09 18:43 andras Fixed in Version => 4.1rc1
2010-05-09 18:43 andras Resolution open => fixed
2010-05-09 18:43 andras Assigned To => andras
2010-05-09 18:49 andras Note Edited: 0000291
2010-05-09 19:41 andras Note Added: 0000292

Copyright © 2000 - 2022 MantisBT Team
Powered by Mantis Bugtracker