ONE - On-device Neural Engine
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
loco::AnnotatedItem< Annotation > Class Template Reference

#include <AnnotatedItem.h>

Public Member Functions

 AnnotatedItem ()=default
 
virtual ~AnnotatedItem ()=default
 
template<typename T >
const T * annot (void) const
 Retrieve a stored annotation of type T.
 
template<typename T >
void annot (std::unique_ptr< T > &&p)
 Attach or remove a new annotation of type T.
 

Detailed Description

template<typename Annotation>
class loco::AnnotatedItem< Annotation >

Definition at line 27 of file AnnotatedItem.h.

Constructor & Destructor Documentation

◆ AnnotatedItem()

template<typename Annotation >
loco::AnnotatedItem< Annotation >::AnnotatedItem ( )
default

◆ ~AnnotatedItem()

template<typename Annotation >
virtual loco::AnnotatedItem< Annotation >::~AnnotatedItem ( )
virtualdefault

Member Function Documentation

◆ annot() [1/2]

template<typename Annotation >
template<typename T >
void loco::AnnotatedItem< Annotation >::annot ( std::unique_ptr< T > &&  p)
inline

Attach or remove a new annotation of type T.

Note
annot<T>(nullptr) removes an attached annotation if it exists

Definition at line 61 of file AnnotatedItem.h.

62 {
63 // TODO: Insert static_assert(T derives Annotation);
64
65 if (p == nullptr)
66 {
67 _attrs.erase(typeid(T));
68 }
69 else
70 {
71 // TODO: assert(_attribs.find(typeid(T)) == _attribs.end());
72 _attrs[typeid(T)] = std::move(p);
73 }
74 }
Configuration p

References p.

◆ annot() [2/2]

template<typename Annotation >
template<typename T >
const T * loco::AnnotatedItem< Annotation >::annot ( void  ) const
inline

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