How to create and implement a new Ice interface
  • First, define a new Slice interface in an existing or a new .ice file in the $Package_Dir/source/$Package_Name/interface.
  • New Slice files must be added to $Package_Dir/source/$Package_Name/interface/CMakeLists.txt. The C++ files are generated during the next CMake run.
  • Include the header file generated from the Slice definition in the Components header file which should implement this interface. The include path is $Package_Name/interface/$subdirectory/$slice_filename.h.
  • The component should use virtual public inheritance to implement the new Ice interface.
  • Add the methods defined in the Slice interface to the Component definition.
  • The end of the method signature should contain "const ::Ice::Current& = ::Ice::Current()" (without quotes!).
  • Add the interface library to the COMPONENT_LIBS variable in the CMakeList.txt of the respective Component.
  • Implement the methods (Take care that methods called via IceStorm return as fast as possible. This means copying the data and processing it in a different thread. This requires locking of shared data structures).

See How to Implement a Custom Unit for an example.

One IceObject can only inherit from one Ice interface. If inheritance from multiple Ice interfaces is required, it is possible to define a new Ice interface in Slice which extends all required interfaces.