CIRCT  19.0.0git
Public Member Functions | Private Types | Private Attributes | List of all members
esi::Context Class Reference

AcceleratorConnections, Accelerators, and Manifests must all share a context. More...

#include <Context.h>

Collaboration diagram for esi::Context:
Collaboration graph
[legend]

Public Member Functions

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. More...
 
std::unique_ptr< AcceleratorConnectionconnect (std::string backend, std::string connection)
 Connect to an accelerator backend. More...
 

Private Types

using TypeCache = std::map< Type::ID, std::unique_ptr< Type > >
 

Private Attributes

TypeCache types
 

Detailed Description

AcceleratorConnections, Accelerators, and Manifests must all share a context.

It owns all the types, uniquifying them.

Definition at line 30 of file Context.h.

Member Typedef Documentation

◆ TypeCache

using esi::Context::TypeCache = std::map<Type::ID, std::unique_ptr<Type> >
private

Definition at line 49 of file Context.h.

Member Function Documentation

◆ connect()

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().

◆ getType()

std::optional<const Type *> esi::Context::getType ( Type::ID  id) const
inline

Resolve a type id to the type.

Definition at line 34 of file Context.h.

References types.

◆ registerType()

void Context::registerType ( Type type)

Register a type with the context.

Takes ownership of the type and returns the pointer which users should use.

Definition at line 20 of file Context.cpp.

References esi::Type::getID(), and types.

Member Data Documentation

◆ types

TypeCache esi::Context::types
private

Definition at line 50 of file Context.h.

Referenced by getType(), and registerType().


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