2using System.Collections.Generic;
3using System.Xml.Serialization;
12[XmlType(TypeName =
"solverAdapterDescriptor")]
15 private readonly List<SolverCapability> _capabilities =
45 [XmlAttribute(
"adapterId")]
55 [XmlElement(
"adapterName")]
65 [XmlElement(
"adapterVersion")]
75 [XmlAttribute(
"solverKind")]
86 [XmlElement(
"minimumSupportedSolverVersion")]
96 [XmlElement(
"assemblyPath")]
106 [XmlElement(
"typeName")]
116 [XmlArray(
"capabilities")]
117 [XmlArrayItem(
"capability")]
129 if (
string.IsNullOrWhiteSpace(
132 throw new InvalidOperationException(
133 "A solver adapter identifier is required.");
136 if (
string.IsNullOrWhiteSpace(
139 throw new InvalidOperationException(
140 "A solver adapter name is required.");
143 if (
string.IsNullOrWhiteSpace(
146 throw new InvalidOperationException(
147 "A solver adapter version is required.");
154 throw new InvalidOperationException(
155 "A solver adapter must target a concrete " +
166 throw new InvalidOperationException(
167 "The capability collection cannot contain " +
187 return _capabilities.Contains(
string AdapterVersion
Gets or sets the adapter implementation version.
bool SupportsCapability(SolverCapability capability)
Gets a value indicating whether the adapter declares the specified capability.
string AdapterName
Gets or sets the adapter display name.
string MinimumSupportedSolverVersion
Gets or sets the minimum supported native solver version.
SolverKind SolverKind
Gets or sets the solver kind implemented by the adapter.
List< SolverCapability > Capabilities
Gets the capabilities declared by the adapter.
void EnsureValid()
Validates the adapter descriptor.
string AdapterId
Gets or sets the unique adapter identifier.
string TypeName
Gets or sets the assembly-qualified adapter type name.
string AssemblyPath
Gets or sets the full path of the adapter assembly.
SolverAdapterDescriptor()
Initializes an empty solver-adapter descriptor.
SolverCapability
Identifies an optional capability implemented by a solver adapter.