mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-26 05:50:32 +05:00
store netgen version, introduce "format_version" for future changes
This commit is contained in:
parent
36f22a13ce
commit
8c9cdfbc34
@ -1668,8 +1668,12 @@ namespace netgen
|
|||||||
|
|
||||||
void OCCGeometry :: DoArchive(Archive& ar)
|
void OCCGeometry :: DoArchive(Archive& ar)
|
||||||
{
|
{
|
||||||
int version = 0;
|
constexpr int current_format_version = 0;
|
||||||
ar & version;
|
|
||||||
|
int format_version = current_format_version;
|
||||||
|
auto netgen_version = GetLibraryVersion("netgen");
|
||||||
|
ar & netgen_version & format_version;
|
||||||
|
|
||||||
if(ar.Output())
|
if(ar.Output())
|
||||||
{
|
{
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
@ -1678,6 +1682,11 @@ namespace netgen
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if(format_version>current_format_version)
|
||||||
|
throw Exception("Loading OCCGeometry from archive: unkown format version "
|
||||||
|
+ ToString(format_version)
|
||||||
|
+ ", written by netgen version "
|
||||||
|
+ ToString(netgen_version));
|
||||||
std::string str;
|
std::string str;
|
||||||
ar & str;
|
ar & str;
|
||||||
stringstream ss(str);
|
stringstream ss(str);
|
||||||
|
Loading…
Reference in New Issue
Block a user