Home Help Center

Fun and excitement with integer sequences.

xorgxorg Member
OK. This one is weird.

I'm running an application with clients in Java and C++

Nested within some data structures is a sequence of integers - an abridged slice definition is below.

--
sequence<int> IntSeq;

struct HeightMap
{
int sizeX;
int sizeY;
IntSeq points;
};

struct Map
{
HeightMap heights;
}

struct Game
{
Map theMap;
}

--

Now, in my Java clients, this is fine. However, in my C++ client, I get an exception thrown from the vector class in the STL, when the vector corresponding to this sequence is destroyed.

The weird part about this is that I can get around it by using a wrapper for my ints. So, I'd have this nasty thing here. It appears to work fine.

--

struct Intg { int i; };
sequence<Intg> IntSeq;
struct HeightMap
{
int sizeX;
int sizeY;
IntSeq points;
};

--

Has anyone encountered something like this before? I'm content to use the workaround - my application is a university research project running on a LAN, so bandwidth isn't an issue. This does look like a rather odd bug, however.

I'm running with Ice 1.3.0, on Visual Studio .NET 2003, Windows XP and using the Eclipse IDE for Java. The error occurs when a C++ client gets a sequence of ints from the Java server.

I can provide more detail if there are specific requests..

Comments

  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hello,

    One thing missing from your post is how you pass this Map or Game between the client and server. If you could post or e-mail me a test-case, I'll pinpoint the problem.

    Cheers,
    Bernard
    ----
    [email protected]
Sign In or Register to comment.