Home Help Center

ICE Interaction with Other Libs

This may be more a C++ question then ICE question.
We are using a third party library that has has a vector class defined which includes useful functions for normalizing etc the vector.
We also want to pass these vectors across the wire to/from our position server.
What would be a common way to do this - do we have to create an adapter class that converts vectors to ice_vectors at both ends or is their some other way to acheive this.

Comments

  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    Ice sequences map simply to C++ STL vectors. So whatever conversion you use for your own vectors to and from standard STL containers will also work for Ice.
  • tony_htony_h Member
    Actually the vector class contains float x float y float z as opposed to STL vector.
    So I can define equivalent structure in .ice file but have the problem of having to convert back and forth at each end.
  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    Originally posted by tony_h
    Actually the vector class contains float x float y float z as opposed to STL vector.
    So I can define equivalent structure in .ice file but have the problem of having to convert back and forth at each end.

    Right, you can only transfer types that are defined in Slice. You cannot transfer arbitrary C++ types.
Sign In or Register to comment.