Multiple Java class generated for const in IDL

2 posts / 0 new
Last post
Offline
Last seen: 10 years 3 weeks ago
Joined: 09/21/2013
Posts: 3
Multiple Java class generated for const in IDL

I am trying to generate Java sources from VideoData.idl , from the Streaming Video demo.  The Java sources got generated, but each const result in an individual Java class:

Java source generated

This is te content of one of the generated Java class source file MAX_BUFFER_SIZE.java 

Loading https://gist.github.com/8471641....

 

 

This is the original IDL file, with only the package name changed:

 

module net {
module entrypass {
module videodata {
module generated {

const string VIDEO_TOPIC = "VideoData";
const string QOS_LIBRARY = "RTIExampleQosLibrary";
const string QOS_PROFILE_STREAMING_DATA = "StreamingVideoData";
const string QOS_PROFILE_MULTICAST_DATA = "MulticastVideo";

const long MAX_BUFFER_SIZE = 1048576;
 
struct VideoStream {
   long stream_id; //@key
   unsigned long flags;
unsigned long sequence_number;
sequence <octet, MAX_BUFFER_SIZE> frame; 

};

};
};
};
};      
    

 

 Does it mean all constants must be located it it's own struct?

AttachmentSize
Binary Data VideoData.idl1.74 KB
File MAX_BUFFER_SIZE.java409 bytes
Organization:
Howard's picture
Offline
Last seen: 1 day 12 hours ago
Joined: 11/29/2012
Posts: 565

Hi Hanxue,

I doubt that you are interested in this anymore since our last conversation, but just in case...


In IDL, the use of

module net {
module entrypass {
module videodata {
module generated {
 
does not imply that a structure is created with those names.  "module" is just a name space.  Depending on the actual programming language, it's translated differently
 
in C++, it's namespace
 
in Java, it's package
 
So, no constants do not have to be defined in a structure.
 
Best regards,
 
--Howard