added support for morm containers with pointers to models

This commit is contained in:
Tomasz Sowa 2021-06-17 21:33:28 +02:00
parent abb60def6e
commit 4a64336864
1 changed files with 27 additions and 0 deletions

View File

@ -72,6 +72,20 @@ public:
models_map[name] = models_base;
}
template<typename VectorType>
void Add(const std::wstring & name, std::vector<VectorType*> & container)
{
morm::ModelWrapper * models_base = new morm::ModelWrapperVectorPointer<VectorType>(&container);
models_map[name] = models_base;
}
template<typename VectorType>
void Add(const std::wstring & name, std::vector<VectorType*> * container)
{
morm::ModelWrapper * models_base = new morm::ModelWrapperVectorPointer<VectorType>(container);
models_map[name] = models_base;
}
template<typename ListType>
void Add(const std::wstring & name, std::list<ListType> & container)
{
@ -86,6 +100,19 @@ public:
models_map[name] = models_base;
}
template<typename ListType>
void Add(const std::wstring & name, std::list<ListType*> & container)
{
morm::ModelWrapper * models_base = new morm::ModelWrapperListPointer<ListType>(&container);
models_map[name] = models_base;
}
template<typename ListType>
void Add(const std::wstring & name, std::list<ListType*> * container)
{
morm::ModelWrapper * models_base = new morm::ModelWrapperListPointer<ListType>(container);
models_map[name] = models_base;
}
morm::ModelWrapper * Find(const std::wstring & name);
void Clear();