Interface IEngine
Front-end of the relation engine
Namespace: Xareus.Relations
Assembly: Xareus.Relations.dll
Syntax
public interface IEngine
Properties
RegisteredObjects
Get all the objects that have been registered
Declaration
IEnumerable<IObject> RegisteredObjects { get; }
Property Value
Type | Description |
---|---|
IEnumerable<IObject> |
RegisteredRelations
Get all the relations that have been registered
Declaration
IEnumerable<IRelation> RegisteredRelations { get; }
Property Value
Type | Description |
---|---|
IEnumerable<IRelation> |
Methods
AddObject(IObject)
Registers an object with the relation engine.
Declaration
void AddObject(IObject @object)
Parameters
Type | Name | Description |
---|---|---|
IObject | object |
AddRelation(IRelation)
Registers a relation with the relation engine.
Declaration
void AddRelation(IRelation relation)
Parameters
Type | Name | Description |
---|---|---|
IRelation | relation | The relation |
GetObject(string)
Get the object with the given name
Declaration
IObject GetObject(string objectName)
Parameters
Type | Name | Description |
---|---|---|
string | objectName | The name of the object to get |
Returns
Type | Description |
---|---|
IObject | null if the object was not found |
GetObjects(ObjectQueryParameters, bool)
Get all the objects validating the constraints specified in the query parameters
Declaration
IEnumerable<IObject> GetObjects(ObjectQueryParameters queryParameters, bool checkRegistered = true)
Parameters
Type | Name | Description |
---|---|---|
ObjectQueryParameters | queryParameters | The query parameters |
bool | checkRegistered | Checks if all objects and relations are registered before processing the query. |
Returns
Type | Description |
---|---|
IEnumerable<IObject> | The objects validating the type constraints specified in the query parameters. Returns all registered objects if the parameter query is null |
GetRealizations()
Get every possible realization
Declaration
IEnumerable<Realization> GetRealizations()
Returns
Type | Description |
---|---|
IEnumerable<Realization> | All possible realization using every registered relation and object |
GetRealizations(RealizationQueryParameters, bool)
Get all the realizations validating the constraints given in the query parameters
Declaration
IEnumerable<Realization> GetRealizations(RealizationQueryParameters queryParameters, bool checkRegistered = true)
Parameters
Type | Name | Description |
---|---|---|
RealizationQueryParameters | queryParameters | The query parameters |
bool | checkRegistered | Checks if all objects and relations are registered before processing the query. |
Returns
Type | Description |
---|---|
IEnumerable<Realization> | The realizations validating the constraints specified in the query parameters. |
GetRelation(string)
Get the relation with the given name
Declaration
IRelation GetRelation(string relationName)
Parameters
Type | Name | Description |
---|---|---|
string | relationName | The name of the relation to get |
Returns
Type | Description |
---|---|
IRelation | null if the relation was not found |
HasObject(string)
Checks if the engine has an object with the given name
Declaration
bool HasObject(string objectName)
Parameters
Type | Name | Description |
---|---|---|
string | objectName | The name of the object to check |
Returns
Type | Description |
---|---|
bool | false if the object was not found |
HasRelation(string)
Checks if the engine has a relation with the given name
Declaration
bool HasRelation(string relationName)
Parameters
Type | Name | Description |
---|---|---|
string | relationName | The name of the relation to check |
Returns
Type | Description |
---|---|
bool | false if the relation was not found |
RemoveObject(IObject)
Unregisters an object with the relation engine.
Declaration
void RemoveObject(IObject @object)
Parameters
Type | Name | Description |
---|---|---|
IObject | object |
RemoveRelation(IRelation)
Unregisters a relation with the relation engine.
Declaration
void RemoveRelation(IRelation relation)
Parameters
Type | Name | Description |
---|---|---|
IRelation | relation | The relation |