|
CIRCT 22.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) | |
| ~Context () | |
| void | disconnectAll () |
| Disconnect from all accelerators associated with this context. | |
| std::optional< const Type * > | getType (Type::ID id) const |
| Resolve a type id to the type. | |
| void | registerType (Type *type) |
| Register a type with the context. Takes ownership of the pointer type. | |
| AcceleratorConnection * | connect (std::string backend, std::string connection) |
| Connect to an accelerator backend. | |
| void | setLogger (std::unique_ptr< Logger > logger) |
| Register a logger with the accelerator. Assumes ownership of the logger. | |
| Logger & | getLogger () |
Static Public Member Functions | |
| template<typename T , typename... Args> | |
| static std::unique_ptr< Context > | withLogger (Args &&...args) |
| Create a context with a specific logger type. | |
Private Types | |
| using | TypeCache = std::map< Type::ID, std::unique_ptr< Type > > |
Private Attributes | |
| std::unique_ptr< Logger > | logger |
| std::vector< std::unique_ptr< AcceleratorConnection > > | connections |
| TypeCache | types |
AcceleratorConnections, Accelerators, and Manifests must all share a context.
It owns all the types, uniquifying them. It also owns the connections (which own the Accelerators). When it is destroyed, all connections are disconnected and the objects are destroyed.
|
private |
| Context::Context | ( | ) |
Definition at line 22 of file Context.cpp.
| Context::Context | ( | std::unique_ptr< Logger > | logger | ) |
Definition at line 24 of file Context.cpp.
| Context::~Context | ( | ) |
Definition at line 25 of file Context.cpp.
References disconnectAll().
| AcceleratorConnection * Context::connect | ( | std::string | backend, |
| std::string | connection | ||
| ) |
Connect to an accelerator backend.
Retains ownership internally and returns a non-owning pointer.
Definition at line 314 of file Accelerator.cpp.
References connections, esi::Logger::error(), esi::registry::internal::BackendRegistry::get(), getLogger(), esi::Logger::info(), and esi::loadBackend().
| void Context::disconnectAll | ( | ) |
Disconnect from all accelerators associated with this context.
Definition at line 27 of file Context.cpp.
References connections.
Referenced by ~Context().
|
inline |
Definition at line 69 of file Context.h.
References logger.
Referenced by connect(), esi::AcceleratorConnection::getLogger(), esi::loadBackend(), and main().
| void Context::registerType | ( | Type * | type | ) |
Register a type with the context. Takes ownership of the pointer type.
Definition at line 33 of file Context.cpp.
References esi::Type::getID(), esi::Type::toString(), and types.
|
inline |
Register a logger with the accelerator. Assumes ownership of the logger.
Definition at line 64 of file Context.h.
References logger.
Referenced by PYBIND11_MODULE().
|
inlinestatic |
|
private |
Definition at line 73 of file Context.h.
Referenced by connect(), and disconnectAll().
|
private |
Definition at line 72 of file Context.h.
Referenced by getLogger(), and setLogger().
|
private |
Definition at line 77 of file Context.h.
Referenced by getType(), and registerType().