// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using UnityEngine; namespace Microsoft.MixedReality.Toolkit { [System.Obsolete("Add a of type IMixedRealityService, which defines the service type this data provider is valid for.")] public abstract class BaseDataProvider : BaseDataProvider { /// /// Constructor. /// /// The instance that loaded the data provider. /// The to which the provider is providing data. /// The friendly name of the data provider. /// The registration priority of the data provider. /// The configuration profile for the data provider. [System.Obsolete("This constructor is obsolete (registrar parameter is no longer required) and will be removed in a future version of the Microsoft Mixed Reality Toolkit.")] protected BaseDataProvider( IMixedRealityServiceRegistrar registrar, IMixedRealityService service, string name = null, uint priority = DefaultPriority, BaseMixedRealityProfile profile = null) : this(service, name, priority, profile) { Registrar = registrar; } /// /// Constructor. /// /// The to which the provider is providing data. /// The friendly name of the data provider. /// The registration priority of the data provider. /// The configuration profile for the data provider. protected BaseDataProvider( IMixedRealityService service, string name = null, uint priority = DefaultPriority, BaseMixedRealityProfile profile = null) : base(service, name, priority, profile) { } } /// /// The base data provider implements and provides default properties for all data providers. /// public abstract class BaseDataProvider : BaseService, IMixedRealityDataProvider where T : IMixedRealityService { /// /// Constructor. /// /// The to which the provider is providing data. /// The friendly name of the data provider. /// The registration priority of the data provider. /// The configuration profile for the data provider. protected BaseDataProvider( T service, string name = null, uint priority = DefaultPriority, BaseMixedRealityProfile profile = null) : base() { if (service == null) { Debug.LogError($"{name} requires a valid service instance."); } Service = service; Name = name; Priority = priority; ConfigurationProfile = profile; } /// /// The service registrar instance that registered this service. /// [System.Obsolete("The Registrar property is obsolete and will be removed in a future version of the Microsoft Mixed Reality Toolkit")] protected IMixedRealityServiceRegistrar Registrar { get; set; } = null; /// /// The service instance to which this provider is providing data. /// protected T Service { get; set; } = default(T); } }