RemoteViz 10.6 : Major API changes

In order to provide your application with safer lifetime control on objects shared by RemoteViz, the API of RemoteViz will be updated in Open Inventor 10.6. The following document describes all the changes that we will introduce and will help you to port your application using this new API.

In addition to the API changes related to the usage of shared pointer, following API changes will be made


Class ServiceSettings(C++|Java|.Net)

Before 10.6, for a newly created ServiceSettings(C++|Java|.Net) object, the default value of the IP attribute was “auto”. Starting with version 10.6, the value “auto” has been removed and the default IP value is now “127.0.0.1”. See the setIP() and getIP() methods.


C++

Pointers

All arguments and return types using a pointer type will be replaced by the equivalent shared pointer type. In other words, “Type* arg” will become “std::shared_ptr arg”. This API change will break source compatibility and generate errors with existing code. To fix these errors, simply replace pointers with shared pointers in your source code.

Derived Classes

We strongly recommend using the C++11 keyword “override” in all classes derived from the RemoteViz classes ServiceListener and RenderAreaListener so that the compiler checks that the virtual methods successfully override the corresponding virtual method in the base class.

Class Connection(C++)

  • bool sendMessage (const unsigned char* buffer, size_t size) const;
    is replaced by
    bool sendMessage(const std::vector<const unsigned char>& buffer) const;
  • New function bool isOpen() const; has been added to gets the state of a Connection (open or closed)

Class Client(C++)

  • bool sendMessage(const std::string& message, Connection** excludedConnections = nullptr, unsigned int num = 0) const;
    is replaced by
    bool sendMessage(const std::string& message, std::vector<std::shared_ptr<Connection>> excludedConnections = {}) const;
  • bool sendMessage (const unsigned char *buffer, size_t size, Connection **excludedConnections=nullptr, unsigned int num=0) const;
    is replaced by
    bool sendMessage(const std::vector<const unsigned char>& buffer, std::vector<std::shared_ptr<Connection>> excludedConnections = {}) const;
  • New function bool isConnected() const; has been added to get the state of the Client (connected or disconnected)

Class RenderArea(C++)

  • bool sendMessage(const std::string& message, Connection** excludedConnections = nullptr, unsigned int num = 0) const;
    is replaced by
    bool sendMessage(const std::string& message, std::vector<std::shared_ptr<Connection>> excludedConnections = {}) const;
  • bool sendMessage (const unsigned char *buffer, size_t size, Connection **excludedConnections=nullptr, unsigned int num=0) const;
    is replaced by
    bool sendMessage(const std::vector<const unsigned char>& buffer, std::vector<std::shared_ptr<Connection>> excludedConnections = {}) const;
  • New function bool isDisposed() const; has been added to get the state of the RenderArea (alive or disposed)

Java

Class Connection(Java)

  • SendMessage(byte[] buffer)
    is replaced by
    SendMessage(Collection<Byte> buffer)
  • New function boolean isOpen() has been added to get the state of a Connection (open or closed)

Class Client(Java) and Class RenderArea(Java)

  • SendMessage(byte[] buffer)
    is replaced by
    SendMessage(Collection<Byte> buffer)
  • SendMessage(byte[] buffer, Connection[] excludedConnections)
    is replaced by
    SendMessage(Collection<byte> buffer, Collection<Connection> excludedConnections)
  • SendMessage(string message, Connection[] excludedConnections)
    is replaced by
    SendMessage(string message, Collection<Connection> excludedConnections)
  • New function boolean isConnected() has been added in class Client(Java) to get the state of the Client (connected or disconnected)
  • New function bool isDisposed() has been added to Class RenderArea(Java) to get the state of a RenderArea (alive or disposed)

Class ServiceListener(Java)

  • OnReceivedMessage(RenderArea, Connection, byte[])
    is replaced by
    OnReceveivedMessage(RenderArea renderArea, Connection sender, Collection<Byte> buffer)

.Net

Class Connection(.Net)

  • SendMessage(byte[] buffer)
    is replaced by
    SendMessage(IList<byte> buffer)
  • New function public bool IsOpen() has been added to get the state of a Connection (open or closed)

Class Client(.Net) and Class RenderArea(.Net)

  • SendMessage(byte[] buffer)
    is replaced by
    SendMessage(IList<byte> buffer)
  • SendMessage(byte[] buffer, Connection[] excludedConnections)
    is replaced by
    SendMessage(IList buffer<byte>, IList<Connection> excludedConnections)
  • SendMessage(string message, Connection[] excludedConnections)
    is replaced by
    SendMessage(string message, IList<Connection> excludedConnections)
  • New function public bool IsConnected() has been added in Client(.Net) class to get the state of the Client (connected or disconnected)
  • New function public bool IsDisposed() has been added to Class RenderArea(.Net) to get the state of a RenderArea (alive or disposed)

Class ServiceListener(.Net)

  • OnReceivedMessage(RenderArea, Connection, Byte[])
    is replaced by
    OnReceveivedMessage(RenderArea renderArea, Connection sender, IList<byte> buffer)

 

0