2using System.Collections.Generic;
3using System.Xml.Serialization;
13[XmlType(TypeName =
"solverAdapterLoadResult")]
16 private readonly List<string> _diagnostics =
44 [XmlElement(
"descriptor")]
54 [XmlAttribute(
"status")]
64 [XmlElement(
"assemblyPath")]
74 [XmlElement(
"typeName")]
99 [XmlElement(
"exceptionType")]
110 [XmlElement(
"exceptionMessage")]
120 [XmlArray(
"diagnostics")]
121 [XmlArrayItem(
"diagnostic")]
147 if (
string.IsNullOrWhiteSpace(
150 throw new ArgumentException(
151 "A diagnostic message cannot be empty.",
173 ArgumentNullException.ThrowIfNull(
177 exception.GetType().FullName ??
178 exception.GetType().Name;
Describes a solver adapter without loading or executing its native optimization engine.
ISolverAdapter? Adapter
Gets or sets the loaded adapter instance.
List< string > Diagnostics
Gets the diagnostics produced during adapter loading.
void SetException(Exception exception)
Stores exception information without retaining the live exception object.
SolverAdapterLoadResult()
Initializes an empty solver-adapter load result.
bool IsLoaded
Gets a value indicating whether the adapter was loaded successfully.
SolverAdapterLoadStatus Status
Gets or sets the final adapter loading status.
string AssemblyPath
Gets or sets the full path of the adapter assembly.
void AddDiagnostic(string message)
Adds a diagnostic message.
string ExceptionMessage
Gets or sets the exception message associated with a load failure.
string TypeName
Gets or sets the requested adapter type name.
SolverAdapterDescriptor? Descriptor
Gets or sets the descriptor associated with the adapter loading attempt.
string ExceptionType
Gets or sets the exception type associated with a load failure.
Defines the metadata and capabilities exposed by a solver adapter plugin.
SolverAdapterLoadStatus
Describes the result of loading a solver adapter plugin.
@ Loaded
The adapter was loaded successfully.