[installation] Change to nightly

This commit is contained in:
2025-10-30 12:04:59 +01:00
parent 2ff097f9d1
commit a31bc45cce
1441 changed files with 60368 additions and 56360 deletions

View File

@ -52,14 +52,14 @@ class SC_SYSTEM_CORE_API BinaryArchive : public Seiscomp::Core::Archive {
// Public Interface
// ----------------------------------------------------------------------
public:
bool open(const char* file);
bool open(const char* file) override;
bool open(std::streambuf*);
bool create(const char* file);
bool create(const char* file) override;
bool create(std::streambuf*);
//! Implements derived virtual method
virtual void close();
virtual void close() override;
// ----------------------------------------------------------------------
@ -67,40 +67,40 @@ class SC_SYSTEM_CORE_API BinaryArchive : public Seiscomp::Core::Archive {
// ----------------------------------------------------------------------
public:
//! Reads an integer
virtual void read(std::int8_t& value);
virtual void read(std::int16_t& value);
virtual void read(std::int32_t& value);
virtual void read(std::int64_t& value);
virtual void read(std::int8_t& value) override;
virtual void read(std::int16_t& value) override;
virtual void read(std::int32_t& value) override;
virtual void read(std::int64_t& value) override;
//! Reads a float
virtual void read(float& value);
virtual void read(float& value) override;
//! Reads a double
virtual void read(double& value);
virtual void read(double& value) override;
virtual void read(std::vector<char>& value);
virtual void read(std::vector<int8_t>& value);
virtual void read(std::vector<int16_t>& value);
virtual void read(std::vector<int32_t>& value);
virtual void read(std::vector<int64_t>& value);
virtual void read(std::vector<float>& value);
virtual void read(std::vector<double>& value);
virtual void read(std::vector<std::string>& value);
virtual void read(std::vector<Core::Time>& value);
virtual void read(std::vector<char>& value) override;
virtual void read(std::vector<int8_t>& value) override;
virtual void read(std::vector<int16_t>& value) override;
virtual void read(std::vector<int32_t>& value) override;
virtual void read(std::vector<int64_t>& value) override;
virtual void read(std::vector<float>& value) override;
virtual void read(std::vector<double>& value) override;
virtual void read(std::vector<std::string>& value) override;
virtual void read(std::vector<Core::Time>& value) override;
//! Reads a complex float
virtual void read(std::complex<float>& value);
virtual void read(std::complex<float>& value) override;
//! Reads a complex double
virtual void read(std::complex<double>& value);
virtual void read(std::complex<double>& value) override;
//! Reads a boolean
virtual void read(bool& value);
virtual void read(bool& value) override;
//! Reads a vector of complex doubles
virtual void read(std::vector<std::complex<double> >& value);
virtual void read(std::vector<std::complex<double> >& value) override;
//! Reads a string
virtual void read(std::string& value);
virtual void read(std::string& value) override;
//! Reads a time
virtual void read(Seiscomp::Core::Time& value);
virtual void read(Seiscomp::Core::Time& value) override;
// ----------------------------------------------------------------------
@ -108,40 +108,40 @@ class SC_SYSTEM_CORE_API BinaryArchive : public Seiscomp::Core::Archive {
// ----------------------------------------------------------------------
public:
//! Writes an integer
virtual void write(std::int8_t value);
virtual void write(std::int16_t value);
virtual void write(std::int32_t value);
virtual void write(std::int64_t value);
virtual void write(std::int8_t value) override;
virtual void write(std::int16_t value) override;
virtual void write(std::int32_t value) override;
virtual void write(std::int64_t value) override;
//! Writes a float
virtual void write(float value);
virtual void write(float value) override;
//! Writes a double
virtual void write(double value);
virtual void write(std::vector<char>& value);
virtual void write(std::vector<int8_t>& value);
virtual void write(std::vector<int16_t>& value);
virtual void write(std::vector<int32_t>& value);
virtual void write(std::vector<int64_t>& value);
virtual void write(std::vector<float>& value);
virtual void write(std::vector<double>& value);
virtual void write(std::vector<std::string>& value);
virtual void write(std::vector<Core::Time>& value);
virtual void write(double value) override;
virtual void write(std::vector<char>& value) override;
virtual void write(std::vector<int8_t>& value) override;
virtual void write(std::vector<int16_t>& value) override;
virtual void write(std::vector<int32_t>& value) override;
virtual void write(std::vector<int64_t>& value) override;
virtual void write(std::vector<float>& value) override;
virtual void write(std::vector<double>& value) override;
virtual void write(std::vector<std::string>& value) override;
virtual void write(std::vector<Core::Time>& value) override;
//! Writes a complex float
virtual void write(std::complex<float>& value);
virtual void write(std::complex<float>& value) override;
//! Writes a complex double
virtual void write(std::complex<double>& value);
virtual void write(std::complex<double>& value) override;
//! Writes a boolean
virtual void write(bool value);
virtual void write(bool value) override;
//! Writes a vector of complex doubles
virtual void write(std::vector<std::complex<double> >& value);
virtual void write(std::vector<std::complex<double> >& value) override;
//! Writes a string
virtual void write(std::string& value);
virtual void write(std::string& value) override;
//! Writes a time
virtual void write(Seiscomp::Core::Time& value);
virtual void write(Seiscomp::Core::Time& value) override;
// ----------------------------------------------------------------------
@ -149,24 +149,24 @@ class SC_SYSTEM_CORE_API BinaryArchive : public Seiscomp::Core::Archive {
// ----------------------------------------------------------------------
protected:
//! Implements derived virtual method
bool locateObjectByName(const char* name, const char* targetClass, bool nullable);
bool locateNextObjectByName(const char* name, const char* targetClass);
void locateNullObjectByName(const char* name, const char* targetClass, bool first);
bool locateObjectByName(const char* name, const char* targetClass, bool nullable) override;
bool locateNextObjectByName(const char* name, const char* targetClass) override;
void locateNullObjectByName(const char* name, const char* targetClass, bool first) override;
void readSequence();
void writeSequence(int size);
void readSequence() override;
void writeSequence(int size) override;
//! Implements derived virtual method
std::string determineClassName();
std::string determineClassName() override;
//! Implements derived virtual method
virtual void setClassName(const char* className);
virtual void setClassName(const char* className) override;
//! Implements derived virtual method
void serialize(RootType* object);
void serialize(RootType* object) override;
//! Implements derived virtual method
void serialize(SerializeDispatcher&);
void serialize(SerializeDispatcher&) override;
int writeBytes(const void*, int);
@ -225,13 +225,13 @@ class SC_SYSTEM_CORE_API VBinaryArchive : public BinaryArchive {
public:
void setWriteVersion(int version);
bool open(const char* file);
bool open(const char* file) override;
bool open(std::streambuf*);
bool create(const char* file);
bool create(const char* file) override;
bool create(std::streambuf*);
void close();
void close() override;
const char *errorMsg() const;

View File

@ -17,9 +17,11 @@
* gempa GmbH. *
***************************************************************************/
#ifndef SCARCHIVE_BSON_H
#define SCARCHIVE_BSON_H
#include <seiscomp/core/io.h>
#include <seiscomp/core.h>
@ -55,7 +57,7 @@ class SC_SYSTEM_CORE_API BSONArchive : public Seiscomp::Core::Archive {
bool open(std::streambuf*);
//! Implements derived virtual method
virtual bool open(const char* filename);
virtual bool open(const char* filename) override;
//! Creates an archive writing to a streambuf
bool create(std::streambuf* buf, bool writeVersion = true);
@ -64,7 +66,7 @@ class SC_SYSTEM_CORE_API BSONArchive : public Seiscomp::Core::Archive {
virtual bool create(const char* filename, bool writeVersion = true);
//! Implements derived virtual method
virtual void close();
virtual void close() override;
/**
* Enables/Disables zip compression
@ -84,46 +86,46 @@ class SC_SYSTEM_CORE_API BSONArchive : public Seiscomp::Core::Archive {
// ----------------------------------------------------------------------
public:
//! Reads an int8
virtual void read(std::int8_t& value);
virtual void read(std::int8_t& value) override;
//! Reads an int16
virtual void read(std::int16_t& value);
virtual void read(std::int16_t& value) override;
//! Reads an int32
virtual void read(std::int32_t& value);
virtual void read(std::int32_t& value) override;
//! Reads an int64
virtual void read(std::int64_t& value);
virtual void read(std::int64_t& value) override;
//! Reads a float
virtual void read(float& value);
virtual void read(float& value) override;
//! Reads a double
virtual void read(double& value);
virtual void read(double& value) override;
virtual void read(char& value);
//! Reads a vector of native types
virtual void read(std::vector<char>& value);
virtual void read(std::vector<int8_t>& value);
virtual void read(std::vector<int16_t>& value);
virtual void read(std::vector<int32_t>& value);
virtual void read(std::vector<int64_t>& value);
virtual void read(std::vector<float>& value);
virtual void read(std::vector<double>& value);
virtual void read(std::vector<std::string>& value);
virtual void read(std::vector<Core::Time>& value);
virtual void read(std::vector<char>& value) override;
virtual void read(std::vector<int8_t>& value) override;
virtual void read(std::vector<int16_t>& value) override;
virtual void read(std::vector<int32_t>& value) override;
virtual void read(std::vector<int64_t>& value) override;
virtual void read(std::vector<float>& value) override;
virtual void read(std::vector<double>& value) override;
virtual void read(std::vector<std::string>& value) override;
virtual void read(std::vector<Core::Time>& value) override;
//! Reads a complex float
virtual void read(std::complex<float>& value);
virtual void read(std::complex<float>& value) override;
//! Reads a complex double
virtual void read(std::complex<double>& value);
virtual void read(std::complex<double>& value) override;
//! Reads a boolean
virtual void read(bool& value);
virtual void read(bool& value) override;
//! Reads a vector of complex doubles
virtual void read(std::vector<std::complex<double> >& value);
virtual void read(std::vector<std::complex<double> >& value) override;
//! Reads a string
virtual void read(std::string& value);
virtual void read(std::string& value) override;
//! Reads a time
virtual void read(Seiscomp::Core::Time& value);
virtual void read(Seiscomp::Core::Time& value) override;
// ----------------------------------------------------------------------
@ -131,46 +133,46 @@ class SC_SYSTEM_CORE_API BSONArchive : public Seiscomp::Core::Archive {
// ----------------------------------------------------------------------
public:
//! Writes an int8
virtual void write(std::int8_t value);
virtual void write(std::int8_t value) override;
//! Writes an int16
virtual void write(std::int16_t value);
virtual void write(std::int16_t value) override;
//! Writes an int32
virtual void write(std::int32_t value);
virtual void write(std::int32_t value) override;
//! Writes an int64
virtual void write(std::int64_t value);
virtual void write(std::int64_t value) override;
//! Writes a float
virtual void write(float value);
virtual void write(float value) override;
//! Writes a double
virtual void write(double value);
virtual void write(double value) override;
virtual void write(char& value);
//! Writes a vector of native types
virtual void write(std::vector<char>& value);
virtual void write(std::vector<int8_t>& value);
virtual void write(std::vector<int16_t>& value);
virtual void write(std::vector<int32_t>& value);
virtual void write(std::vector<int64_t>& value);
virtual void write(std::vector<float>& value);
virtual void write(std::vector<double>& value);
virtual void write(std::vector<std::string>& value);
virtual void write(std::vector<Core::Time>& value);
virtual void write(std::vector<char>& value) override;
virtual void write(std::vector<int8_t>& value) override;
virtual void write(std::vector<int16_t>& value) override;
virtual void write(std::vector<int32_t>& value) override;
virtual void write(std::vector<int64_t>& value) override;
virtual void write(std::vector<float>& value) override;
virtual void write(std::vector<double>& value) override;
virtual void write(std::vector<std::string>& value) override;
virtual void write(std::vector<Core::Time>& value) override;
//! Writes a complex float
virtual void write(std::complex<float>& value);
virtual void write(std::complex<float>& value) override;
//! Writes a complex double
virtual void write(std::complex<double>& value);
virtual void write(std::complex<double>& value) override;
//! Writes a boolean
virtual void write(bool value);
virtual void write(bool value) override;
//! Writes a vector of complex doubles
virtual void write(std::vector<std::complex<double> >& value);
virtual void write(std::vector<std::complex<double> >& value) override;
//! Writes a string
virtual void write(std::string& value);
virtual void write(std::string& value) override;
//! Writes a time
virtual void write(Seiscomp::Core::Time& value);
virtual void write(Seiscomp::Core::Time& value) override;
// ----------------------------------------------------------------------
@ -180,24 +182,24 @@ class SC_SYSTEM_CORE_API BSONArchive : public Seiscomp::Core::Archive {
void setValidity(bool v);
//! Implements derived virtual method
bool locateObjectByName(const char* name, const char* targetClass, bool nullable);
bool locateNextObjectByName(const char* name, const char* targetClass);
bool locateObjectByName(const char* name, const char* targetClass, bool nullable) override;
bool locateNextObjectByName(const char* name, const char* targetClass) override;
//! Implements derived virtual method
void readSequence();
void writeSequence(int size);
void readSequence() override;
void writeSequence(int size) override;
//! Implements derived virtual method
std::string determineClassName();
std::string determineClassName() override;
//! Implements derived virtual method
virtual void setClassName(const char* className);
virtual void setClassName(const char* className) override;
//! Implements derived virtual method
void serialize(RootType* object);
void serialize(RootType* object) override;
//! Implements derived virtual method
void serialize(SerializeDispatcher&);
void serialize(SerializeDispatcher&) override;
// ----------------------------------------------------------------------

View File

@ -65,7 +65,7 @@ class SC_SYSTEM_CORE_API JSONArchive : public Core::Archive {
// Public Interface
// ----------------------------------------------------------------------
public:
bool open(const char *file);
bool open(const char *file) override;
bool open(std::streambuf*);
//! Reads an archive from a rapidjson document value
bool from(const Value*);
@ -86,7 +86,7 @@ class SC_SYSTEM_CORE_API JSONArchive : public Core::Archive {
void setRootObject(bool);
//! Implements derived virtual method
virtual void close();
virtual void close() override;
// ----------------------------------------------------------------------
@ -94,43 +94,43 @@ class SC_SYSTEM_CORE_API JSONArchive : public Core::Archive {
// ----------------------------------------------------------------------
public:
//! Reads an int8
virtual void read(std::int8_t& value);
virtual void read(std::int8_t& value) override;
//! Reads an int16
virtual void read(std::int16_t& value);
virtual void read(std::int16_t& value) override;
//! Reads an int32
virtual void read(std::int32_t& value);
virtual void read(std::int32_t& value) override;
//! Reads an int64
virtual void read(std::int64_t& value);
virtual void read(std::int64_t& value) override;
//! Reads a float
virtual void read(float& value);
virtual void read(float& value) override;
//! Reads a double
virtual void read(double& value);
virtual void read(double& value) override;
virtual void read(std::vector<char>& value);
virtual void read(std::vector<int8_t>& value);
virtual void read(std::vector<int16_t>& value);
virtual void read(std::vector<int32_t>& value);
virtual void read(std::vector<int64_t>& value);
virtual void read(std::vector<float>& value);
virtual void read(std::vector<double>& value);
virtual void read(std::vector<std::string>& value);
virtual void read(std::vector<Core::Time>& value);
virtual void read(std::vector<char>& value) override;
virtual void read(std::vector<int8_t>& value) override;
virtual void read(std::vector<int16_t>& value) override;
virtual void read(std::vector<int32_t>& value) override;
virtual void read(std::vector<int64_t>& value) override;
virtual void read(std::vector<float>& value) override;
virtual void read(std::vector<double>& value) override;
virtual void read(std::vector<std::string>& value) override;
virtual void read(std::vector<Core::Time>& value) override;
//! Reads a complex float
virtual void read(std::complex<float>& value);
virtual void read(std::complex<float>& value) override;
//! Reads a complex double
virtual void read(std::complex<double>& value);
virtual void read(std::complex<double>& value) override;
//! Reads a boolean
virtual void read(bool& value);
virtual void read(bool& value) override;
//! Reads a vector of complex doubles
virtual void read(std::vector<std::complex<double> >& value);
virtual void read(std::vector<std::complex<double> >& value) override;
//! Reads a string
virtual void read(std::string& value);
virtual void read(std::string& value) override;
//! Reads a time
virtual void read(Seiscomp::Core::Time& value);
virtual void read(Seiscomp::Core::Time& value) override;
// ----------------------------------------------------------------------
@ -138,43 +138,43 @@ class SC_SYSTEM_CORE_API JSONArchive : public Core::Archive {
// ----------------------------------------------------------------------
public:
//! Writes an int8
virtual void write(std::int8_t value);
virtual void write(std::int8_t value) override;
//! Writes an int16
virtual void write(std::int16_t value);
virtual void write(std::int16_t value) override;
//! Writes an int32
virtual void write(std::int32_t value);
virtual void write(std::int32_t value) override;
//! Writes an int64
virtual void write(std::int64_t value);
virtual void write(std::int64_t value) override;
//! Writes a float
virtual void write(float value);
virtual void write(float value) override;
//! Writes a double
virtual void write(double value);
virtual void write(double value) override;
virtual void write(std::vector<char>& value);
virtual void write(std::vector<int8_t>& value);
virtual void write(std::vector<int16_t>& value);
virtual void write(std::vector<int32_t>& value);
virtual void write(std::vector<int64_t>& value);
virtual void write(std::vector<float>& value);
virtual void write(std::vector<double>& value);
virtual void write(std::vector<std::string>& value);
virtual void write(std::vector<Core::Time>& value);
virtual void write(std::vector<char>& value) override;
virtual void write(std::vector<int8_t>& value) override;
virtual void write(std::vector<int16_t>& value) override;
virtual void write(std::vector<int32_t>& value) override;
virtual void write(std::vector<int64_t>& value) override;
virtual void write(std::vector<float>& value) override;
virtual void write(std::vector<double>& value) override;
virtual void write(std::vector<std::string>& value) override;
virtual void write(std::vector<Core::Time>& value) override;
//! Writes a complex float
virtual void write(std::complex<float>& value);
virtual void write(std::complex<float>& value) override;
//! Writes a complex double
virtual void write(std::complex<double>& value);
virtual void write(std::complex<double>& value) override;
//! Writes a boolean
virtual void write(bool value);
virtual void write(bool value) override;
//! Writes a vector of complex doubles
virtual void write(std::vector<std::complex<double> >& value);
virtual void write(std::vector<std::complex<double> >& value) override;
//! Writes a string
virtual void write(std::string& value);
virtual void write(std::string& value) override;
//! Writes a time
virtual void write(Seiscomp::Core::Time& value);
virtual void write(Seiscomp::Core::Time& value) override;
// ----------------------------------------------------------------------
@ -182,24 +182,24 @@ class SC_SYSTEM_CORE_API JSONArchive : public Core::Archive {
// ----------------------------------------------------------------------
protected:
//! Implements derived virtual method
bool locateObjectByName(const char* name, const char* targetClass, bool nullable);
bool locateNextObjectByName(const char* name, const char* targetClass);
void locateNullObjectByName(const char* name, const char* targetClass, bool first);
bool locateObjectByName(const char* name, const char* targetClass, bool nullable) override;
bool locateNextObjectByName(const char* name, const char* targetClass) override;
void locateNullObjectByName(const char* name, const char* targetClass, bool first) override;
void readSequence();
void writeSequence(int size);
void readSequence() override;
void writeSequence(int size) override;
//! Implements derived virtual method
std::string determineClassName();
std::string determineClassName() override;
//! Implements derived virtual method
virtual void setClassName(const char* className);
virtual void setClassName(const char* className) override;
//! Implements derived virtual method
void serialize(RootType* object);
void serialize(RootType* object) override;
//! Implements derived virtual method
void serialize(SerializeDispatcher&);
void serialize(SerializeDispatcher&) override;
// ----------------------------------------------------------------------
@ -232,6 +232,9 @@ class SC_SYSTEM_CORE_API JSONArchive : public Core::Archive {
template <typename T>
void writeVector(std::vector<T> &value);
template <typename T>
void writeVectorNumber(std::vector<T> &value);
private:
int _forceWriteVersion;

View File

@ -62,7 +62,7 @@ class SC_SYSTEM_CORE_API XMLArchive : public Seiscomp::Core::Archive {
bool open(std::streambuf*);
//! Implements derived virtual method
virtual bool open(const char* filename);
virtual bool open(const char* filename) override;
//! Creates an archive writing to a streambuf
bool create(std::streambuf* buf, bool writeVersion = true, bool headerNode = true);
@ -71,7 +71,7 @@ class SC_SYSTEM_CORE_API XMLArchive : public Seiscomp::Core::Archive {
virtual bool create(const char* filename, bool writeVersion = true, bool headerNode = true);
//! Implements derived virtual method
virtual void close();
virtual void close() override;
//! Sets the root tagname to define the document entry.
//! The default tagname is "seiscomp"
@ -106,51 +106,59 @@ class SC_SYSTEM_CORE_API XMLArchive : public Seiscomp::Core::Archive {
//! Sets the root namespace used when creating new documents
void setRootNamespace(const std::string& name, const std::string& uri);
/**
* @brief Sets the list delimiter when reading and writing lists.
* This parameter only applies for lists which are not complex numbers.
* These will be converted using space as delimiter.
* @param delimiter The delimiter character
*/
void setListDelimiter(char delimiter);
// ----------------------------------------------------------------------
// Read methods
// ----------------------------------------------------------------------
public:
//! Reads an int8
virtual void read(std::int8_t& value);
virtual void read(std::int8_t& value) override;
//! Reads an int16
virtual void read(std::int16_t& value);
virtual void read(std::int16_t& value) override;
//! Reads an int32
virtual void read(std::int32_t& value);
virtual void read(std::int32_t& value) override;
//! Reads an int64
virtual void read(std::int64_t& value);
virtual void read(std::int64_t& value) override;
//! Reads a float
virtual void read(float& value);
virtual void read(float& value) override;
//! Reads a double
virtual void read(double& value);
virtual void read(double& value) override;
//! Reads a vector of native types
virtual void read(std::vector<char>& value);
virtual void read(std::vector<int8_t>& value);
virtual void read(std::vector<int16_t>& value);
virtual void read(std::vector<int32_t>& value);
virtual void read(std::vector<int64_t>& value);
virtual void read(std::vector<float>& value);
virtual void read(std::vector<double>& value);
virtual void read(std::vector<std::string>& value);
virtual void read(std::vector<Core::Time>& value);
virtual void read(std::vector<char>& value) override;
virtual void read(std::vector<int8_t>& value) override;
virtual void read(std::vector<int16_t>& value) override;
virtual void read(std::vector<int32_t>& value) override;
virtual void read(std::vector<int64_t>& value) override;
virtual void read(std::vector<float>& value) override;
virtual void read(std::vector<double>& value) override;
virtual void read(std::vector<std::string>& value) override;
virtual void read(std::vector<Core::Time>& value) override;
//! Reads a complex float
virtual void read(std::complex<float>& value);
virtual void read(std::complex<float>& value) override;
//! Reads a complex double
virtual void read(std::complex<double>& value);
virtual void read(std::complex<double>& value) override;
//! Reads a boolean
virtual void read(bool& value);
virtual void read(bool& value) override;
//! Reads a vector of complex doubles
virtual void read(std::vector<std::complex<double> >& value);
virtual void read(std::vector<std::complex<double> >& value) override;
//! Reads a string
virtual void read(std::string& value);
virtual void read(std::string& value) override;
//! Reads a time
virtual void read(Seiscomp::Core::Time& value);
virtual void read(Seiscomp::Core::Time& value) override;
// ----------------------------------------------------------------------
@ -158,44 +166,44 @@ class SC_SYSTEM_CORE_API XMLArchive : public Seiscomp::Core::Archive {
// ----------------------------------------------------------------------
public:
//! Writes an int8
virtual void write(std::int8_t value);
virtual void write(std::int8_t value) override;
//! Writes an int16
virtual void write(std::int16_t value);
virtual void write(std::int16_t value) override;
//! Writes an int32
virtual void write(std::int32_t value);
virtual void write(std::int32_t value) override;
//! Writes an int64
virtual void write(std::int64_t value);
virtual void write(std::int64_t value) override;
//! Writes a float
virtual void write(float value);
virtual void write(float value) override;
//! Writes a double
virtual void write(double value);
virtual void write(double value) override;
//! Writes a vector of native types
virtual void write(std::vector<char>& value);
virtual void write(std::vector<int8_t>& value);
virtual void write(std::vector<int16_t>& value);
virtual void write(std::vector<int32_t>& value);
virtual void write(std::vector<int64_t>& value);
virtual void write(std::vector<float>& value);
virtual void write(std::vector<double>& value);
virtual void write(std::vector<std::string>& value);
virtual void write(std::vector<Core::Time>& value);
virtual void write(std::vector<char>& value) override;
virtual void write(std::vector<int8_t>& value) override;
virtual void write(std::vector<int16_t>& value) override;
virtual void write(std::vector<int32_t>& value) override;
virtual void write(std::vector<int64_t>& value) override;
virtual void write(std::vector<float>& value) override;
virtual void write(std::vector<double>& value) override;
virtual void write(std::vector<std::string>& value) override;
virtual void write(std::vector<Core::Time>& value) override;
//! Writes a complex float
virtual void write(std::complex<float>& value);
virtual void write(std::complex<float>& value) override;
//! Writes a complex double
virtual void write(std::complex<double>& value);
virtual void write(std::complex<double>& value) override;
//! Writes a boolean
virtual void write(bool value);
virtual void write(bool value) override;
//! Writes a vector of complex doubles
virtual void write(std::vector<std::complex<double> >& value);
virtual void write(std::vector<std::complex<double> >& value) override;
//! Writes a string
virtual void write(std::string& value);
virtual void write(std::string& value) override;
//! Writes a time
virtual void write(Seiscomp::Core::Time& value);
virtual void write(Seiscomp::Core::Time& value) override;
// ----------------------------------------------------------------------
@ -205,20 +213,20 @@ class SC_SYSTEM_CORE_API XMLArchive : public Seiscomp::Core::Archive {
void setValidity(bool v);
//! Implements derived virtual method
bool locateObjectByName(const char* name, const char* targetClass, bool nullable);
bool locateNextObjectByName(const char* name, const char* targetClass);
bool locateObjectByName(const char* name, const char* targetClass, bool nullable) override;
bool locateNextObjectByName(const char* name, const char* targetClass) override;
//! Implements derived virtual method
std::string determineClassName();
std::string determineClassName() override;
//! Implements derived virtual method
virtual void setClassName(const char* className);
virtual void setClassName(const char* className) override;
//! Implements derived virtual method
void serialize(RootType* object);
void serialize(RootType* object) override;
//! Implements derived virtual method
void serialize(SerializeDispatcher&);
void serialize(SerializeDispatcher&) override;
// ----------------------------------------------------------------------
@ -234,21 +242,22 @@ class SC_SYSTEM_CORE_API XMLArchive : public Seiscomp::Core::Archive {
protected:
mutable void* _document;
mutable void* _current;
mutable void* _objectLocation;
mutable std::string _property;
mutable std::string _attribName;
mutable void *_document;
mutable void *_current;
mutable void *_objectLocation;
mutable std::string _property;
mutable std::string _attribName;
int _forceWriteVersion;
std::string _rootTag;
int _forceWriteVersion;
std::string _rootTag;
char _listDelimiter{' '};
std::streambuf* _buf;
bool _deleteOnClose;
std::streambuf *_buf;
bool _deleteOnClose;
bool _formattedOutput;
bool _compression;
CompressionMethod _compressionMethod;
bool _formattedOutput;
bool _compression;
CompressionMethod _compressionMethod;
std::pair<std::string, std::string> _namespace;
};

View File

@ -24,8 +24,10 @@
#include <seiscomp/core/baseobject.h>
#include <seiscomp/core/interfacefactory.h>
#include <seiscomp/core/enumeration.h>
#include <seiscomp/core/datetime.h>
#include <seiscomp/core.h>
#include <vector>
#include <string>
#include <stdint.h>
@ -78,12 +80,33 @@ DEFINE_SMARTPOINTER(DatabaseInterface);
// Public types
// ------------------------------------------------------------------
public:
typedef uint64_t OID;
using OID = uint64_t;
static const OID INVALID_OID;
MAKEENUM(Backend,
EVALUES(
MySQL,
PostgreSQL,
SQLite3,
MSSQL,
Oracle,
ODBC,
Unknown
),
ENAMES(
"mysql",
"postgresql",
"sqlite3",
"mssql",
"orcale",
"odbc",
"unknown"
)
);
// ------------------------------------------------------------------
// Xstruction
// X'truction
// ------------------------------------------------------------------
protected:
//! Protected constructor
@ -112,6 +135,14 @@ DEFINE_SMARTPOINTER(DatabaseInterface);
//! caller!
static DatabaseInterface *Open(const char* uri);
/**
* @brief Returns the implemented backend from one of the supported
* enumerations.
* If an yet unknown backend is implemented, return Unknown.
* @return
*/
virtual Backend backend() const = 0;
/** Opens a connection to the database server
@param connection The string containing the connection
data. Its format is
@ -278,7 +309,7 @@ DEFINE_SMARTPOINTER(DatabaseInterface);
* @param from The input string.
* @return Success flag
*/
virtual bool escape(std::string &out, const std::string &in);
virtual bool escape(std::string &out, const std::string &in) const;
//! Returns the used column prefix
const std::string &columnPrefix() const;
@ -311,13 +342,14 @@ DEFINE_SMARTPOINTER(DatabaseInterface);
// Protected members
// ------------------------------------------------------------------
protected:
std::string _user;
std::string _password;
std::string _host;
int _port;
unsigned int _timeout;
std::string _database;
std::string _columnPrefix;
std::string _user;
std::string _password;
std::string _host;
int _port;
unsigned int _timeout;
std::string _database;
mutable std::string _columnPrefix;
mutable Backend _backend = Unknown;
};

View File

@ -52,32 +52,32 @@ class SC_SYSTEM_CORE_API HelmbergerArchive : public GFArchive {
// Public interface
// ----------------------------------------------------------------------
public:
bool setSource(std::string);
void close();
bool setSource(std::string) override;
void close() override;
std::list<std::string> availableModels() const;
std::list<double> availableDepths(const std::string &model) const;
std::list<std::string> availableModels() const override;
std::list<double> availableDepths(const std::string &model) const override;
bool setTimeSpan(const Core::TimeSpan &span);
bool setTimeSpan(const Core::TimeSpan &span) override;
//! Adds a request for a greensfunction.
bool addRequest(const std::string &id,
const std::string &model,
const GFSource &source,
const GFReceiver &receiver);
const GFReceiver &receiver) override;
bool addRequest(const std::string &id,
const std::string &model,
const GFSource &source,
const GFReceiver &receiver,
const Core::TimeSpan &span);
const Core::TimeSpan &span) override;
Core::GreensFunction* get();
Core::GreensFunction* get() override;
OPT(double) getTravelTime(const std::string &phase,
const std::string &model,
const GFSource &source,
const GFReceiver &receiver);
const GFReceiver &receiver) override;
// ----------------------------------------------------------------------

View File

@ -51,32 +51,32 @@ class SC_SYSTEM_CORE_API Instaseis : public GFArchive {
// Public interface
// ----------------------------------------------------------------------
public:
bool setSource(std::string);
void close();
bool setSource(std::string) override;
void close() override;
std::list<std::string> availableModels() const;
std::list<double> availableDepths(const std::string &model) const;
std::list<std::string> availableModels() const override;
std::list<double> availableDepths(const std::string &model) const override;
bool setTimeSpan(const Core::TimeSpan &span);
bool setTimeSpan(const Core::TimeSpan &span) override;
//! Adds a request for a greensfunction.
bool addRequest(const std::string &id,
const std::string &model,
const GFSource &source,
const GFReceiver &receiver);
const GFReceiver &receiver) override;
bool addRequest(const std::string &id,
const std::string &model,
const GFSource &source,
const GFReceiver &receiver,
const Core::TimeSpan &span);
const Core::TimeSpan &span) override;
Core::GreensFunction* get();
Core::GreensFunction* get() override;
OPT(double) getTravelTime(const std::string &phase,
const std::string &model,
const GFSource &source,
const GFReceiver &receiver);
const GFReceiver &receiver) override;
// ----------------------------------------------------------------------

View File

@ -52,32 +52,32 @@ class SC_SYSTEM_CORE_API SC3GF1DArchive : public GFArchive {
// Public interface
// ----------------------------------------------------------------------
public:
bool setSource(std::string);
void close();
bool setSource(std::string) override;
void close() override;
std::list<std::string> availableModels() const;
std::list<double> availableDepths(const std::string &model) const;
std::list<std::string> availableModels() const override;
std::list<double> availableDepths(const std::string &model) const override;
bool setTimeSpan(const Core::TimeSpan &span);
bool setTimeSpan(const Core::TimeSpan &span) override;
//! Adds a request for a greensfunction.
bool addRequest(const std::string &id,
const std::string &model,
const GFSource &source,
const GFReceiver &receiver);
const GFReceiver &receiver) override;
bool addRequest(const std::string &id,
const std::string &model,
const GFSource &source,
const GFReceiver &receiver,
const Core::TimeSpan &span);
const Core::TimeSpan &span) override;
Core::GreensFunction* get();
Core::GreensFunction* get() override;
OPT(double) getTravelTime(const std::string &phase,
const std::string &model,
const GFSource &source,
const GFReceiver &receiver);
const GFReceiver &receiver) override;
// ----------------------------------------------------------------------

View File

@ -292,11 +292,11 @@ std::string HttpSocket<SocketType>::httpReadRaw(int size)
template <typename SocketType>
std::string HttpSocket<SocketType>::httpReadSome(int size)
{
if ( _decomp != nullptr ) {
if ( _decomp ) {
HttpSource<SocketType> src(this);
std::vector<char> tmp(size);
std::streamsize bytesRead = _decomp->read(src, &tmp[0], size);
return std::string(&tmp[0], bytesRead);
std::streamsize bytesRead = _decomp->read(src, tmp.data(), size);
return std::string(tmp.data(), bytesRead);
}
else {
return httpReadRaw(size);

View File

@ -98,7 +98,7 @@ class SC_SYSTEM_CORE_API RecordFilterInterface : public Seiscomp::Core::BaseObje
//! Clones a filter and must preserve currently configured parameters
//! but not the states (e.g. last record time). Basically clone must
//! result in the same as copying the instance and calling reset.
virtual RecordFilterInterface *clone() const = 0;
virtual RecordFilterInterface *clone() const override = 0;
};

View File

@ -57,10 +57,10 @@ class SC_SYSTEM_CORE_API RecordDemuxFilter : public RecordFilterInterface {
// RecordFilter interface
// ------------------------------------------------------------------
public:
virtual Record *feed(const Record *rec);
virtual Record *flush();
virtual void reset();
virtual RecordFilterInterface *clone() const;
virtual Record *feed(const Record *rec) override;
virtual Record *flush() override;
virtual void reset() override;
virtual RecordFilterInterface *clone() const override;
// ------------------------------------------------------------------

View File

@ -21,6 +21,7 @@
#ifndef SEISCOMP_IO_RECORDFILTER_IIRFILTER_H
#define SEISCOMP_IO_RECORDFILTER_IIRFILTER_H
#include <seiscomp/core/genericrecord.h>
#include <seiscomp/io/recordfilter.h>
#include <seiscomp/math/filter.h>
@ -90,13 +91,13 @@ class SC_SYSTEM_CORE_API RecordIIRFilter : public RecordFilterInterface {
//! Applies the filter and returns a copy with a record of the
//! requested datatype. The returned record instance is a GenericRecord.
//! If no IIR filter is set a type converted copy is returned.
virtual Record *feed(const Record *rec);
virtual Record *feed(const Record *rec) override;
virtual Record *flush();
virtual Record *flush() override;
virtual void reset();
virtual void reset() override;
RecordFilterInterface *clone() const;
RecordFilterInterface *clone() const override;
// ------------------------------------------------------------------
@ -104,7 +105,7 @@ class SC_SYSTEM_CORE_API RecordIIRFilter : public RecordFilterInterface {
// ------------------------------------------------------------------
private:
InplaceFilterType *_filter;
Core::Time _lastEndTime;
OPT(Core::Time) _lastEndTime;
double _samplingFrequency;
std::string _lastError;
};

View File

@ -0,0 +1,123 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_IO_RECORDFILTER_MSEEDENCODER_H
#define SEISCOMP_IO_RECORDFILTER_MSEEDENCODER_H
#include <seiscomp/core/genericrecord.h>
#include <seiscomp/io/recordfilter.h>
#include <seiscomp/math/filter.h>
namespace Seiscomp {
namespace IO {
class SC_SYSTEM_CORE_API MSeedEncoder : public RecordFilterInterface {
// ------------------------------------------------------------------
// X'truction
// ------------------------------------------------------------------
public:
MSeedEncoder() = default;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
public:
/**
* @brief Sets the record size of the compressed MiniSEED record.
* @param size The size of the compressed record as an exponent of base 2.
* The value range is from 7 to 20.
* @return Success flag.
*/
bool setRecordSize(int size);
/**
* @brief Sets uncompressed encoding.
*/
void setIdentity();
/**
* @brief Enables Steim1 compression.
*/
void setSteim1();
/**
* @brief Enables Steim2 compression.
* The Steim2 compression is enabled by default.
*/
void setSteim2();
void allowFloatingPointCompression(bool f);
// ------------------------------------------------------------------
// RecordFilter interface
// ------------------------------------------------------------------
public:
//! Applies the filter and returns a copy with a record of the
//! requested datatype. The returned record instance is a GenericRecord.
//! If no IIR filter is set a type converted copy is returned.
Record *feed(const Record *rec) override;
Record *flush() override;
void reset() override;
RecordFilterInterface *clone() const override;
// ------------------------------------------------------------------
// Private methods
// ------------------------------------------------------------------
private:
Record *pop();
// ------------------------------------------------------------------
// Public types
// ------------------------------------------------------------------
public:
enum CompressionType {
Identity,
Steim1,
Steim2
};
// ------------------------------------------------------------------
// Private members
// ------------------------------------------------------------------
private:
double _samplingFrequency{-1};
int _recordSize{9};
CompressionType _compression{Steim2};
Array::DataType _dataType{Array::DT_QUANTITY};
bool _allowFloatingPointCompression{true};
Core::BaseObjectPtr _encoder{nullptr};
};
}
}
#endif

View File

@ -42,8 +42,8 @@ class SC_SYSTEM_CORE_API RecordResamplerBase : public RecordFilterInterface {
virtual ~RecordResamplerBase();
public:
virtual Record *flush();
virtual void reset();
virtual Record *flush() override;
virtual void reset() override;
protected:
typedef std::vector<double> Coefficients;
@ -90,11 +90,11 @@ class SC_SYSTEM_CORE_API RecordResampler : public RecordResamplerBase {
//! Feeds a record.
//! @return A resampled record. May return nullptr if not enough data are
//! available to flush the record.
virtual Record *feed(const Record *record);
virtual Record *feed(const Record *record) override;
virtual void reset();
virtual void reset() override;
RecordFilterInterface *clone() const;
RecordFilterInterface *clone() const override;
// ----------------------------------------------------------------------
@ -123,16 +123,16 @@ class SC_SYSTEM_CORE_API RecordResampler : public RecordResamplerBase {
size_t front;
// Time of front of ring buffer
Seiscomp::Core::Time startTime;
OPT(Seiscomp::Core::Time) startTime;
// End time of last record
Seiscomp::Core::Time lastEndTime;
OPT(Seiscomp::Core::Time) lastEndTime;
void reset() {
missingSamples = buffer.size();
front = 0;
startTime = Seiscomp::Core::Time();
lastEndTime = Seiscomp::Core::Time();
startTime = Core::None;
lastEndTime = Core::None;
}
};

View File

@ -145,7 +145,7 @@ class SC_SYSTEM_CORE_API Spectralizer : public Core::BaseObject {
// Implementation
// ----------------------------------------------------------------------
private:
typedef Core::SmartPointer< Math::Filtering::InPlaceFilter<double> >::Impl FilterPtr;
using FilterPtr = Core::SmartPointer<Math::Filtering::InPlaceFilter<double>>;
struct SpecBuffer {
SpecBuffer() {}
~SpecBuffer() {}
@ -172,17 +172,17 @@ class SC_SYSTEM_CORE_API Spectralizer : public Core::BaseObject {
size_t front;
// Time of front of ring buffer
Core::Time startTime;
OPT(Core::Time) startTime;
// End time of last record
Core::Time lastEndTime;
OPT(Core::Time) lastEndTime;
void reset(FilterPtr refFilter) {
missingSamples = buffer.size();
front = 0;
samplesToSkip = 0;
startTime = Core::Time();
lastEndTime = Core::Time();
startTime = Core::None;;
lastEndTime = Core::None;
if ( refFilter ) {
filter = refFilter->clone();

View File

@ -31,9 +31,20 @@ namespace IO {
class RecordInput;
class SC_SYSTEM_CORE_API RecordIterator : public std::iterator<std::input_iterator_tag, Record *> {
class SC_SYSTEM_CORE_API RecordIterator {
// ------------------------------------------------------------------
// Xstruction
// Iterator types
// ------------------------------------------------------------------
public:
using iterator_category = std::input_iterator_tag;
using value_type = Record*;
using difference_type = std::ptrdiff_t;
using pointer = Record**;
using reference = Record*&;
// ------------------------------------------------------------------
// X'truction
// ------------------------------------------------------------------
public:
//! C'tor

View File

@ -37,8 +37,8 @@ class SC_SYSTEM_CORE_API BinaryRecord : public GenericRecord {
BinaryRecord();
public:
void read(std::istream &in);
void write(std::ostream &out);
void read(std::istream &in) override;
void write(std::ostream &out) override;
};
}

View File

@ -146,7 +146,7 @@ class SC_SYSTEM_CORE_API MSeedRecord: public Record {
void saveSpace() const override;
//! Returns a deep copy of the calling object.
Record* copy() const;
Record* copy() const override;
//! Sets flag specifying the encoding type of the write routine.
//! true(default) -> use the encoding of the original record; false -> use the type of the data
@ -156,10 +156,10 @@ class SC_SYSTEM_CORE_API MSeedRecord: public Record {
void setOutputRecordLength(int reclen);
//! Extract the packed MSeedRecord attributes from the given stream
void read(std::istream &in);
void read(std::istream &in) override;
//! Encode the record into the given stream
void write(std::ostream& out);
void write(std::ostream& out) override;
private:
void _setDataAttributes(int reclen, char *data) const;

View File

@ -58,9 +58,9 @@ class SC_SYSTEM_CORE_API SACRecord : public Record {
Array* data();
//! Returns the data samples if the data is available; otherwise 0
const Array* data() const;
const Array* data() const override;
const Array* raw() const;
const Array* raw() const override;
//! Sets the data sample array. The ownership goes over to the record.
void setData(Array* data);
@ -69,12 +69,12 @@ class SC_SYSTEM_CORE_API SACRecord : public Record {
void setData(int size, const void *data, Array::DataType datatype);
//! Returns a deep copy of the calling object.
SACRecord *copy() const;
SACRecord *copy() const override;
void saveSpace() const;
void saveSpace() const override;
void read(std::istream &in);
void write(std::ostream &out);
void read(std::istream &in) override;
void write(std::ostream &out) override;
private:

View File

@ -70,9 +70,9 @@ class SC_SYSTEM_CORE_API SHRecord : public Record {
Array* data();
//! Returns the data samples if the data is available; otherwise 0
const Array* data() const;
const Array* data() const override;
const Array* raw() const;
const Array* raw() const override;
//! Sets the data sample array. The ownership goes over to the record.
void setData(Array* data);
@ -81,13 +81,13 @@ class SC_SYSTEM_CORE_API SHRecord : public Record {
void setData(int size, const void *data, Array::DataType datatype);
//! Frees the memory allocated for the data samples.
void saveSpace() const {}
void saveSpace() const override {}
//! Returns a deep copy of the calling object.
SHRecord* copy() const;
SHRecord* copy() const override;
void read(std::istream &in);
void write(std::ostream &out);
void read(std::istream &in) override;
void write(std::ostream &out) override;
private:
@ -102,7 +102,7 @@ class SC_SYSTEM_CORE_API SHOutput {
SHOutput(const Record *rec);
~SHOutput();
bool put(const SHRecord *rec);
private:

View File

@ -135,8 +135,8 @@ class SC_SYSTEM_CORE_API RecordStream : public Core::InterruptibleObject {
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode,
const Seiscomp::Core::Time &startTime,
const Seiscomp::Core::Time &endTime) = 0;
const OPT(Core::Time) &startTime,
const OPT(Core::Time) &endTime) = 0;
/**
* @brief Sets the start time for all streams that haven't been
@ -144,7 +144,7 @@ class SC_SYSTEM_CORE_API RecordStream : public Core::InterruptibleObject {
* @param startTime The start time.
* @return Status flag
*/
virtual bool setStartTime(const Seiscomp::Core::Time &startTime) = 0;
virtual bool setStartTime(const OPT(Core::Time) &startTime) = 0;
/**
* @brief Sets the end time for all streams that haven't been
@ -153,14 +153,14 @@ class SC_SYSTEM_CORE_API RecordStream : public Core::InterruptibleObject {
* end time and will return as much data as is available.
* @return Status flag
*/
virtual bool setEndTime(const Seiscomp::Core::Time &endTime) = 0;
virtual bool setEndTime(const OPT(Core::Time) &endTime) = 0;
/**
* @brief Convenience function to set start time and end time.
* @param timeWindow The time window
* @return Status flag
*/
virtual bool setTimeWindow(const Seiscomp::Core::TimeWindow &timeWindow);
virtual bool setTimeWindow(const Core::TimeWindow &timeWindow);
/**
* @brief Sets an optional timeout for data retrieval. If within \p seconds
@ -247,7 +247,7 @@ class SC_SYSTEM_CORE_API RecordStream : public Core::InterruptibleObject {
// ------------------------------------------------------------------
protected:
// Does nothing
virtual void handleInterrupt(int);
virtual void handleInterrupt(int) override;
/**
* @brief Helper function to set up a created record. Basically

View File

@ -1,147 +0,0 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_IO_RECORDSTREAM_ARCLINK_H
#define SEISCOMP_IO_RECORDSTREAM_ARCLINK_H
#include <string>
#include <set>
#include <iostream>
#include <sstream>
#include <fstream>
#include <seiscomp/core/interruptible.h>
#include <seiscomp/core/datetime.h>
#include <seiscomp/utils/timer.h>
#include <seiscomp/io/recordstream.h>
#include <seiscomp/core.h>
#include <seiscomp/io/socket.h>
#include <seiscomp/io/recordstream/streamidx.h>
namespace Seiscomp {
namespace RecordStream {
namespace Arclink {
namespace _private {
class SC_SYSTEM_CORE_API ArclinkException: public Seiscomp::IO::RecordStreamException {
public:
ArclinkException(): RecordStreamException("ArcLink exception") {}
ArclinkException(const std::string& what): RecordStreamException(what) {}
};
class SC_SYSTEM_CORE_API ArclinkCommandException: public ArclinkException {
public:
ArclinkCommandException(): ArclinkException("command not accepted") {}
ArclinkCommandException(const std::string& what): ArclinkException(what) {}
};
DEFINE_SMARTPOINTER(ArclinkConnection);
class SC_SYSTEM_CORE_API ArclinkConnection : public Seiscomp::IO::RecordStream {
DECLARE_SC_CLASS(ArclinkConnection);
public:
//! C'tor
ArclinkConnection();
//! Initializing Constructor
ArclinkConnection(std::string serverloc);
//! Destructor
virtual ~ArclinkConnection();
public:
//! The recordtype cannot be selected when using an arclink
//! connection. It will always create MiniSeed records
virtual bool setRecordType(const char*);
//! Initialize the arclink connection.
virtual bool setSource(const std::string &serverloc);
//! Supply user credentials
bool setUser(std::string name, std::string password);
//! Adds the given stream to the server connection description
virtual bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode);
//! Adds the given stream to the server connection description
virtual bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode,
const Seiscomp::Core::Time &stime,
const Seiscomp::Core::Time &etime);
//! Adds the given start time to the server connection description
virtual bool setStartTime(const Seiscomp::Core::Time &stime);
//! Adds the given end time to the server connection description
virtual bool setEndTime(const Seiscomp::Core::Time &etime);
//! Sets timeout
virtual bool setTimeout(int seconds);
//! Terminates the arclink connection.
virtual void close();
virtual Record *next();
//! Removes all stream list, time window, etc. -entries from the connection description object.
bool clear();
//! Reconnects a terminated arclink connection.
bool reconnect();
private:
Seiscomp::IO::Socket _sock;
std::string _serverloc;
std::string _user;
std::string _passwd;
std::list<StreamIdx> _ordered;
std::set<StreamIdx> _streams;
Seiscomp::Core::Time _stime;
Seiscomp::Core::Time _etime;
std::string _reqID;
bool _readingData;
bool _chunkMode;
int _remainingBytes;
std::ofstream _dump;
void handshake();
void cleanup();
};
} // namespace _private
//using _private::ArclinkException;
//using _private::ArclinkCommandException;
using _private::ArclinkConnection;
using _private::ArclinkConnectionPtr;
} // namespace Arclink
} // namespace RecordStream
} // namespace Seiscomp
#endif

View File

@ -21,18 +21,21 @@
#ifndef SEISCOMP_SERVICES_RECORDSTREAM_COMBINED_H
#define SEISCOMP_SERVICES_RECORDSTREAM_COMBINED_H
#include <string>
#include <iostream>
#include <seiscomp/core/datetime.h>
#include <seiscomp/core/timewindow.h>
#include <seiscomp/io/recordstream.h>
#include <seiscomp/io/recordstream/streamidx.h>
#include <seiscomp/core.h>
namespace Seiscomp {
namespace RecordStream {
DEFINE_SMARTPOINTER(CombinedConnection);
DEFINE_SMARTPOINTER(CombinedConnection);
class SC_SYSTEM_CORE_API CombinedConnection : public IO::RecordStream {
public:
//! C'tor
@ -42,41 +45,41 @@ class SC_SYSTEM_CORE_API CombinedConnection : public IO::RecordStream {
CombinedConnection(std::string serverloc);
//! Destructor
virtual ~CombinedConnection();
~CombinedConnection() override;
virtual bool setRecordType(const char*);
bool setRecordType(const char*) override;
//! Initialize the combined connection.
virtual bool setSource(const std::string &serverloc);
bool setSource(const std::string &serverloc) override;
//! Adds the given stream to the server connection description
virtual bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode);
bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode) override;
//! Adds the given stream to the server connection description
virtual bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode,
const Seiscomp::Core::Time &startTime,
const Seiscomp::Core::Time &endTime);
bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode,
const OPT(Core::Time) &startTime,
const OPT(Core::Time) &endTime) override;
//! Adds the given start time to the server connection description
virtual bool setStartTime(const Core::Time &stime);
bool setStartTime(const OPT(Core::Time) &stime) override;
//! Adds the given end time to the server connection description
virtual bool setEndTime(const Core::Time &etime);
bool setEndTime(const OPT(Core::Time) &etime) override;
//! Sets timeout
virtual bool setTimeout(int seconds);
bool setTimeout(int seconds) override;
//! Terminates the combined connection.
virtual void close();
void close() override;
//! Returns the data stream
virtual Record *next();
Record *next() override;
private:
void init();
@ -88,8 +91,8 @@ class SC_SYSTEM_CORE_API CombinedConnection : public IO::RecordStream {
size_t _nArchive;
size_t _nRealtime;
Core::Time _startTime;
Core::Time _endTime;
OPT(Core::Time) _startTime;
OPT(Core::Time) _endTime;
Core::Time _archiveEndTime;
Core::TimeSpan _realtimeAvailability;

View File

@ -62,14 +62,14 @@ class SC_SYSTEM_CORE_API Concurrent : public IO::RecordStream {
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode,
const Seiscomp::Core::Time &startTime,
const Seiscomp::Core::Time &endTime) override;
const OPT(Seiscomp::Core::Time) &startTime,
const OPT(Seiscomp::Core::Time) &endTime) override;
//! Adds the given start time to the server connection description
bool setStartTime(const Core::Time &stime) override;
bool setStartTime(const OPT(Core::Time) &stime) override;
//! Adds the given end time to the server connection description
bool setEndTime(const Core::Time &etime) override;
bool setEndTime(const OPT(Core::Time) &etime) override;
//! Adds the given end time window to the server connection description
bool setTimeWindow(const Core::TimeWindow &w) override;

View File

@ -21,6 +21,7 @@
#ifndef SEISCOMP_RECORDSTREAM_DECIMATION_H
#define SEISCOMP_RECORDSTREAM_DECIMATION_H
#include <sstream>
#include <map>
@ -28,48 +29,49 @@
#include <seiscomp/io/recordstream.h>
#include <seiscomp/core.h>
namespace Seiscomp {
namespace RecordStream {
DEFINE_SMARTPOINTER(Decimation);
DEFINE_SMARTPOINTER(Decimation);
class SC_SYSTEM_CORE_API Decimation : public Seiscomp::IO::RecordStream {
// ----------------------------------------------------------------------
// Xstruction
// ----------------------------------------------------------------------
public:
Decimation();
virtual ~Decimation();
~Decimation() override;
// ----------------------------------------------------------------------
// Public Interface
// ----------------------------------------------------------------------
public:
virtual bool setSource(const std::string &source);
virtual bool setRecordType(const char *type);
bool setSource(const std::string &source) override;
bool setRecordType(const char *type) override;
virtual bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode);
bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode) override;
virtual bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode,
const Seiscomp::Core::Time &stime,
const Seiscomp::Core::Time &etime);
bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode,
const OPT(Core::Time) &stime,
const OPT(Core::Time) &etime) override;
virtual bool setStartTime(const Seiscomp::Core::Time &stime);
virtual bool setEndTime(const Seiscomp::Core::Time &etime);
virtual bool setTimeWindow(const Seiscomp::Core::TimeWindow &w);
bool setStartTime(const OPT(Core::Time) &stime) override;
bool setEndTime(const OPT(Core::Time) &etime) override;
bool setTimeWindow(const Core::TimeWindow &w) override;
virtual bool setTimeout(int seconds);
bool setTimeout(int seconds) override;
virtual void close();
void close() override;
virtual Record *next();
Record *next() override;
// ----------------------------------------------------------------------
@ -124,10 +126,10 @@ class SC_SYSTEM_CORE_API Decimation : public Seiscomp::IO::RecordStream {
size_t front;
// Time of front of ring buffer
Core::Time startTime;
OPT(Core::Time) startTime;
// End time of last record
Core::Time lastEndTime;
OPT(Core::Time) lastEndTime;
ResampleStage *nextStage;
@ -135,10 +137,12 @@ class SC_SYSTEM_CORE_API Decimation : public Seiscomp::IO::RecordStream {
missingSamples = buffer.size();
front = 0;
samplesToSkip = 0;
startTime = Core::Time();
lastEndTime = Core::Time();
startTime = Core::None;
lastEndTime = Core::None;
if ( nextStage ) nextStage->reset();
if ( nextStage ) {
nextStage->reset();
}
}
};

View File

@ -46,40 +46,42 @@ class SC_SYSTEM_CORE_API FDSNWSConnectionBase : public IO::RecordStream {
public:
//! The recordtype cannot be selected when using an arclink
//! connection. It will always create MiniSeed records
virtual bool setRecordType(const char *type);
bool setRecordType(const char *type) override;
//! Initialize the arclink connection.
virtual bool setSource(const std::string &source);
bool setSource(const std::string &source) override;
//! Supply user credentials
//! Adds the given stream to the server connection description
virtual bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode);
bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode) override;
//! Adds the given stream to the server connection description
virtual bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode,
const Core::Time &startTime,
const Core::Time &endTime);
bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode,
const OPT(Core::Time) &startTime,
const OPT(Core::Time) &endTime) override;
//! Adds the given start time to the server connection description
virtual bool setStartTime(const Core::Time &startTime);
bool setStartTime(const OPT(Core::Time) &startTime) override;
//! Adds the given end time to the server connection description
virtual bool setEndTime(const Core::Time &endTime);
bool setEndTime(const OPT(Core::Time) &endTime) override;
//! Sets timeout
virtual bool setTimeout(int seconds);
bool setTimeout(int seconds) override;
//! Terminates the arclink connection.
virtual void close();
void close() override;
virtual Record *next();
Record *next() override;
private:
//! Reconnects a terminated arclink connection.
bool reconnect();
@ -103,8 +105,8 @@ class SC_SYSTEM_CORE_API FDSNWSConnectionBase : public IO::RecordStream {
std::string _url;
int _defaultPort;
std::set<StreamIdx> _streams;
Core::Time _stime;
Core::Time _etime;
OPT(Core::Time) _stime;
OPT(Core::Time) _etime;
std::string _reqID;
bool _readingData;
bool _chunkMode;

View File

@ -77,11 +77,11 @@ class SC_SYSTEM_CORE_API File : public Seiscomp::IO::RecordStream {
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode,
const Seiscomp::Core::Time &startTime,
const Seiscomp::Core::Time &endTime) override;
const OPT(Seiscomp::Core::Time) &startTime,
const OPT(Seiscomp::Core::Time) &endTime) override;
bool setStartTime(const Seiscomp::Core::Time &startTime) override;
bool setEndTime(const Seiscomp::Core::Time &endTime) override;
bool setStartTime(const OPT(Seiscomp::Core::Time) &startTime) override;
bool setEndTime(const OPT(Seiscomp::Core::Time) &endTime) override;
void close() override;
@ -107,27 +107,28 @@ class SC_SYSTEM_CORE_API File : public Seiscomp::IO::RecordStream {
private:
struct TimeWindowFilter {
TimeWindowFilter() {}
TimeWindowFilter(const Core::Time &stime, const Core::Time &etime)
TimeWindowFilter(const OPT(Core::Time) &stime,
const OPT(Core::Time) &etime)
: start(stime), end(etime) {}
Core::Time start;
Core::Time end;
OPT(Core::Time) start;
OPT(Core::Time) end;
};
using FilterMap = std::map<std::string, TimeWindowFilter>;
using ReFilterList = std::vector<std::pair<std::string,TimeWindowFilter> >;
const TimeWindowFilter* findTimeWindowFilter(Record *rec);
const TimeWindowFilter *findTimeWindowFilter(Record *rec);
RecordFactory *_factory{nullptr};
std::string _name;
bool _closeRequested;
std::fstream _fstream;
std::istream *_current{&_fstream};
FilterMap _filter;
ReFilterList _reFilter;
Core::Time _startTime;
Core::Time _endTime;
RecordFactory *_factory{nullptr};
std::string _name;
bool _closeRequested;
std::fstream _fstream;
std::istream *_current{&_fstream};
FilterMap _filter;
ReFilterList _reFilter;
OPT(Core::Time) _startTime;
OPT(Core::Time) _endTime;
};

View File

@ -32,9 +32,10 @@
#include <seiscomp/io/httpsocket.h>
#include <seiscomp/io/recordstream/streamidx.h>
extern "C" {
#include "bson/bson.h"
}
struct _bson_t;
typedef bson_t _bson_t;
namespace Seiscomp {
namespace RecordStream {
@ -50,7 +51,8 @@ class SC_SYSTEM_CORE_API HMBQueue {
//! Adds the given stream
void addStream(std::string loc, std::string cha,
const Seiscomp::Core::Time &stime, const Seiscomp::Core::Time &etime);
const OPT(Core::Time) &stime,
const OPT(Core::Time) &etime);
//! Sets the sequence number
void setSequenceNumber(int64_t seq);
@ -62,9 +64,9 @@ class SC_SYSTEM_CORE_API HMBQueue {
bson_t* toBSON() const;
private:
Core::Time _stime;
Core::Time _etime;
int64_t _seq;
OPT(Core::Time) _stime;
OPT(Core::Time) _etime;
int64_t _seq;
std::set<std::string> _topics;
};
@ -81,44 +83,46 @@ class SC_SYSTEM_CORE_API HMBConnection : public Seiscomp::IO::RecordStream {
HMBConnection(std::string serverloc);
//! Destructor
virtual ~HMBConnection();
~HMBConnection() override;
//! The recordtype cannot be selected when using an HMB
//! connection. It will always create MiniSeed records
virtual bool setRecordType(const char *type);
bool setRecordType(const char *type) override;
//! Initialize the HMB connection.
virtual bool setSource(const std::string &source);
bool setSource(const std::string &source) override;
//! Supply user credentials
//! Adds the given stream to the server connection description
virtual bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode);
bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode) override;
//! Adds the given stream to the server connection description
virtual bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode,
const Seiscomp::Core::Time &startTime,
const Seiscomp::Core::Time &endTime);
bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode,
const OPT(Core::Time) &startTime,
const OPT(Core::Time) &endTime) override;
//! Adds the given start time to the server connection description
virtual bool setStartTime(const Seiscomp::Core::Time &stime);
bool setStartTime(const OPT(Core::Time) &stime) override;
//! Adds the given end time to the server connection description
virtual bool setEndTime(const Seiscomp::Core::Time &etime);
bool setEndTime(const OPT(Core::Time) &etime) override;
//! Sets timeout
virtual bool setTimeout(int seconds);
bool setTimeout(int seconds) override;
//! Terminates the HMB connection.
virtual void close();
void close() override;
virtual Record *next();
Record *next() override;
private:
//! Removes all stream list, time window, etc. -entries from the connection description object.
bool clear();
@ -127,18 +131,18 @@ class SC_SYSTEM_CORE_API HMBConnection : public Seiscomp::IO::RecordStream {
private:
IO::HttpSocket<SocketType> _sock;
std::string _serverHost;
std::string _serverPath;
std::string _user;
std::string _password;
IO::HttpSocket<SocketType> _sock;
std::string _serverHost;
std::string _serverPath;
std::string _user;
std::string _password;
std::set<Seiscomp::RecordStream::StreamIdx> _streams;
Seiscomp::Core::Time _stime;
Seiscomp::Core::Time _etime;
std::map<std::string, HMBQueue> _queues;
std::string _sid;
std::string _cid;
bool _readingData;
OPT(Core::Time) _stime;
OPT(Core::Time) _etime;
std::map<std::string, HMBQueue> _queues;
std::string _sid;
std::string _cid;
bool _readingData;
std::string bsonGetString(const bson_t *bson, const char *key);
int64_t bsonGetInt(const bson_t *bson, const char *key);

View File

@ -52,27 +52,27 @@ class SC_SYSTEM_CORE_API Memory: public Seiscomp::IO::RecordStream {
public:
Memory &operator=(const Memory &mem);
virtual bool setSource(const std::string &);
virtual bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode);
bool setSource(const std::string &) override;
bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode) override;
virtual bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode,
const Seiscomp::Core::Time &startTime,
const Seiscomp::Core::Time &endTime);
bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode,
const OPT(Seiscomp::Core::Time) &startTime,
const OPT(Seiscomp::Core::Time) &endTime) override;
virtual bool setStartTime(const Seiscomp::Core::Time &stime);
virtual bool setEndTime(const Seiscomp::Core::Time &etime);
bool setStartTime(const OPT(Seiscomp::Core::Time) &stime) override;
bool setEndTime(const OPT(Seiscomp::Core::Time) &etime) override;
virtual void close();
void close() override;
virtual bool setRecordType(const char *type);
bool setRecordType(const char *type) override;
Record *next();
Record *next() override;
private:

View File

@ -21,6 +21,7 @@
#ifndef SEISCOMP_RECORDSTREAM_RESAMPLE_H
#define SEISCOMP_RECORDSTREAM_RESAMPLE_H
#include <sstream>
#include <map>
#include <deque>
@ -48,30 +49,30 @@ class SC_SYSTEM_CORE_API Resample : public Seiscomp::IO::RecordStream {
// Public Interface
// ----------------------------------------------------------------------
public:
virtual bool setSource(const std::string &source);
virtual bool setRecordType(const char *type);
virtual bool setSource(const std::string &source) override;
virtual bool setRecordType(const char *type) override;
virtual bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode);
const std::string &channelCode) override;
virtual bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode,
const Seiscomp::Core::Time &startTime,
const Seiscomp::Core::Time &endTime);
const OPT(Core::Time) &startTime,
const OPT(Core::Time) &endTime) override;
virtual bool setStartTime(const Seiscomp::Core::Time &stime);
virtual bool setEndTime(const Seiscomp::Core::Time &etime);
virtual bool setTimeWindow(const Seiscomp::Core::TimeWindow &w);
virtual bool setStartTime(const OPT(Core::Time) &stime) override;
virtual bool setEndTime(const OPT(Core::Time) &etime) override;
virtual bool setTimeWindow(const Core::TimeWindow &w) override;
virtual bool setTimeout(int seconds);
virtual bool setTimeout(int seconds) override;
virtual void close();
virtual void close() override;
virtual Record *next();
virtual Record *next() override;
// ----------------------------------------------------------------------

View File

@ -48,36 +48,36 @@ class SDSArchive : public Seiscomp::IO::RecordStream {
public:
SDSArchive();
SDSArchive(const std::string arcroot);
virtual ~SDSArchive();
~SDSArchive() override;
// ----------------------------------------------------------------------
// Public Interface
// ----------------------------------------------------------------------
public:
virtual bool setSource(const std::string &source);
bool setSource(const std::string &source) override;
virtual bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode);
bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode) override;
virtual bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode,
const Seiscomp::Core::Time &startTime,
const Seiscomp::Core::Time &endTime);
bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode,
const OPT(Core::Time) &startTime,
const OPT(Core::Time) &endTime) override;
virtual bool setStartTime(const Seiscomp::Core::Time &stime);
virtual bool setEndTime(const Seiscomp::Core::Time &etime);
virtual bool setTimeWindow(const Seiscomp::Core::TimeWindow &tw);
bool setStartTime(const OPT(Core::Time) &stime) override;
bool setEndTime(const OPT(Core::Time) &etime) override;
bool setTimeWindow(const Core::TimeWindow &tw) override;
virtual bool setTimeout(int seconds);
bool setTimeout(int seconds) override;
virtual void close();
void close() override;
virtual Seiscomp::Record *next();
Record *next() override;
// ----------------------------------------------------------------------
@ -90,8 +90,8 @@ class SDSArchive : public Seiscomp::IO::RecordStream {
const std::string& loc, const std::string& cha);
Index(const std::string& net, const std::string& sta,
const std::string& loc, const std::string& cha,
const Seiscomp::Core::Time& stime,
const Seiscomp::Core::Time& etime);
const OPT(Core::Time) &stime,
const OPT(Core::Time) &etime);
Index &operator=(const Index &other);
bool operator<(const Index &other) const;
@ -102,19 +102,20 @@ class SDSArchive : public Seiscomp::IO::RecordStream {
std::string sta;
std::string loc;
std::string cha;
mutable Seiscomp::Core::Time stime;
mutable Seiscomp::Core::Time etime;
mutable OPT(Core::Time) stime;
mutable OPT(Core::Time) etime;
};
typedef std::set<Index> IndexSet;
typedef std::list<Index> IndexList;
typedef std::pair<std::string,bool> File;
typedef std::queue<File> FileQueue;
using IndexSet = std::set<Index>;
using IndexList = std::list<Index>;
using File = std::pair<std::string,bool>;
using FileQueue = std::queue<File>;
std::vector<std::string> _arcroots;
Seiscomp::Core::Time _stime;
Seiscomp::Core::Time _etime;
OPT(Core::Time) _stime;
OPT(Core::Time) _etime;
IndexList _orderedRequests;
IndexSet _streamSet;
IndexList::iterator _curiter;

View File

@ -21,6 +21,7 @@
#ifndef SEISCOMP_IO_RECORDSTREAM_SLINK_H
#define SEISCOMP_IO_RECORDSTREAM_SLINK_H
#include <string>
#include <set>
#include <iostream>
@ -58,14 +59,16 @@ class SC_SYSTEM_CORE_API SLStreamIdx {
SLStreamIdx(const std::string &net, const std::string &sta,
const std::string &loc, const std::string &cha,
const Seiscomp::Core::Time &stime,
const Seiscomp::Core::Time &etime);
const OPT(Core::Time) &stime,
const OPT(Core::Time) &etime);
public:
SLStreamIdx& operator=(const SLStreamIdx &other);
bool operator<(const SLStreamIdx &other) const;
bool operator==(const SLStreamIdx &other) const;
public:
//! Returns the network code
const std::string &network() const;
@ -83,30 +86,29 @@ class SC_SYSTEM_CORE_API SLStreamIdx {
std::string selector() const;
//! Returns the start time
Core::Time startTime() const;
const OPT(Core::Time) &startTime() const;
//! Returns the end time
Core::Time endTime() const;
const OPT(Core::Time) &endTime() const;
//! Returns the most recent record end time
Seiscomp::Core::Time timestamp() const;
const OPT(Core::Time) &timestamp() const;
//! Sets the time stamp
void setTimestamp(Seiscomp::Core::Time &rectime) const;
void setTimestamp(const OPT(Core::Time) &rectime) const;
private:
const std::string _net;
const std::string _sta;
const std::string _loc;
const std::string _cha;
const Core::Time _stime;
const Core::Time _etime;
mutable Core::Time _timestamp;
const std::string _net;
const std::string _sta;
const std::string _loc;
const std::string _cha;
const OPT(Core::Time) _stime;
const OPT(Core::Time) _etime;
mutable OPT(Core::Time) _timestamp;
};
DEFINE_SMARTPOINTER(SLConnection);
class SC_SYSTEM_CORE_API SLConnection : public Seiscomp::IO::RecordStream {
DECLARE_SC_CLASS(SLConnection);
@ -118,44 +120,46 @@ class SC_SYSTEM_CORE_API SLConnection : public Seiscomp::IO::RecordStream {
SLConnection(std::string serverloc);
//! Destructor
virtual ~SLConnection();
~SLConnection() override;
public:
//! The recordtype cannot be selected when using a seedlink
//! connection. It will always create MiniSeed records
virtual bool setRecordType(const char*);
bool setRecordType(const char*) override;
//! Initialize the seedlink connection.
virtual bool setSource(const std::string &source);
bool setSource(const std::string &source) override;
//! Adds the given stream to the server connection description
virtual bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode);
bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode) override;
//! Adds a seismic stream request to the record stream (not implemented)
virtual bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode,
const Seiscomp::Core::Time &startTime,
const Seiscomp::Core::Time &endTime);
bool addStream(const std::string &networkCode,
const std::string &stationCode,
const std::string &locationCode,
const std::string &channelCode,
const OPT(Core::Time) &startTime,
const OPT(Core::Time) &endTime) override;
//! Adds the given start time to the server connection description
virtual bool setStartTime(const Seiscomp::Core::Time &startTime);
bool setStartTime(const OPT(Core::Time) &startTime) override;
//! Adds the given end time to the server connection description
virtual bool setEndTime(const Seiscomp::Core::Time &endTime);
bool setEndTime(const OPT(Core::Time) &endTime) override;
//! Sets timeout
virtual bool setTimeout(int seconds);
bool setTimeout(int seconds) override;
//! Disconnects and terminates (!) the seedlink connection.
virtual void close();
void close() override;
private:
//! Reads the data stream
virtual Record *next();
virtual Record *next() override;
//! Removes all stream list, time window, etc. -entries from the connection description object.
bool clear();
@ -163,8 +167,6 @@ class SC_SYSTEM_CORE_API SLConnection : public Seiscomp::IO::RecordStream {
//! Reconnects a terminated seedlink connection.
bool reconnect();
private:
void handshake();
@ -172,7 +174,7 @@ class SC_SYSTEM_CORE_API SLConnection : public Seiscomp::IO::RecordStream {
class StreamBuffer : public std::streambuf {
public:
StreamBuffer();
std::streambuf *setbuf(char *s, std::streamsize n);
std::streambuf *setbuf(char *s, std::streamsize n) override;
};
StreamBuffer _streambuf;
@ -180,8 +182,8 @@ class SC_SYSTEM_CORE_API SLConnection : public Seiscomp::IO::RecordStream {
std::string _slrecord;
IO::Socket _sock;
std::set<SLStreamIdx> _streams;
Core::Time _stime;
Core::Time _etime;
OPT(Core::Time) _stime;
OPT(Core::Time) _etime;
bool _readingData;
bool _useBatch;
int _maxRetries;
@ -192,4 +194,5 @@ class SC_SYSTEM_CORE_API SLConnection : public Seiscomp::IO::RecordStream {
}
}
#endif
#endif

View File

@ -21,38 +21,42 @@
#ifndef SEISCOMP_IO_RECORDSTREAM_STREAMIDX_H
#define SEISCOMP_IO_RECORDSTREAM_STREAMIDX_H
#include <string>
#include <seiscomp/core.h>
#include <seiscomp/core/datetime.h>
#include <seiscomp/core/optional.h>
namespace Seiscomp {
namespace RecordStream {
class SC_SYSTEM_CORE_API StreamIdx {
public:
StreamIdx();
StreamIdx(const std::string& net, const std::string& sta,
const std::string& loc, const std::string& cha);
StreamIdx(const std::string &net, const std::string &sta,
const std::string &loc, const std::string &cha);
StreamIdx(const std::string& net, const std::string& sta,
const std::string& loc, const std::string& cha,
const Seiscomp::Core::Time& stime,
const Seiscomp::Core::Time& etime);
StreamIdx(const std::string &net, const std::string &sta,
const std::string &loc, const std::string &cha,
const OPT(Seiscomp::Core::Time) &stime,
const OPT(Seiscomp::Core::Time) &etime);
public:
StreamIdx& operator=(const StreamIdx &other);
bool operator<(const StreamIdx &other) const;
bool operator!=(const StreamIdx &other) const;
bool operator==(const StreamIdx &other) const;
bool operator>=(const StreamIdx &other) const;
bool operator>(const StreamIdx &other) const;
bool operator<=(const StreamIdx &other) const;
public:
//! Returns the network code
const std::string &network() const;
@ -66,27 +70,29 @@ class SC_SYSTEM_CORE_API StreamIdx {
const std::string &location() const;
//! Returns the start time
Core::Time startTime() const;
const OPT(Core::Time) &startTime() const;
//! Returns the end time
Core::Time endTime() const;
const OPT(Core::Time) &endTime() const;
//! Returns a string: <sTime> <eTime> <network> <station> <channel> <location>
//! <*Time> in format: %Y,%m,%d,%H,%M,%S
std::string str(const Seiscomp::Core::Time& stime,
const Seiscomp::Core::Time& etime) const;
std::string str(const OPT(Seiscomp::Core::Time) &stime,
const OPT(Seiscomp::Core::Time) &etime) const;
private:
const std::string _net;
const std::string _sta;
const std::string _loc;
const std::string _cha;
const Seiscomp::Core::Time _stime;
const Seiscomp::Core::Time _etime;
const std::string _net;
const std::string _sta;
const std::string _loc;
const std::string _cha;
const OPT(Seiscomp::Core::Time) _stime;
const OPT(Seiscomp::Core::Time) _etime;
};
} // namespace RecordStream
} // namespace Seiscomp
#endif

View File

@ -91,7 +91,7 @@ class SC_SYSTEM_CORE_API Socket: public Seiscomp::Core::InterruptibleObject {
int takeFd();
protected:
void handleInterrupt(int) throw();
void handleInterrupt(int) throw() override;
virtual int readImpl(char *buf, int count);
virtual int writeImpl(const char *buf, int count);

View File

@ -61,21 +61,22 @@ class SC_SYSTEM_CORE_API Exporter : public IO::Exporter, public OutputHandler {
virtual void collectNamespaces(Core::BaseObject *);
//! Interface method that must be implemented by real exporters.
virtual bool put(std::streambuf* buf, Core::BaseObject *);
virtual bool put(std::streambuf* buf, const ExportObjectList &);
virtual bool put(std::streambuf* buf, Core::BaseObject *) override;
virtual bool put(std::streambuf* buf, const ExportObjectList &) override;
// ------------------------------------------------------------------
// Private interface
// ------------------------------------------------------------------
private:
void handle(Core::BaseObject *, const char *tag, const char *ns, NodeHandler *);
bool openElement(const char *name, const char *ns);
void addAttribute(const char *name, const char *ns, const char *value);
void closeElement(const char *name, const char *ns);
void handle(Core::BaseObject *, const char *tag, const char *ns, NodeHandler *) override;
bool openElement(const char *name, const char *ns) override;
void addAttribute(const char *name, const char *ns, const char *value) override;
void closeElement(const char *name, const char *ns) override;
void put(const char *content);
void put(const char *content) override;
void writeAttrString(const char *str);
void writeString(const char *str);

View File

@ -35,8 +35,8 @@ namespace IO {
namespace XML {
typedef std::vector<Core::BaseObject *> ChildList;
typedef std::set<std::string> TagSet;
using ChildList = std::vector<Core::BaseObject*>;
using TagSet = std::set<std::string>;
struct SC_SYSTEM_CORE_API NodeHandler;
@ -113,7 +113,7 @@ class PropertyHandler : public MemberHandler {
PropertyHandler(const Core::MetaProperty *prop)
: _property(prop) {}
std::string value(Core::BaseObject *obj) {
std::string value(Core::BaseObject *obj) override {
try {
return _property->readString(obj);
}
@ -123,7 +123,7 @@ class PropertyHandler : public MemberHandler {
}
bool put(Core::BaseObject *object, const char *tag, const char *ns,
bool opt, OutputHandler *output, NodeHandler *h) {
bool opt, OutputHandler *output, NodeHandler *h) override {
if ( _property->isClass() ) {
try {
output->handle(boost::any_cast<Core::BaseObject*>(_property->read(object)), tag, ns);
@ -137,8 +137,8 @@ class PropertyHandler : public MemberHandler {
return false;
}
bool get(Core::BaseObject *object, void *, NodeHandler *);
bool finalize(Core::BaseObject *parent, Core::BaseObject *member);
bool get(Core::BaseObject *object, void *, NodeHandler *) override;
bool finalize(Core::BaseObject *parent, Core::BaseObject *member) override;
private:
const Core::MetaProperty *_property;
@ -150,10 +150,10 @@ class ChildPropertyHandler : public MemberHandler {
ChildPropertyHandler(const Core::MetaProperty *prop)
: _property(prop) {}
std::string value(Core::BaseObject *obj) { return ""; }
std::string value(Core::BaseObject *obj) override { return ""; }
bool put(Core::BaseObject *object, const char *tag, const char *ns,
bool opt, OutputHandler *output, NodeHandler *h) {
bool opt, OutputHandler *output, NodeHandler *h) override {
size_t count = _property->arrayElementCount(object);
for ( size_t i = 0; i < count; ++i ) {
output->handle(_property->arrayObject(object, i), tag, ns);
@ -161,12 +161,12 @@ class ChildPropertyHandler : public MemberHandler {
return true;
}
bool get(Core::BaseObject *object, void *, NodeHandler *h) {
bool get(Core::BaseObject *object, void *, NodeHandler *h) override {
h->propagate(_property->createClass(), true, true);
return true;
}
bool finalize(Core::BaseObject *parent, Core::BaseObject *child) {
bool finalize(Core::BaseObject *parent, Core::BaseObject *child) override {
if ( child )
return _property->arrayAddObject(parent, child);
return false;
@ -193,11 +193,11 @@ struct SC_SYSTEM_CORE_API TypeNameHandler : public TypeHandler {
TypeNameHandler(NodeHandler *nh, const char *cn)
: TypeHandler(nh), classname(cn) {}
Core::BaseObject *createClass() {
Core::BaseObject *createClass() override {
return Core::ClassFactory::Create(classname.c_str());
}
const char *className() {
const char *className() override {
return classname.c_str();
}
@ -209,11 +209,11 @@ template <typename T>
struct TypeStaticHandler : public TypeHandler {
TypeStaticHandler(NodeHandler *nh) : TypeHandler(nh) {}
Core::BaseObject *createClass() {
Core::BaseObject *createClass() override {
return new T();
}
const char *className() {
const char *className() override {
return T::ClassName();
}
};
@ -282,14 +282,14 @@ struct SC_SYSTEM_CORE_API MemberNodeHandler {
struct SC_SYSTEM_CORE_API NoneHandler : public NodeHandler {
bool put(Core::BaseObject *obj, const char *tag, const char *ns, OutputHandler *output);
bool get(Core::BaseObject *obj, void *n);
bool put(Core::BaseObject *obj, const char *tag, const char *ns, OutputHandler *output) override;
bool get(Core::BaseObject *obj, void *n) override;
};
struct SC_SYSTEM_CORE_API GenericHandler : public NodeHandler {
bool put(Core::BaseObject *obj, const char *tag, const char *ns, OutputHandler *output);
bool get(Core::BaseObject *, void *n);
bool put(Core::BaseObject *obj, const char *tag, const char *ns, OutputHandler *output) override;
bool get(Core::BaseObject *, void *n) override;
TypeMap *mapper;
};
@ -321,9 +321,9 @@ struct SC_SYSTEM_CORE_API ClassHandler : public NodeHandler {
void addMember(const char *t, const char *ns, Type opt, Location l, MemberHandler *s);
void addChild(const char *t, const char *ns, MemberHandler *s);
bool init(Core::BaseObject *obj, void *n, TagSet &mandatoryTags);
bool get(Core::BaseObject *obj, void *n);
bool put(Core::BaseObject *obj, const char *tag, const char *ns, OutputHandler *output);
bool init(Core::BaseObject *obj, void *n, TagSet &mandatoryTags) override;
bool get(Core::BaseObject *obj, void *n) override;
bool put(Core::BaseObject *obj, const char *tag, const char *ns, OutputHandler *output) override;
MemberRefList orderedMembers;
MemberList attributes;

View File

@ -64,7 +64,7 @@ class SC_SYSTEM_CORE_API Importer : public IO::Importer {
void setRootName(std::string);
//! Interface method that must be implemented by real importers.
virtual Core::BaseObject *get(std::streambuf* buf);
virtual Core::BaseObject *get(std::streambuf* buf) override;
// ------------------------------------------------------------------