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

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

#include <registry.h>

Public Types

typedef std::function< std::unique_ptr< ObjectType >Args ...)> Creator
 

Public Member Functions

void Register (const SrcType &key, Creator creator)
 
void Register (const SrcType &key, Creator creator, const string &help_msg)
 
bool Has (const SrcType &key)
 
unique_ptr< ObjectType > Create (const SrcType &key, Args ... args)
 
vector< SrcType > Keys ()
 Returns the keys currently registered as a vector.
 
const CaffeMap< SrcType, string > & HelpMessage () const
 
const char * HelpMessage (const SrcType &key) const
 

Detailed Description

template<class SrcType, class ObjectType, class... Args>
class caffe2::Registry< SrcType, ObjectType, Args >

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

The keys are usually a 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 31 of file registry.h.


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