gmx_fio_do_int(fio_, *value);
}
+void FileIOXdrSerializer::doInt64(gmx_int64_t *value)
+{
+ gmx_fio_do_int64(fio_, *value);
+}
+
void FileIOXdrSerializer::doFloat(float *value)
{
gmx_fio_do_float(fio_, *value);
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
virtual void doUChar(unsigned char *value);
virtual void doInt(int *value);
+ virtual void doInt64(gmx_int64_t *value);
virtual void doFloat(float *value);
virtual void doDouble(double *value);
virtual void doString(std::string *value);
impl_->doValue(*value);
}
+void InMemorySerializer::doInt64(gmx_int64_t *value)
+{
+ impl_->doValue(*value);
+}
+
void InMemorySerializer::doFloat(float *value)
{
impl_->doValue(*value);
impl_->doValue(value);
}
+void InMemoryDeserializer::doInt64(gmx_int64_t *value)
+{
+ impl_->doValue(value);
+}
+
void InMemoryDeserializer::doFloat(float *value)
{
impl_->doValue(value);
virtual bool reading() const { return false; }
virtual void doUChar(unsigned char *value);
virtual void doInt(int *value);
+ virtual void doInt64(gmx_int64_t *value);
virtual void doFloat(float *value);
virtual void doDouble(double *value);
virtual void doString(std::string *value);
virtual bool reading() const { return true; }
virtual void doUChar(unsigned char *value);
virtual void doInt(int *value);
+ virtual void doInt64(gmx_int64_t *value);
virtual void doFloat(float *value);
virtual void doDouble(double *value);
virtual void doString(std::string *value);
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2016, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include <string>
+#include "gromacs/utility/basedefinitions.h"
+
namespace gmx
{
///@{
virtual void doUChar(unsigned char *value) = 0;
virtual void doInt(int *value) = 0;
+ virtual void doInt64(gmx_int64_t *value) = 0;
virtual void doFloat(float *value) = 0;
virtual void doDouble(double *value) = 0;
virtual void doString(std::string *value) = 0;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2016, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
}
};
+template <>
+struct SerializationTraits<gmx_int64_t>
+{
+ static void serialize(gmx_int64_t value, ISerializer *serializer)
+ {
+ serializer->doInt64(&value);
+ }
+ static void deserialize(KeyValueTreeValueBuilder *builder, ISerializer *serializer)
+ {
+ gmx_int64_t value;
+ serializer->doInt64(&value);
+ builder->setValue<gmx_int64_t>(value);
+ }
+};
+
template <>
struct SerializationTraits<float>
{
SERIALIZER('A', KeyValueTreeArray),
SERIALIZER('s', std::string),
SERIALIZER('i', int),
+ SERIALIZER('l', gmx_int64_t),
SERIALIZER('f', float),
SERIALIZER('d', double),
};
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2016, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
{
checker_.checkInteger(*value, nullptr);
}
+ virtual void doInt64(gmx_int64_t *value)
+ {
+ checker_.checkInt64(*value, nullptr);
+ }
virtual void doFloat(float *value)
{
checker_.checkFloat(*value, nullptr);
{
*value = checker_.readInteger(nullptr);
}
+ virtual void doInt64(gmx_int64_t *value)
+ {
+ *value = checker_.readInt64(nullptr);
+ }
virtual void doFloat(float *value)
{
*value = checker_.readFloat(nullptr);
}
+gmx_int64_t TestReferenceChecker::readInt64(const char *id)
+{
+ if (impl_->shouldIgnore())
+ {
+ GMX_THROW(TestException("Trying to read from non-existent reference data value"));
+ }
+ gmx_int64_t value = 0;
+ EXPECT_PLAIN(impl_->processItem(Impl::cInt64NodeName, id,
+ ValueExtractor<gmx_int64_t>(&value)));
+ return value;
+}
+
+
float TestReferenceChecker::readFloat(const char *id)
{
if (impl_->shouldIgnore())
unsigned char readUChar(const char *id);
//! Reads an integer value.
int readInteger(const char *id);
+ //! Reads a 64-bit integer value.
+ gmx_int64_t readInt64(const char *id);
//! Reads a float value.
float readFloat(const char *id);
//! Reads a double value.