51Degrees Pipeline .NET  4.1

51Degrees Pipeline for .NET

FiftyOne.Pipeline.Engines.Data.AspectDataBase Class Reference

Detailed Description

Base class for element data instances that are generated by an IAspectEngine.

Modifies the indexer from the ElementDataBase base class to use the IMissingPropertyService to determine the reason that a requested key value is missing. For example, if the user has excluded the property at the configuration stage.

Inheritance diagram for FiftyOne.Pipeline.Engines.Data.AspectDataBase:

[legend]

Collaboration diagram for FiftyOne.Pipeline.Engines.Data.AspectDataBase:

[legend]

Public Member Functions

OperationCanceledException - Thrown if lazy loading is enabled and the cancellation token has been used to cancel processing before it was completed.
More...
 AspectDataBase (ILogger< AspectDataBase > logger, IPipeline pipeline, IAspectEngine engine)
Constructor More...
 AspectDataBase (ILogger< AspectDataBase > logger, IPipeline pipeline, IAspectEngine engine, IMissingPropertyService missingPropertyService)
Constructor More...
 AspectDataBase (ILogger< AspectDataBase > logger, IPipeline pipeline, IAspectEngine engine, IMissingPropertyService missingPropertyService, IDictionary< string, object > dictionary)
Constructor More...
override IReadOnlyDictionary< string, object >  AsDictionary ()
Get the data contained in this instance as an IReadOnlyDictionary<TKey, TValue>.

Exceptions

Public Member Functions inherited from FiftyOne.Pipeline.Core.Data.ElementDataBase

 ElementDataBase (ILogger< ElementDataBase > logger, IPipeline pipeline)
Constructor Creates an ElementDataBase instance with a non-thread-safe, case-insensitive dictionary. More...
 ElementDataBase (ILogger< ElementDataBase > logger, IPipeline pipeline, IDictionary< string, object > dictionary)
Constructor More...

Public Member Functions inherited from FiftyOne.Pipeline.Core.Data.DataBase

 DataBase (ILogger< DataBase > logger)
Constructor Creates a DataBase instance with a non-thread-safe, case-insensitive dictionary. More...
 DataBase (ILogger< DataBase > logger, IDictionary< string, object > dictionary)
Constructor More...
void  PopulateFromDictionary (IDictionary< string, object > values)
Use the values in the specified dictionary to populate this data instance. More...

Protected Member Functions

override T  GetAs< T > (string key)
Get the value for the specified property as the specified type. More...
virtual bool  TryGetValue< T > (string key, out T value)
Get the value associated with the specified key. More...

Properties

IMissingPropertyService  MissingPropertyService [get]
The IMissingPropertyService instance to be queried when there is no entry for a requested key. More...
ILogger< AspectDataBase >  Logger [get]
The logger to be used by this instance. More...
IReadOnlyList< IAspectEngine >  Engines [get]
The engine that generated this data instance. More...
Task  ProcessTask [get]
If the engine is configured for lazy loading, this property returns a task that will complete once the engine has finished processing. More...
override object  this[string key] [get]
get or set the specified value More...

Properties inherited from FiftyOne.Pipeline.Core.Data.ElementDataBase

IPipeline  Pipeline [get, set]
The IPipeline instance this element data will be associated with. More...

Properties inherited from FiftyOne.Pipeline.Core.Data.DataBase

virtual object  this[string key] [get, set]
Get or set a data value More...

Properties inherited from FiftyOne.Pipeline.Core.Data.IData

object  this[string key] [get, set]
Get or set a data value More...

Properties inherited from FiftyOne.Pipeline.Core.Data.IElementData

IPipeline  Pipeline [get, set]
The IPipeline that this instance was created by More...

Properties inherited from FiftyOne.Pipeline.Engines.Data.IAspectData

IReadOnlyList< IAspectEngine >  Engines [get]
The engine that generated the data withing this data instance. More...
Task  ProcessTask [get]
If the engine is configured for lazy loading, this property returns a task that will complete once the engine has finished processing. More...

Constructor & Destructor Documentation

◆ AspectDataBase() [1/3]

FiftyOne.Pipeline.Engines.Data.AspectDataBase.AspectDataBase ( ILogger< AspectDataBase >   logger,
IPipeline   pipeline,
IAspectEngine   engine  
)

Constructor

Parameters
logger - Used for logging
pipeline - The IPipeline instance this element data will be associated with.
engine - The IAspectEngine that created this instance

◆ AspectDataBase() [2/3]

FiftyOne.Pipeline.Engines.Data.AspectDataBase.AspectDataBase ( ILogger< AspectDataBase >   logger,
IPipeline   pipeline,
IAspectEngine   engine,
IMissingPropertyService   missingPropertyService  
)

Constructor

Parameters
logger - Used for logging
pipeline - The IPipeline instance this element data will be associated with.
engine - The IAspectEngine that created this instance
missingPropertyService - The IMissingPropertyService to use when a requested key cannot be found.

◆ AspectDataBase() [3/3]

FiftyOne.Pipeline.Engines.Data.AspectDataBase.AspectDataBase ( ILogger< AspectDataBase >   logger,
IPipeline   pipeline,
IAspectEngine   engine,
IMissingPropertyService   missingPropertyService,
IDictionary< string, object >   dictionary  
)

Constructor

Parameters
logger - Used for logging
pipeline - The IPipeline instance this element data will be associated with.
engine - The IAspectEngine that created this instance
missingPropertyService - The IMissingPropertyService to use when a requested key cannot be found.
dictionary - The dictionary instance to use internally when storing data values.

Member Function Documentation

◆ AsDictionary()

override IReadOnlyDictionary<string, object> FiftyOne.Pipeline.Engines.Data.AspectDataBase.AsDictionary ( )
virtual

Get the data contained in this instance as an IReadOnlyDictionary<TKey, TValue>.

Exceptions
OperationCanceledException - Thrown if lazy loading is enabled and the cancellation token has been used to cancel processing before it was completed.

Exceptions
TimeoutException - Thrown if lazy loading is enabled and processing did not complete before the configured timeout expired.
AggregateException - Thrown if lazy loading is enabled and multiple errors occurred during processing.

Reimplemented from FiftyOne.Pipeline.Core.Data.DataBase.

◆ GetAs< T >()

override T FiftyOne.Pipeline.Engines.Data.AspectDataBase.GetAs< T > ( string   key )
protected virtual

Get the value for the specified property as the specified type.

This overrides the default implementation to provide additional capabilities such as lazy loading and exposing a reason for

properties that are not present in the data.

Template Parameters
T - The type to return
Parameters
key - The key of the property to get
Returns
The value for the specified property.
Exceptions
ArgumentNullException - Thrown if key is null.
PropertyMissingException - Thrown if there is no entry matching the specified key.
OperationCanceledException - Thrown if lazy loading is enabled and the cancellation token has been used to cancel processing before it was completed.
TimeoutException - Thrown if lazy loading is enabled and processing did not complete before the configured timeout expired.
AggregateException - Thrown if lazy loading is enabled and multiple errors occurred during processing.

Reimplemented from FiftyOne.Pipeline.Core.Data.DataBase.

◆ TryGetValue< T >()

virtual bool FiftyOne.Pipeline.Engines.Data.AspectDataBase.TryGetValue< T > ( string   key,
out T   value  
)
protected virtual

Get the value associated with the specified key.

Inheriting classes can override this method where they access data in different ways.

Parameters
key - The string key to retrieve the value for.
value - Will be populated with the value for the specified key.
Returns
True if the key is present in the data store, false if not.

Property Documentation

◆ Engines

IReadOnlyList<IAspectEngine> FiftyOne.Pipeline.Engines.Data.AspectDataBase.Engines
get

The engine that generated this data instance.

◆ Logger

ILogger<AspectDataBase> FiftyOne.Pipeline.Engines.Data.AspectDataBase.Logger
get protected

The logger to be used by this instance.

◆ MissingPropertyService

IMissingPropertyService FiftyOne.Pipeline.Engines.Data.AspectDataBase.MissingPropertyService
get protected

The IMissingPropertyService instance to be queried when there is no entry for a requested key.

◆ ProcessTask

Task FiftyOne.Pipeline.Engines.Data.AspectDataBase.ProcessTask
get

If the engine is configured for lazy loading, this property returns a task that will complete once the engine has finished processing.

Otherwise, it will be null.

◆ this[string key]

override object FiftyOne.Pipeline.Engines.Data.AspectDataBase.this[string key]
get

get or set the specified value

Parameters
key - The key/name of the property to get or set.
Returns
The property value.
Exceptions
PropertyMissingException - Thrown if there is no entry for the specified key.