L-Acoustics / avdecc

A set of open source libraries for controlling AVB entities using the AVDECC (IEEE 1722.1) protocol compliant to Avnu Milan Specifications
GNU Lesser General Public License v3.0
90 stars 21 forks source link

SWIG - C# std::tuple support #130

Closed Synergetik closed 1 year ago

Synergetik commented 1 year ago

Added std::tuple swig interface definitions for C#.

It uses the same mechanics as std::function. So i split the common part into an own _swigforeach.i interface file. Durring this task i also improved the std::function generator a little bit.

The std::tuple can be used analog with std::function to define type defines, e.g:

%std_tuple(SerializationResult, la::avdecc::jsonSerializer::SerializationError, std::string);

The generated C# SerializationResult provides getter and setter methods to access the fields and a convenience method to Deconstruct it into C# tuples, example usage:

var (error, result) = controller.serializeAllControlledEntitiesAsJson("myfile", flags, "", true);
christophe-calmejane commented 1 year ago

Merged, thanks Vitalij