Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace openPMD_Datatypes global with function #1509

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/openPMD/Datatype.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ enum class Datatype : int
* listed in order in a vector.
*
*/
extern std::vector<Datatype> openPMD_Datatypes;
std::vector<Datatype> openPMD_Datatypes();

/** @brief Fundamental equivalence check for two given types T and U.
*
Expand Down
83 changes: 43 additions & 40 deletions src/Datatype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,46 +224,49 @@ std::string datatypeToString(openPMD::Datatype dt)
return buf.str();
}

std::vector<Datatype> openPMD_Datatypes{
Datatype::CHAR,
Datatype::UCHAR,
Datatype::SCHAR,
Datatype::SHORT,
Datatype::INT,
Datatype::LONG,
Datatype::LONGLONG,
Datatype::USHORT,
Datatype::UINT,
Datatype::ULONG,
Datatype::ULONGLONG,
Datatype::FLOAT,
Datatype::DOUBLE,
Datatype::LONG_DOUBLE,
Datatype::CFLOAT,
Datatype::CDOUBLE,
Datatype::CLONG_DOUBLE,
Datatype::STRING,
Datatype::VEC_CHAR,
Datatype::VEC_SHORT,
Datatype::VEC_INT,
Datatype::VEC_LONG,
Datatype::VEC_LONGLONG,
Datatype::VEC_UCHAR,
Datatype::VEC_USHORT,
Datatype::VEC_UINT,
Datatype::VEC_ULONG,
Datatype::VEC_ULONGLONG,
Datatype::VEC_FLOAT,
Datatype::VEC_DOUBLE,
Datatype::VEC_LONG_DOUBLE,
Datatype::VEC_CFLOAT,
Datatype::VEC_CDOUBLE,
Datatype::VEC_CLONG_DOUBLE,
Datatype::VEC_SCHAR,
Datatype::VEC_STRING,
Datatype::ARR_DBL_7,
Datatype::BOOL,
Datatype::UNDEFINED};
std::vector<Datatype> openPMD_Datatypes()
{
return {
Datatype::CHAR,
Datatype::UCHAR,
Datatype::SCHAR,
Datatype::SHORT,
Datatype::INT,
Datatype::LONG,
Datatype::LONGLONG,
Datatype::USHORT,
Datatype::UINT,
Datatype::ULONG,
Datatype::ULONGLONG,
Datatype::FLOAT,
Datatype::DOUBLE,
Datatype::LONG_DOUBLE,
Datatype::CFLOAT,
Datatype::CDOUBLE,
Datatype::CLONG_DOUBLE,
Datatype::STRING,
Datatype::VEC_CHAR,
Datatype::VEC_SHORT,
Datatype::VEC_INT,
Datatype::VEC_LONG,
Datatype::VEC_LONGLONG,
Datatype::VEC_UCHAR,
Datatype::VEC_USHORT,
Datatype::VEC_UINT,
Datatype::VEC_ULONG,
Datatype::VEC_ULONGLONG,
Datatype::VEC_FLOAT,
Datatype::VEC_DOUBLE,
Datatype::VEC_LONG_DOUBLE,
Datatype::VEC_CFLOAT,
Datatype::VEC_CDOUBLE,
Datatype::VEC_CLONG_DOUBLE,
Datatype::VEC_SCHAR,
Datatype::VEC_STRING,
Datatype::ARR_DBL_7,
Datatype::BOOL,
Datatype::UNDEFINED};
}

namespace
{
Expand Down
Loading