tbf/TBF/BenchControl/Generic/IComponentFactory.cs

40 lines
1.2 KiB
C#

///
/// Copyright (c) 2013-2016 Sensus Metering Systems
///
using System.Collections.Generic;
namespace TBF.BenchControl.Generic
{
public interface IComponentFactory
{
string ClassName { get; } /// Name of the class of components (for instance "Valve")
/// <summary>
/// Returns a dummy component without configuration useful only for runtime class type identification
/// Usage: if (TbfComponents.CmpntFactoryFromClassName(className).DummyComponent() is IValve) { ... }
/// </summary>
IComponent DummyComponent();
/// <summary>
/// Returns a component with the given configuration
/// </summary>
/// <param name="cfg">Component comfiguration</param>
/// <param name="components">List of all component</param>
/// <returns>Component instance</returns>
IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components);
/// <summary>
/// Returns the default configuration
/// </summary>
IComponentCfg DefaultConfig();
/// <summary>
/// Converts an Entities.Component object into an instance of an appropriate class implementing IComponentCfg
/// </summary>
IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component);
void ResetStaticProperties();
}
}