ValueType
IValueType is a description for primitive types.
/// <summary>
/// Primitive type description.
///
/// See sub-interfaces:
/// <see cref="IIntegerType"/>
/// <see cref="IRealType"/>
/// <see cref="IEnumerationType"/>
/// </summary>
public interface IValueType : IDataType
{
}
IDataType └── IValueType └── INumberType ├── IIntegerType │ └── IEnumerationType └── IRealType
DataTypeRequest<NetInteger>, DataTypeRequest<NetReal>, DataTypeRequest<NetString> are requests for .NET value types. (Avalanche.DataType.Net.dll)
// Create service
IService service = Services.Create(NetTypeHandlers.Instance);
// Create request
DataTypeRequest<NetType> request = new(typeof(int));
// Request
IValueType datatype = service.GetRequired<DataTypeRequest<NetType>, IValueType>(request);
Full Example
Full example
using Avalanche.DataType;
using Avalanche.Service;
using static System.Console;
public class valuetype
{
public static void Run()
{
{
// <04>
// Create service
IService service = Services.Create(NetTypeHandlers.Instance);
// Create request
DataTypeRequest<NetType> request = new(typeof(int));
// Request
IValueType datatype = service.GetRequired<DataTypeRequest<NetType>, IValueType>(request);
// </04>
// Print
WriteLine(datatype.PrintTree(format: DataTypePrintTreeExtensions.PrintFormat.DefaultLong));
}
}
}