10 #ifndef RAJA_Registry_HPP
11 #define RAJA_Registry_HPP
23 std::string Name, Desc;
24 std::shared_ptr<T> object;
29 std::shared_ptr<T> (*C)())
37 const std::string&
getDesc()
const {
return Desc; }
39 T*
get()
const {
return object.get(); }
59 static node *Head, *Tail;
122 static std::shared_ptr<T> CtorFn() {
return std::make_shared<V>(); }
125 add(
const std::string&
Name,
const std::string& Desc)
126 : Entry(
Name, Desc, CtorFn),
137 #define RAJA_INSTANTIATE_REGISTRY(REGISTRY_CLASS) \
142 template<typename T> \
143 typename Registry<T>::node* Registry<T>::Head = nullptr; \
144 template<typename T> \
145 typename Registry<T>::node* Registry<T>::Tail = nullptr; \
146 template<typename T> \
147 void Registry<T>::add_node(typename Registry<T>::node* N) \
155 template<typename T> \
156 typename Registry<T>::iterator Registry<T>::begin() \
158 return iterator(Head); \
160 template REGISTRY_CLASS::node* Registry<REGISTRY_CLASS::type>::Head; \
161 template REGISTRY_CLASS::node* Registry<REGISTRY_CLASS::type>::Tail; \
162 template void Registry<REGISTRY_CLASS::type>::add_node( \
163 REGISTRY_CLASS::node*); \
164 template REGISTRY_CLASS::iterator Registry<REGISTRY_CLASS::type>::begin(); \
Definition: Registry.hpp:22
T * get() const
Definition: Registry.hpp:39
const std::string & getName() const
Definition: Registry.hpp:35
RegistryEntry(const std::string &N, const std::string &D, std::shared_ptr< T >(*C)())
Definition: Registry.hpp:27
const std::string & getDesc() const
Definition: Registry.hpp:37
A static registration template.
Definition: Registry.hpp:118
add(const std::string &Name, const std::string &Desc)
Definition: Registry.hpp:125
Definition: Registry.hpp:88
const entry & operator*() const
Definition: Registry.hpp:104
bool operator!=(const iterator &That) const
Definition: Registry.hpp:96
iterator(const node *N)
Definition: Registry.hpp:92
const entry * operator->() const
Definition: Registry.hpp:106
bool operator==(const iterator &That) const
Definition: Registry.hpp:94
iterator & operator++()
Definition: Registry.hpp:98
Definition: Registry.hpp:65
node(const entry &V)
Definition: Registry.hpp:73
Definition: Registry.hpp:47
T type
Definition: Registry.hpp:49
static RAJASHAREDDLL_API iterator begin()
static RAJASHAREDDLL_API void add_node(node *N)
static iterator end()
Definition: Registry.hpp:113
Definition: AlignedRangeIndexSetBuilders.cpp:35
auto Name(const char *n)
Definition: kernel_name.hpp:31