Caffe2 - C++ API
A deep learning, cross platform ML framework
Public Types | Public Member Functions
c10::Registry< SrcType, ObjectPtrType, Args > Class Template Reference

A template class that allows one to register classes by keys. More...

#include <Registry.h>

Public Types

typedef std::function< ObjectPtrType(Args...)> Creator
 

Public Member Functions

void Register (const SrcType &key, Creator creator, const RegistryPriority priority=REGISTRY_DEFAULT)
 
void Register (const SrcType &key, Creator creator, const std::string &help_msg, const RegistryPriority priority=REGISTRY_DEFAULT)
 
bool Has (const SrcType &key)
 
ObjectPtrType Create (const SrcType &key, Args...args)
 
std::vector< SrcType > Keys () const
 Returns the keys currently registered as a std::vector.
 
const std::unordered_map< SrcType, std::string > & HelpMessage () const
 
const char * HelpMessage (const SrcType &key) const
 
void SetTerminate (bool terminate)
 

Detailed Description

template<class SrcType, class ObjectPtrType, class... Args>
class c10::Registry< SrcType, ObjectPtrType, Args >

A template class that allows one to register classes by keys.

The keys are usually a std::string specifying the name, but can be anything that can be used in a std::map.

You should most likely not use the Registry class explicitly, but use the helper macros below to declare specific registries as well as registering objects.

Definition at line 54 of file Registry.h.


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