Sequence length strange error

6 posts / 0 new
Last post
Offline
Last seen: 11 years 1 week ago
Joined: 01/07/2013
Posts: 15
Sequence length strange error

Hi,
I don't undestrand what is happening, when I try to write a sample containing a Sequence I get this error: RTICdrStream_serializePrimitiveSequence:sequence length (108) exceeds maximum (100)...

Also using debugger I verified that Sequence have length = 2 and maximum = 100. How can I get this error? What can I check?

I fill the Sequence periodically copyng from a std::map<int, ObjectWithSequence> the values and I change the lenght of my Sequence according to the size of the map.

Thanks

Keywords:
rip
rip's picture
Offline
Last seen: 1 day 5 hours ago
Joined: 04/06/2012
Posts: 324

Hi,

Can you give an example of the IDL you are using for the sequence?  Which of these is closer:

    sequence<long, 110> myLongs;

or

    sequence<long> myLongs;

?

The default sequence length is 100 (see User's Manual, section 3.6.1), in the second case above the sequence is created by rtiddsgen as if it were

    sequence<long, 100> myLongs;

That's probably what you are seeing.  If this is the case, you can either explicitly state how long the sequence is as in the first case, or you can change the default sequence length using -sequenceSize # at the command line (but, don't do that.  Do it explicitly).

Changing the length of the sequence only affects the data that will be written, it does not affect the /physically allowed length/, which is part of the source generation event (ie, rtiddsgen).  see User's Manual section 7.4.5, third paragraph.

 

Regards,

Rip

Offline
Last seen: 11 years 1 week ago
Joined: 01/07/2013
Posts: 15

I use  sequence<MyObject> myobject;

but also using the other form I get the same problem.

I don't understand how the sequence length can exceed maximum (100) when the length value is only 2...

 

rip
rip's picture
Offline
Last seen: 1 day 5 hours ago
Joined: 04/06/2012
Posts: 324

There are three sizes to consider:

The size as defined in the IDL, which uses a default of 100 (maximum physical size)

The Length size (virtual size)

The amount of data actually in the sequence (logical size)

It looks like your virtual size is 2, your max size is 100, but the algorithm you are using to fill the sequence is filling it with > 100 items.  Is this correct?

 

Rip

Gerardo Pardo's picture
Offline
Last seen: 1 day 5 hours ago
Joined: 06/02/2010
Posts: 601

Hi,

You may want to take a look at the howto titled Howto use OMG DDS Sequences in C++. It describes the sequence API and the relationship between the sequence length and its capacity (maximum allocated size).

Gerardo

Offline
Last seen: 11 years 1 week ago
Joined: 01/07/2013
Posts: 15

Thanks, the problem was in my code, the error was inside a sequence of sequence.

Thanks a lot.