CollMgr< Collection, Type, allow_duplicates > Class Template Reference
|
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
|
Loading...
Searching...
No Matches
amr_wind::CollMgr< Collection, Type, allow_duplicates > Class Template Reference
#include <CollMgr.H>
Inheritance diagram for amr_wind::CollMgr< Collection, Type, allow_duplicates >:
Collaboration diagram for amr_wind::CollMgr< Collection, Type, allow_duplicates >:
Public Types | |
| using | TypePtr = std::unique_ptr<Type> |
| using | TypeVector = amrex::Vector<TypePtr> |
Public Member Functions | |
| CollMgr ()=default | |
| ~CollMgr ()=default | |
| CollMgr (const CollMgr &)=delete | |
| CollMgr & | operator= (const CollMgr &)=delete |
| template<class... Args> | |
| Type & | create (const std::string &key, Args &&... args) |
| TypeVector & | objects () |
| Return a vector of the registered objects. | |
| const TypeVector & | objects () const |
| bool | contains (const std::string &key) const |
| Query if an object exists using the lookup key. | |
| Type & | operator() (const std::string &key) |
| Return the object corresponding to a lookup key. | |
| const Type & | operator() (const std::string &key) const |
| template<typename T> | |
| T & | operator() (const std::string &key) |
| Return object for a lookup key cast into its exact class definition. | |
Protected Attributes | |
| TypeVector | m_obj_vec |
| Collection of objects registered so far. | |
| std::unordered_map< std::string, int > | m_obj_map |
| Key word based lookup. | |
Detailed Description
template<typename Collection, typename Type, bool allow_duplicates = false>
class amr_wind::CollMgr< Collection, Type, allow_duplicates >
class amr_wind::CollMgr< Collection, Type, allow_duplicates >
Interface to manage objects of sub-classes based on factory registration
Provides boiler-plate code to register a collection and then query using lookup keywords
- Template Parameters
-
Collection Class holding instances of collection (e.g., PhysicsMgr) Base class of the collection (e.g., Physics)
Member Typedef Documentation
◆ TypePtr
template<typename Collection, typename Type, bool allow_duplicates = false>
| using amr_wind::CollMgr< Collection, Type, allow_duplicates >::TypePtr = std::unique_ptr<Type> |
◆ TypeVector
template<typename Collection, typename Type, bool allow_duplicates = false>
| using amr_wind::CollMgr< Collection, Type, allow_duplicates >::TypeVector = amrex::Vector<TypePtr> |
Constructor & Destructor Documentation
◆ CollMgr() [1/2]
template<typename Collection, typename Type, bool allow_duplicates = false>
|
default |
◆ ~CollMgr()
template<typename Collection, typename Type, bool allow_duplicates = false>
|
default |
◆ CollMgr() [2/2]
template<typename Collection, typename Type, bool allow_duplicates = false>
|
delete |
Member Function Documentation
◆ contains()
template<typename Collection, typename Type, bool allow_duplicates = false>
|
inline |
Query if an object exists using the lookup key.
◆ create()
template<typename Collection, typename Type, bool allow_duplicates = false>
template<class... Args>
|
inline |
Create a new object and register it in the vector and setup lookup options
◆ objects() [1/2]
template<typename Collection, typename Type, bool allow_duplicates = false>
|
inline |
Return a vector of the registered objects.
◆ objects() [2/2]
template<typename Collection, typename Type, bool allow_duplicates = false>
|
inline |
◆ operator()() [1/3]
template<typename Collection, typename Type, bool allow_duplicates = false>
|
inline |
Return the object corresponding to a lookup key.
◆ operator()() [2/3]
template<typename Collection, typename Type, bool allow_duplicates = false>
template<typename T>
|
inline |
Return object for a lookup key cast into its exact class definition.
◆ operator()() [3/3]
template<typename Collection, typename Type, bool allow_duplicates = false>
|
inline |
◆ operator=()
template<typename Collection, typename Type, bool allow_duplicates = false>
|
delete |
Member Data Documentation
◆ m_obj_map
template<typename Collection, typename Type, bool allow_duplicates = false>
|
protected |
Key word based lookup.
◆ m_obj_vec
template<typename Collection, typename Type, bool allow_duplicates = false>
|
protected |
Collection of objects registered so far.
The documentation for this class was generated from the following file:
- /home/runner/work/amr-wind/amr-wind/amr-wind/core/CollMgr.H
Generated by