Last change
on this file since 1555 was
1553,
checked in by epitzer, 16 years ago
|
Replace final fixes for broken parent references with separation of instance creation with meta information. (#548)
|
File size:
1.8 KB
|
Rev | Line | |
---|
[1454] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using HeuristicLab.Persistence.Core;
|
---|
| 4 |
|
---|
| 5 | namespace HeuristicLab.Persistence.Interfaces {
|
---|
| 6 |
|
---|
| 7 | public interface IDecomposer {
|
---|
| 8 |
|
---|
| 9 | /// <summary>
|
---|
[1539] | 10 | /// Defines the Priorty of this Decomposer. Higher number means
|
---|
| 11 | /// higher prioriy. Negative numbers are fallback decomposers.
|
---|
| 12 | /// All default generic decomposers have priority 100. Specializations
|
---|
| 13 | /// have priority 200 so they will be tried first. Priorities are
|
---|
| 14 | /// only considered for default configurations.
|
---|
| 15 | /// </summary>
|
---|
| 16 | int Priority { get; }
|
---|
| 17 |
|
---|
| 18 | /// <summary>
|
---|
[1454] | 19 | /// Determines for every type whether the decomposer is applicable.
|
---|
| 20 | /// </summary>
|
---|
| 21 | bool CanDecompose(Type type);
|
---|
| 22 |
|
---|
| 23 | /// <summary>
|
---|
[1553] | 24 | /// Generate MetaInfo necessary for instance creation. (i.e.
|
---|
| 25 | /// array dimensions).
|
---|
| 26 | /// </summary>
|
---|
| 27 | IEnumerable<Tag> CreateMetaInfo(object obj);
|
---|
| 28 |
|
---|
| 29 | /// <summary>
|
---|
[1454] | 30 | /// Decompose an object into KeyValuePairs, the Key can be null,
|
---|
| 31 | /// the order in which elements are generated is guaranteed to be
|
---|
[1553] | 32 | /// the same as they will be supplied to the Populate method.
|
---|
[1454] | 33 | /// </summary>
|
---|
[1542] | 34 | IEnumerable<Tag> Decompose(object obj);
|
---|
[1454] | 35 |
|
---|
| 36 | /// <summary>
|
---|
[1553] | 37 | /// Create an instance of the object using the provided meta information.
|
---|
[1454] | 38 | /// </summary>
|
---|
| 39 | /// <param name="type"></param>
|
---|
| 40 | /// <returns></returns>
|
---|
[1553] | 41 | object CreateInstance(Type type, IEnumerable<Tag> metaInfo);
|
---|
[1454] | 42 |
|
---|
| 43 | /// <summary>
|
---|
| 44 | /// Compose an object from the KeyValuePairs previously generated
|
---|
| 45 | /// in DeCompose. The order in which the values are supplied is
|
---|
| 46 | /// the same as they where generated. Keys might be null.
|
---|
| 47 | /// </summary>
|
---|
[1553] | 48 | void Populate(object instance, IEnumerable<Tag> tags, Type type);
|
---|
[1454] | 49 | }
|
---|
| 50 |
|
---|
| 51 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.