libcosim 0.9.0
C++ library for distributed co-simulation
Public Member Functions | List of all members
cosim::model_uri_sub_resolver Class Referenceabstract

An interface for classes that resolve model URIs of one or more specific URI schemes. More...

#include <cosim/orchestration.hpp>

Inheritance diagram for cosim::model_uri_sub_resolver:
cosim::fmu_file_uri_sub_resolver

Public Member Functions

virtual std::shared_ptr< modellookup_model (const uri &baseUri, const uri &modelUriReference)
 Tries to resolve a model URI relative to some base URI. More...
 
virtual std::shared_ptr< modellookup_model (const uri &modelUri)=0
 Tries to resolve a model URI. More...
 

Detailed Description

An interface for classes that resolve model URIs of one or more specific URI schemes.

Examples could be a file URI resolver which handles URIs like file:///models/my_model.fmu or an FMU-proxy URI resolver which handles URIs like fmu-proxy://sim.example.com:6345.

Client code will normally not use this directly to resolve URIs, but rather as one of many sub-resolvers in a model_uri_resolver.

Member Function Documentation

◆ lookup_model() [1/2]

virtual std::shared_ptr< model > cosim::model_uri_sub_resolver::lookup_model ( const uri baseUri,
const uri modelUriReference 
)
virtual

Tries to resolve a model URI relative to some base URI.

Returns a model object for the model referred to by the resulting URI, or null if this resolver is not designed to handle such URIs. May also throw an exception if the URI would normally be handled, but the address resolution failed (e.g. due to I/O error).

Note
The default implementation of this function resolves modelUriReference relative to baseUri in an RFC 3986 compliant manner using cosim::resolve_uri_reference() and forwards to lookup_model(const uri&). Specific sub-resolvers may override it to use non-standard resolution mechanisms.
Parameters
[in]baseUriAn (absolute) base URI.
[in]modelUriReferenceA model URI reference that will be resolved relative to baseUri.

◆ lookup_model() [2/2]

virtual std::shared_ptr< model > cosim::model_uri_sub_resolver::lookup_model ( const uri modelUri)
pure virtual

Tries to resolve a model URI.

Returns a model object for the model referred to by modelUri, or null if this resolver is not designed to handle such URIs. May also throw an exception if the URI would normally be handled, but the address resolution failed (e.g. due to I/O error).

Parameters
[in]modelUriAn (absolute) model URI.

Implemented in cosim::fmu_file_uri_sub_resolver.


The documentation for this class was generated from the following file: