ONE - On-device Neural Engine
Loading...
Searching...
No Matches
loco::Dialect Class Reference

Dialect interface. More...

#include <Dialect.h>

Public Member Functions

virtual ~Dialect ()=default
 
template<typename ConcreteService >
ConcreteService * service (void) const
 

Protected Member Functions

template<typename ConcreteService >
void service (std::unique_ptr< ConcreteService > &&s)
 

Detailed Description

Dialect interface.

Each dialect implementation is expected to have static "get" method which returns "const Dialect *" value.

Definition at line 36 of file Dialect.h.

Constructor & Destructor Documentation

◆ ~Dialect()

virtual loco::Dialect::~Dialect ( )
virtualdefault

Member Function Documentation

◆ service() [1/2]

template<typename ConcreteService >
void loco::Dialect::service ( std::unique_ptr< ConcreteService > &&  s)
inlineprotected

Definition at line 42 of file Dialect.h.

43 {
44 _services[typeid(ConcreteService)] = std::move(s);
45 }

◆ service() [2/2]

template<typename ConcreteService >
ConcreteService * loco::Dialect::service ( void  ) const
inline

Definition at line 48 of file Dialect.h.

49 {
50 auto it = _services.find(typeid(ConcreteService));
51
52 if (it == _services.end())
53 {
54 return nullptr;
55 }
56
57 return dynamic_cast<ConcreteService *>(it->second.get());
58 }

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