Archived

This forum has been archived. Please start a new discussion on GitHub.

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

  • 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.
  • 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.
  • 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.