CIRCT
20.0.0git
|
AcceleratorConnections, Accelerators, and Manifests must all share a context. More...
#include <Context.h>
Public Member Functions | |
Context () | |
Context (std::unique_ptr< Logger > logger) | |
std::optional< const Type * > | getType (Type::ID id) const |
Resolve a type id to the type. More... | |
void | registerType (Type *type) |
Register a type with the context. Takes ownership of the pointer type. More... | |
std::unique_ptr< AcceleratorConnection > | connect (std::string backend, std::string connection) |
Connect to an accelerator backend. More... | |
void | setLogger (std::unique_ptr< Logger > logger) |
Register a logger with the accelerator. Assumes ownership of the logger. More... | |
Logger & | getLogger () |
Static Public Member Functions | |
template<typename T , typename... Args> | |
static Context | withLogger (Args &&...args) |
Create a context with a specific logger type. More... | |
Private Types | |
using | TypeCache = std::map< Type::ID, std::unique_ptr< Type > > |
Private Attributes | |
std::unique_ptr< Logger > | logger |
TypeCache | types |
AcceleratorConnections, Accelerators, and Manifests must all share a context.
It owns all the types, uniquifying them.
|
private |
|
inline |
Definition at line 33 of file Context.h.
Referenced by withLogger().
|
inline |
std::unique_ptr< AcceleratorConnection > Context::connect | ( | std::string | backend, |
std::string | connection | ||
) |
Connect to an accelerator backend.
Definition at line 27 of file Context.cpp.
References esi::registry::connect().
Referenced by PYBIND11_MODULE().
|
inline |
Definition at line 62 of file Context.h.
References logger.
Referenced by esi::AcceleratorConnection::getLogger().
void Context::registerType | ( | Type * | type | ) |
Register a type with the context. Takes ownership of the pointer type.
Definition at line 20 of file Context.cpp.
References esi::Type::getID(), and types.
|
inline |
|
inlinestatic |
|
private |
Definition at line 65 of file Context.h.
Referenced by getLogger(), and setLogger().
|
private |
Definition at line 69 of file Context.h.
Referenced by getType(), and registerType().