CIRCT
20.0.0git
|
Class which "dispatches" a service implementation request to its specified generator. More...
#include <ESIServices.h>
Public Types | |
using | ServiceGeneratorFunc = std::function< LogicalResult(ServiceImplementReqOp, ServiceDeclOpInterface, ServiceImplRecordOp)> |
Public Member Functions | |
ServiceGeneratorDispatcher (DenseMap< StringRef, ServiceGeneratorFunc > genLookupTable, bool failIfNotFound) | |
ServiceGeneratorDispatcher (const ServiceGeneratorDispatcher &that)=default | |
LogicalResult | generate (ServiceImplementReqOp, ServiceDeclOpInterface) |
Generate a service implementation if a generator exists in this registry. More... | |
void | registerGenerator (StringRef implType, ServiceGeneratorFunc gen) |
Add a generator to this registry. More... | |
Static Public Member Functions | |
static ServiceGeneratorDispatcher & | globalDispatcher () |
Get the global dispatcher. More... | |
Private Attributes | |
DenseMap< StringRef, ServiceGeneratorFunc > | genLookupTable |
bool | failIfNotFound |
Class which "dispatches" a service implementation request to its specified generator.
Also serves as a registery for generators.
Definition at line 24 of file ESIServices.h.
using circt::esi::ServiceGeneratorDispatcher::ServiceGeneratorFunc = std::function<LogicalResult( ServiceImplementReqOp, ServiceDeclOpInterface, ServiceImplRecordOp)> |
Definition at line 27 of file ESIServices.h.
|
inline |
Definition at line 34 of file ESIServices.h.
|
default |
LogicalResult ServiceGeneratorDispatcher::generate | ( | ServiceImplementReqOp | req, |
ServiceDeclOpInterface | decl | ||
) |
Generate a service implementation if a generator exists in this registry.
If one is not found, return failure if the failIfNotFound
flag is set.
Definition at line 287 of file ESIServices.cpp.
References failIfNotFound, and genLookupTable.
|
static |
Get the global dispatcher.
Definition at line 316 of file ESIServices.cpp.
References globalDispatcher.
Referenced by circtESIRegisterGlobalServiceGenerator().
void ServiceGeneratorDispatcher::registerGenerator | ( | StringRef | implType, |
ServiceGeneratorFunc | gen | ||
) |
Add a generator to this registry.
Definition at line 320 of file ESIServices.cpp.
References genLookupTable.
Referenced by circtESIRegisterGlobalServiceGenerator().
|
private |
Definition at line 53 of file ESIServices.h.
Referenced by generate().
|
private |
Definition at line 52 of file ESIServices.h.
Referenced by generate(), and registerGenerator().