CIRCT  20.0.0git
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
Manifest::Impl Class Reference
Collaboration diagram for Manifest::Impl:
Collaboration graph
[legend]

Public Member Functions

 Impl (Context &ctxt, const std::string &jsonManifest)
 
auto at (const std::string &key) const
 
std::optional< ModuleInfogetModInfo (const nlohmann::json &) const
 
void scanServiceDecls (AcceleratorConnection &, const nlohmann::json &, ServiceTable &) const
 Go through the "service_decls" section of the manifest and populate the services table as appropriate. More...
 
services::Service * getService (AppIDPath idPath, AcceleratorConnection &, const nlohmann::json &, ServiceTable &activeServices) const
 Get a Service for the service specified in 'json'. More...
 
std::vector< services::Service * > getServices (AppIDPath idPath, AcceleratorConnection &, const nlohmann::json &, ServiceTable &activeServices) const
 Get all the services in the description of an instance. More...
 
std::vector< std::unique_ptr< BundlePort > > getBundlePorts (AcceleratorConnection &acc, AppIDPath idPath, const ServiceTable &activeServices, const nlohmann::json &instJson) const
 Get the bundle ports for the instance at 'idPath' and specified in 'instJson'. More...
 
std::vector< std::unique_ptr< Instance > > getChildInstances (AppIDPath idPath, AcceleratorConnection &acc, const ServiceTable &activeServices, const nlohmann::json &instJson) const
 Build the set of child instances (recursively) for the module instance description. More...
 
std::unique_ptr< Instance > getChildInstance (AppIDPath idPath, AcceleratorConnection &acc, ServiceTable activeServices, const nlohmann::json &childJson) const
 Get a single child instance. More...
 
void populateTypes (const nlohmann::json &typesJson)
 Parse all the types and populate the types table. More...
 
const std::vector< const Type * > & getTypeTable () const
 Get the ordered list of types from the manifest. More...
 
std::unique_ptr< Accelerator > buildAccelerator (AcceleratorConnection &acc) const
 Build a dynamic API for the Accelerator connection 'acc' based on the manifest stored herein. More...
 
const Type * parseType (const nlohmann::json &typeJson)
 
const std::map< std::string, const ModuleInfo > & getSymbolInfo () const
 

Private Member Functions

std::optional< const Type * > getType (Type::ID id) const
 
std::any getAny (const nlohmann::json &value) const
 Convert the json value to a 'std::any', which can be exposed outside of this file. More...
 
void parseModuleMetadata (ModuleInfo &info, const nlohmann::json &mod) const
 
void parseModuleConsts (ModuleInfo &info, const nlohmann::json &mod) const
 

Private Attributes

Context & ctxt
 
std::vector< const Type * > _typeTable
 
nlohmann::json manifestJson
 
std::map< std::string, const ModuleInfosymbolInfoCache
 

Friends

class ::esi::Manifest
 

Detailed Description

Definition at line 31 of file Manifest.cpp.

Constructor & Destructor Documentation

◆ Impl()

Manifest::Impl::Impl ( Context &  ctxt,
const std::string &  jsonManifest 
)

Member Function Documentation

◆ at()

auto Manifest::Impl::at ( const std::string &  key) const
inline

Definition at line 37 of file Manifest.cpp.

References manifestJson.

◆ buildAccelerator()

std::unique_ptr< Accelerator > Manifest::Impl::buildAccelerator ( AcceleratorConnection &  acc) const

Build a dynamic API for the Accelerator connection 'acc' based on the manifest stored herein.

Definition at line 273 of file Manifest.cpp.

◆ getAny()

std::any Manifest::Impl::getAny ( const nlohmann::json &  value) const
private

Convert the json value to a 'std::any', which can be exposed outside of this file.

Definition at line 150 of file Manifest.cpp.

References getType(), and parseID().

◆ getBundlePorts()

std::vector< std::unique_ptr< BundlePort > > Manifest::Impl::getBundlePorts ( AcceleratorConnection &  acc,
AppIDPath  idPath,
const ServiceTable activeServices,
const nlohmann::json &  instJson 
) const

Get the bundle ports for the instance at 'idPath' and specified in 'instJson'.

Look them up in 'activeServies'.

Definition at line 439 of file Manifest.cpp.

References parseIDChecked(), and parseServicePort().

◆ getChildInstance()

