SimpleInterface
This example demonstrates how interfaces are translated to C++. They become C++ classes which are inherited from System::Object and have RTTI declared.
Additional command-line options passed to CodePorting.Translator.Cs2Cpp: none.
Source C# Code
namespace TypesPorting
{
public interface ISimpleInterface
{
}
}
Translated Code
C++ Header
#pragma once
#include <system/object.h>
namespace TypesPorting {
class ISimpleInterface : public System::Object
{
typedef ISimpleInterface ThisType;
typedef System::Object BaseType;
typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
RTTI_INFO_DECL();
};
} // namespace TypesPorting
C++ Source Code
#include "ISimpleInterface.h"
namespace TypesPorting {
RTTI_INFO_IMPL_HASH(2998900006u, ::TypesPorting::ISimpleInterface, ThisTypeBaseTypesInfo);
} // namespace TypesPorting