mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-26 13:50:33 +05:00
Merge branch 'fix_archive_cleanup' into 'master'
no need to remove archive type infos See merge request jschoeberl/netgen!413
This commit is contained in:
commit
9f756563c0
@ -22,11 +22,6 @@ namespace ngcore
|
|||||||
std::make_unique<std::map<std::string, detail::ClassArchiveInfo>>();
|
std::make_unique<std::map<std::string, detail::ClassArchiveInfo>>();
|
||||||
(*type_register)[classname] = info;
|
(*type_register)[classname] = info;
|
||||||
}
|
}
|
||||||
void Archive :: RemoveArchiveRegister(const std::string& classname)
|
|
||||||
{
|
|
||||||
if(IsRegistered(classname))
|
|
||||||
type_register->erase(classname);
|
|
||||||
}
|
|
||||||
bool Archive :: IsRegistered(const std::string& classname)
|
bool Archive :: IsRegistered(const std::string& classname)
|
||||||
{
|
{
|
||||||
if(type_register == nullptr) type_register =
|
if(type_register == nullptr) type_register =
|
||||||
|
@ -646,7 +646,6 @@ namespace ngcore
|
|||||||
// Set ClassArchiveInfo for Demangled typeid, this is done by creating an instance of
|
// Set ClassArchiveInfo for Demangled typeid, this is done by creating an instance of
|
||||||
// RegisterClassForArchive<type, bases...>
|
// RegisterClassForArchive<type, bases...>
|
||||||
static void SetArchiveRegister(const std::string& classname, const detail::ClassArchiveInfo& info);
|
static void SetArchiveRegister(const std::string& classname, const detail::ClassArchiveInfo& info);
|
||||||
static void RemoveArchiveRegister(const std::string& classname);
|
|
||||||
static bool IsRegistered(const std::string& classname);
|
static bool IsRegistered(const std::string& classname);
|
||||||
|
|
||||||
// Helper class for up-/downcasting
|
// Helper class for up-/downcasting
|
||||||
@ -713,12 +712,6 @@ namespace ngcore
|
|||||||
{ return typeid(T) == ti ? p : Archive::Caster<T, Bases...>::tryDowncast(ti, p); };
|
{ return typeid(T) == ti ? p : Archive::Caster<T, Bases...>::tryDowncast(ti, p); };
|
||||||
Archive::SetArchiveRegister(std::string(Demangle(typeid(T).name())),info);
|
Archive::SetArchiveRegister(std::string(Demangle(typeid(T).name())),info);
|
||||||
}
|
}
|
||||||
~RegisterClassForArchive()
|
|
||||||
{
|
|
||||||
Archive::RemoveArchiveRegister(std::string(Demangle(typeid(T).name())));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// BinaryOutArchive ======================================================================
|
// BinaryOutArchive ======================================================================
|
||||||
|
Loading…
Reference in New Issue
Block a user