OMNeT++ Simulator

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000101 [OMNeT++] command line tools feature always 2009-09-02 15:21 2010-05-09 20:41
Reporter baumgart View Status public  
Assigned To andras
Priority normal Resolution fixed  
Status resolved   Product Version 4.0
Summary 0000101: Add a message property @sizetype() to msgc to specify to specify the type of the array size variable
Description Currently 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.

Example:

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

Additional Information
Tags No tags attached.
Attached Files ? file icon msgc_sizetype.patch [^] (949 bytes) 2009-09-02 15:21

- Relationships

-  Notes
(0000173)
baumgart (reporter)
2009-09-11 10: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?
(0000291)
andras (administrator)
2010-05-09 19:43
edited on: 2010-05-09 19: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.

(0000292)
andras (administrator)
2010-05-09 20: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 15:21 baumgart New Issue
2009-09-02 15:21 baumgart File Added: msgc_sizetype.patch
2009-09-11 10:55 baumgart Note Added: 0000173
2010-05-09 19:43 andras Note Added: 0000291
2010-05-09 19:43 andras Status new => resolved
2010-05-09 19:43 andras Fixed in Version => 4.1rc1
2010-05-09 19:43 andras Resolution open => fixed
2010-05-09 19:43 andras Assigned To => andras
2010-05-09 19:49 andras Note Edited: 0000291
2010-05-09 20:41 andras Note Added: 0000292


Mantis 1.1.5[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker