Pip-Services-Commons-Dotnet
|
The most basic implementation of IReferences to store and locate component references. More...
Public Member Functions | |
References (object[] tuples) | |
Creates a new instance of references and initializes it with references. More... | |
virtual void | Put (object locator, object component) |
Puts a new reference into this reference map. More... | |
virtual object | Remove (object locator) |
Removes a previously added reference that matches specified locator. If many references match the locator, it removes only the first one.When all references shall be removed, use removeAll() method instead. More... | |
virtual List< object > | RemoveAll (object locator) |
Removes all component references that match the specified locator. More... | |
virtual List< object > | GetAllLocators () |
Gets locators for all registered component references in this reference map. More... | |
virtual List< object > | GetAll () |
Gets all component references registered in this reference map. More... | |
virtual object | GetOneOptional (object locator) |
Gets an optional component reference that matches specified locator. More... | |
virtual T | GetOneOptional< T > (object locator) |
Gets an optional component reference that matches specified locator and matching to the specified type. More... | |
virtual object | GetOneRequired (object locator) |
Gets a required component reference that matches specified locator. More... | |
virtual T | GetOneRequired< T > (object locator) |
Gets a required component reference that matches specified locator and matching to the specified type. More... | |
virtual List< object > | GetOptional (object locator) |
Gets all component references that match specified locator. More... | |
virtual List< T > | GetOptional< T > (object locator) |
Gets all component references that match specified locator and matching to the specified type. More... | |
virtual List< object > | GetRequired (object locator) |
Gets all component references that match specified locator. At least one component reference must be present. More... | |
virtual List< T > | GetRequired< T > (object locator) |
Gets all component references that match specified locator. At least one component reference must be present and matching to the specified type. More... | |
virtual List< object > | Find (object locator, bool required) |
Gets all component references that match specified locator. More... | |
virtual List< T > | Find< T > (object locator, bool required) |
Gets all component references that match specified locator and matching to the specified type. More... | |
void | Clear () |
Clears this instance. More... | |
Static Public Member Functions | |
static References | FromTuples (params object[] tuples) |
Protected Attributes | |
readonly List< Reference > | _references = new List<Reference>() |
readonly object | _lock = new object() |
The most basic implementation of IReferences to store and locate component references.
See IReferences
PipServices3.Commons.Refer.References.References | ( | object [] | tuples | ) |
Creates a new instance of references and initializes it with references.
tuples | (optional) a list of values where odd elements are locators and the following even elements are component references |
void PipServices3.Commons.Refer.References.Clear | ( | ) |
Clears this instance.
|
virtual |
Gets all component references that match specified locator.
locator | the locator to find a reference by. |
required | forces to raise exception is no reference is found |
Implements PipServices3.Commons.Refer.IReferences.
|
virtual |
Gets all component references that match specified locator and matching to the specified type.
T | the class type |
locator | the locator to find a reference by. |
required | forces to raise exception is no reference is found |
Implements PipServices3.Commons.Refer.IReferences.
|
virtual |
Gets all component references registered in this reference map.
Implements PipServices3.Commons.Refer.IReferences.
|
virtual |
Gets locators for all registered component references in this reference map.
Implements PipServices3.Commons.Refer.IReferences.
|
virtual |
Gets an optional component reference that matches specified locator.
locator | a locator to find a reference |
Implements PipServices3.Commons.Refer.IReferences.
|
virtual |
Gets an optional component reference that matches specified locator and matching to the specified type.
T | the class type |
locator | a locator to find a reference |
Implements PipServices3.Commons.Refer.IReferences.
|
virtual |
Gets a required component reference that matches specified locator.
locator | a locator to find a reference |
Implements PipServices3.Commons.Refer.IReferences.
|
virtual |
Gets a required component reference that matches specified locator and matching to the specified type.
T | the class type |
locator | a locator to find a reference |
Implements PipServices3.Commons.Refer.IReferences.
|
virtual |
Gets all component references that match specified locator.
locator | a locator to find references by |
Implements PipServices3.Commons.Refer.IReferences.
|
virtual |
Gets all component references that match specified locator and matching to the specified type.
T | the class type |
locator | the locator to find references by. |
Implements PipServices3.Commons.Refer.IReferences.
|
virtual |
Gets all component references that match specified locator. At least one component reference must be present.
locator | a locator to find references |
Implements PipServices3.Commons.Refer.IReferences.
|
virtual |
Gets all component references that match specified locator. At least one component reference must be present and matching to the specified type.
T | the class type |
locator | a locator to find references |
Implements PipServices3.Commons.Refer.IReferences.
|
virtual |
Puts a new reference into this reference map.
locator | a locator to find the reference by. |
component | a component reference to be added. |
Implements PipServices3.Commons.Refer.IReferences.
|
virtual |
Removes a previously added reference that matches specified locator. If many references match the locator, it removes only the first one.When all references shall be removed, use removeAll() method instead.
locator | a locator to remove reference |
Implements PipServices3.Commons.Refer.IReferences.
|
virtual |
Removes all component references that match the specified locator.
locator | the locator to remove references by. |
Implements PipServices3.Commons.Refer.IReferences.