std::unique_ptr< Instance > Manifest::Impl::getChildInstance ( AppIDPath  idPath,
AcceleratorConnection &  acc,
ServiceTable  activeServices,
const nlohmann::json &  childJson 
) const

Get a single child instance.

Implicitly copy the active services table so that it can be safely updated for the child's branch of the tree.

Definition at line 339 of file Manifest.cpp.

References parseIDChecked().

◆ getChildInstances()

std::vector< std::unique_ptr< Instance > > Manifest::Impl::getChildInstances ( AppIDPath  idPath,
AcceleratorConnection &  acc,
const ServiceTable activeServices,
const nlohmann::json &  instJson 
) const

Build the set of child instances (recursively) for the module instance description.

Definition at line 326 of file Manifest.cpp.

◆ getModInfo()

std::optional< ModuleInfo > Manifest::Impl::getModInfo ( const nlohmann::json &  json) const

Definition at line 294 of file Manifest.cpp.

◆ getService()

services::Service * Manifest::Impl::getService ( AppIDPath  idPath,
AcceleratorConnection &  acc,
const nlohmann::json &  svcJson,
ServiceTable activeServices 
) const

Get a Service for the service specified in 'json'.

Update the activeServices table.

Definition at line 356 of file Manifest.cpp.

References parseIDChecked(), parseIDPath(), and parseServicePort().

◆ getServices()

std::vector< services::Service * > Manifest::Impl::getServices ( AppIDPath  idPath,
AcceleratorConnection &  acc,
const nlohmann::json &  svcsJson,
ServiceTable activeServices 
) const

Get all the services in the description of an instance.

Update the active services table.

Definition at line 425 of file Manifest.cpp.

◆ getSymbolInfo()

const std::map<std::string, const ModuleInfo>& Manifest::Impl::getSymbolInfo ( ) const
inline

Definition at line 93 of file Manifest.cpp.

References symbolInfoCache.

◆ getType()

std::optional<const Type *> Manifest::Impl::getType ( Type::ID  id) const
inlineprivate

Definition at line 101 of file Manifest.cpp.

References ctxt.

Referenced by getAny().

◆ getTypeTable()

const std::vector<const Type *>& Manifest::Impl::getTypeTable ( ) const
inline

Get the ordered list of types from the manifest.

Definition at line 84 of file Manifest.cpp.

References _typeTable.

◆ parseModuleConsts()

void Manifest::Impl::parseModuleConsts ( ModuleInfo info,
const nlohmann::json &  mod 
) const
private

Definition at line 230 of file Manifest.cpp.

Referenced by Impl().

◆ parseModuleMetadata()

void Manifest::Impl::parseModuleMetadata ( ModuleInfo info,
const nlohmann::json &  mod 
) const
private

Definition at line 209 of file Manifest.cpp.

Referenced by Impl().

◆ parseType()

const Type * Manifest::Impl::parseType ( const nlohmann::json &  typeJson)

Definition at line 594 of file Manifest.cpp.

References esiaccel.accelerator::ctxt, and parseType().

◆ populateTypes()

void Manifest::Impl::populateTypes ( const nlohmann::json &  typesJson)

Parse all the types and populate the types table.

Definition at line 598 of file Manifest.cpp.

References parseType().

Referenced by Impl().

◆ scanServiceDecls()

void Manifest::Impl::scanServiceDecls ( AcceleratorConnection &  acc,
const nlohmann::json &  svcDecls,
ServiceTable activeServices 
) const

Go through the "service_decls" section of the manifest and populate the services table as appropriate.

Definition at line 304 of file Manifest.cpp.

Friends And Related Function Documentation

◆ ::esi::Manifest

friend class ::esi::Manifest
friend

Definition at line 32 of file Manifest.cpp.

Member Data Documentation

◆ _typeTable

std::vector<const Type *> Manifest::Impl::_typeTable
private

Definition at line 99 of file Manifest.cpp.

Referenced by getTypeTable().

◆ ctxt

Context& Manifest::Impl::ctxt
private

Definition at line 98 of file Manifest.cpp.

Referenced by getType().

◆ manifestJson

nlohmann::json Manifest::Impl::manifestJson
private

Definition at line 110 of file Manifest.cpp.

Referenced by at(), and Impl().

◆ symbolInfoCache

std::map<std::string, const ModuleInfo> Manifest::Impl::symbolInfoCache
private

Definition at line 112 of file Manifest.cpp.

Referenced by getSymbolInfo(), and Impl().


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