Install SeisComP and scanloc ARM64 nightly packages

This commit is contained in:
Enrico Ellguth
2025-10-29 12:34:04 +00:00
parent 2ff097f9d1
commit 165b829fb7
606 changed files with 24438 additions and 16358 deletions

View File

@ -107,6 +107,15 @@ class SC_BROKER_API Client {
bool setDiscardSelf(bool enable);
bool discardSelf() const;
/**
* @brief Sets whether to receive only status messages or all
* messages. The default is false.
* @param enable The enable flat
* @return Success flag
*/
bool setStatusOnly(bool enable);
bool statusOnly() const;
/**
* @brief Sets the number of messages required to send back an
* acknoledgement.
@ -171,10 +180,11 @@ class SC_BROKER_API Client {
std::string _name;
bool _wantsMembershipInformation{false};
bool _discardSelf{false};
bool _statusOnly{false};
SequenceNumber _sequenceNumber{0};
SequenceNumber _acknowledgeWindow{20};
SequenceNumber _acknowledgeCounter{20};
Core::Time _ackInitiated;
OPT(Core::Time) _ackInitiated;
int _inactivityCounter{0}; // The number of seconds
// of inactivity
@ -198,6 +208,10 @@ inline bool Client::discardSelf() const {
return _discardSelf;
}
inline bool Client::statusOnly() const {
return _statusOnly;
}
inline void *Client::memory(int offset) {
return _heap + offset;
}

View File

@ -74,6 +74,7 @@ namespace Protocol {
#define SCMP_PROTO_CMD_CONNECT_HEADER_CLIENT_NAME "Client-Name"
#define SCMP_PROTO_CMD_CONNECT_HEADER_MEMBERSHIP_INFO "Membership-Info"
#define SCMP_PROTO_CMD_CONNECT_HEADER_SELF_DISCARD "Self-Discard"
#define SCMP_PROTO_CMD_CONNECT_HEADER_STATUS_ONLY "Status-Only"
#define SCMP_PROTO_CMD_CONNECT_HEADER_ACK_WINDOW "Ack-Window"
#define SCMP_PROTO_CMD_CONNECT_HEADER_SEQ_NUMBER "Seq-No"
#define SCMP_PROTO_CMD_CONNECT_HEADER_SUBSCRIPTIONS "Subscriptions"

View File

@ -387,7 +387,7 @@ class SC_BROKER_API Queue {
TaskQueue _tasks;
TaskQueue _results;
Core::Time _created;
Core::Time _lastSOHTimestamp;
OPT(Core::Time) _lastSOHTimestamp;
int _allocatedClientHeap;
int _sohInterval;
int _inactivityLimit;

View File

@ -87,7 +87,7 @@ class SC_SYSTEM_CLIENT_API ApplicationStatusMessage : public Core::Message {
public:
virtual bool empty() const;
virtual bool empty() const override;
const std::string &module() const;
const std::string &username() const;
@ -191,7 +191,7 @@ class SC_SYSTEM_CLIENT_API Application : public System::Application {
* Exit the application and set the returnCode.
* @param returnCode The value returned from exec()
*/
virtual void exit(int returnCode);
virtual void exit(int returnCode) override;
//! Returns the application's messaging connection interface
Client::Connection *connection() const;
@ -543,6 +543,14 @@ class SC_SYSTEM_CLIENT_API Application : public System::Application {
*/
virtual void handleTimeout();
/**
* This method is called when the internal SOH checks are performed
* as an additional state-of-health callback in derived classes.
* The default implementation does nothing.
* This method has been added with API 17.
*/
virtual void handleSOH();
/**
* This method is called when close event is sent to the application.
* The default handler returns true and causes the event queue to
@ -651,10 +659,6 @@ class SC_SYSTEM_CLIENT_API Application : public System::Application {
std::string customPublicIDPattern;
std::string configModuleName{"trunk"};
bool enableFetchDatabase{true};
bool enableLoadStations{false};
bool enableLoadInventory{false};
bool enableLoadConfigModule{false};
bool enableAutoApplyNotifier{true};
bool enableInterpretNotifier{true};
@ -672,6 +676,13 @@ class SC_SYSTEM_CLIENT_API Application : public System::Application {
struct Database {
void accept(SettingsLinker &linker);
// State variables
bool enableFetch{true};
bool enableStations{false};
bool enableInventory{false};
bool enableConfigModule{false};
// Configuration variables
bool enable{true};
bool showDrivers{false};
@ -736,6 +747,7 @@ class SC_SYSTEM_CLIENT_API Application : public System::Application {
StringVector agencyAllowlist;
StringVector agencyBlocklist;
Util::StringFirewall firewall;
StringVector amplitudeAliases;
StringVector magnitudeAliases;
} processing;
@ -762,7 +774,7 @@ class SC_SYSTEM_CLIENT_API Application : public System::Application {
IO::DatabaseInterfacePtr _database;
Util::Timer _userTimer;
Util::Timer _sohTimer;
Core::Time _sohLastUpdate;
OPT(Core::Time) _sohLastUpdate;
std::mutex _objectLogMutex;
};

View File

@ -55,8 +55,8 @@ class SC_SYSTEM_CLIENT_API StreamApplication : public Application {
const std::string& locationCode,
const std::string& channelCode);
void setStartTime(const Seiscomp::Core::Time&);
void setEndTime(const Seiscomp::Core::Time&);
void setStartTime(const OPT(Seiscomp::Core::Time) &);
void setEndTime(const OPT(Seiscomp::Core::Time) &);
bool setTimeWindow(const Seiscomp::Core::TimeWindow&);
//! Sets whether to start the acquisition automatically
@ -91,12 +91,12 @@ class SC_SYSTEM_CLIENT_API StreamApplication : public Application {
// Protected interface
// ----------------------------------------------------------------------
protected:
bool init();
bool run();
void done();
void exit(int returnCode);
bool init() override;
bool run() override;
void done() override;
void exit(int returnCode) override;
bool dispatch(Core::BaseObject* obj);
bool dispatch(Core::BaseObject* obj) override;
void readRecords(bool sendEndNotification);
@ -120,7 +120,7 @@ class SC_SYSTEM_CLIENT_API StreamApplication : public Application {
virtual void handleRecord(Record *rec) = 0;
//! Logs the received records for the last period
virtual void handleMonitorLog(const Core::Time &timestamp);
virtual void handleMonitorLog(const Core::Time &timestamp) override;
private:

View File

@ -18,8 +18,8 @@
***************************************************************************/
#ifndef __SEISCOMP_CONFIG_H__
#define __SEISCOMP_CONFIG_H__
#ifndef SEISCOMP_CONFIG_H
#define SEISCOMP_CONFIG_H
#include <iostream>
@ -34,13 +34,15 @@
#include <seiscomp/config/exceptions.h>
#include <seiscomp/config/symboltable.h>
namespace Seiscomp {
namespace Config {
/**
* Mapping of configuration variable to type
*/
typedef std::map<std::string, std::string> Variables;
using Variables = std::map<std::string, std::string>;
/**
@ -61,21 +63,13 @@ class SC_CONFIG_API Config {
// Public interface
// ------------------------------------------------------------------------
public:
/** When names are queried and this check is enabled, it will
* throw an exception if the same name is defined in a later stage
* with respect to case insensitive name comparison.
* This allows to check for parameter inconsistencies that are
* hard to track otherwise.
*/
void setCaseSensitivityCheck(bool);
/** Reads the given configuration file.
* @param file name of the configuration files
* @param stage Optional stage value to be set to each read symbol
* @param raw Raw mode which does not resolv references like ${var}
* @return true on success
*/
bool readConfig(const std::string& file, int stage=-1, bool raw=false);
bool readConfig(const std::string &file, int stage=-1, bool raw = false);
/** Writes the configuration to the given configuration file.
* @param file name of the configuarion files
@ -83,7 +77,7 @@ class SC_CONFIG_API Config {
* new entries
* @return true on success
*/
bool writeConfig(const std::string& file, bool localOny = true,
bool writeConfig(const std::string &file, bool localOny = true,
bool multilineLists = false);
/** Writes the configuration to the file which was given to
@ -110,70 +104,108 @@ class SC_CONFIG_API Config {
//! Gets an integer from the configuration file
//! @param name name of the element
//! @return value
int getInt(const std::string& name) const;
int getInt(const std::string& name, bool* error) const;
bool getInt(int& value, const std::string& name) const;
int getInt(const std::string &name) const;
int getInt(const std::string &name, bool *error) const;
bool getInt(int &value, const std::string &name) const;
bool setInt(const std::string& name, int value);
bool setInt(const std::string &name, int value);
/** Gets a double from the configuration file
* @param name name of the element
* @return double
*/
double getDouble(const std::string& name) const;
double getDouble(const std::string& name, bool* error) const;
bool getDouble(double& value, const std::string& name) const;
double getDouble(const std::string &name) const;
double getDouble(const std::string &name, bool *error) const;
bool getDouble(double& value, const std::string &name) const;
bool setDouble(const std::string& name, double value);
bool setDouble(const std::string &name, double value);
/** Gets an boolean from the configuration file
* @param name name of the element
* @return boolean
*/
bool getBool(const std::string& name) const;
bool getBool(const std::string& name, bool* error) const;
bool getBool(bool& value, const std::string& name) const;
bool getBool(const std::string &name) const;
bool getBool(const std::string &name, bool *error) const;
bool getBool(bool &value, const std::string &name) const;
bool setBool(const std::string& name, bool value);
bool setBool(const std::string &name, bool value);
/** Gets a string from the configuration file
* @param name name of the element
* @return string
*/
std::string getString(const std::string& name) const;
std::string getString(const std::string& name, bool* error) const;
bool getString(std::string& value, const std::string& name) const;
std::string getString(const std::string &name) const;
std::string getString(const std::string &name, bool *error) const;
bool getString(std::string &value, const std::string &name) const;
bool setString(const std::string& name, const std::string& value);
bool setString(const std::string &name, const std::string &value);
/** Removes the symbol with the given name from the symboltable.
* @param name Symbol to be removed
*/
bool remove(const std::string& name);
bool remove(const std::string &name);
std::vector<int> getInts(const std::string& name) const;
std::vector<int> getInts(const std::string &name) const;
std::vector<int> getInts(const std::string& name, bool* error) const;
std::vector<int> getInts(const std::string &name, bool *error) const;
bool setInts(const std::string& name, const std::vector<int>& values);
bool setInts(const std::string &name, const std::vector<int> &values);
std::vector<double> getDoubles(const std::string& name) const;
std::vector<double> getDoubles(const std::string &name) const;
std::vector<double> getDoubles(const std::string& name, bool* error) const;
std::vector<double> getDoubles(const std::string &name, bool *error) const;
bool setDoubles(const std::string& name, const std::vector<double>& values);
bool setDoubles(const std::string &name, const std::vector<double> &values);
std::vector<bool> getBools(const std::string& name) const;
std::vector<bool> getBools(const std::string &name) const;
std::vector<bool> getBools(const std::string& name, bool* error) const;
std::vector<bool> getBools(const std::string &name, bool *error) const;
bool setBools(const std::string& name, const std::vector<bool>& values);
bool setBools(const std::string &name, const std::vector<bool> &values);
std::vector<std::string> getStrings(const std::string& name) const;
std::vector<std::string> getStrings(const std::string& name, bool* error) const;
bool getStrings(std::vector<std::string>& value, const std::string& name) const;
std::vector<std::string> getStrings(const std::string &name) const;
std::vector<std::string> getStrings(const std::string &name, bool *error) const;
bool getStrings(std::vector<std::string> &value, const std::string &name) const;
bool setStrings(const std::string& name, const std::vector<std::string>& values);
bool setStrings(const std::string &name, const std::vector<std::string> &values);
/**
* @brief Returns a list of symbols with a name that starts with a
* given prefix.
* Alternatively a name of a symbol can be given. That symbol name must
* exist under the checked candidate. Example of configuration:
*
* @code
* profiles.A.enabled = false
* profiles.A.name = "Profile A"
* profiles.B.enabled = true
* profiles.B.name = "Profile B"
* profiles.C.name = "Profile C"
* @endcode
*
* @code
* auto symbols = cfg.findSymbols("profiles.", "enabled");
* assert(symbols.size() == 1)
* assert(symbols[0] == "profiles.B")
*
* symbols = cfg.findSymbols("profiles.");
* assert(symbols.size() == 3)
* assert(symbols[0] == "profiles.A")
* assert(symbols[1] == "profiles.B")
* assert(symbols[2] == "profiles.C")
* @endcode
*
* @param prefix The prefix of the returned symbol name
* @param enabledSymbol If not empty then a symbol is evaluated which
* holds a true boolean value. The name of the
* symbol is composed of the checked symbol name
* and this parameters joined with a dot.
* @return enabledDefault Default value for the enableSymbol.
* @return The list of matching symbols.
*/
std::vector<std::string> findSymbols(const std::string &prefix,
const std::string &enabledSymbol = {},
bool enabledDefault = true) const;
SymbolTable *symbolTable() const;
@ -268,17 +300,17 @@ class SC_CONFIG_API Config {
// ------------------------------------------------------------------------
private:
void init();
bool handleEntry(const std::string& entry, const std::string& comment);
bool handleInclude(const std::string& fileName);
void handleAssignment(const std::string& name, const std::string& content,
std::vector<std::string>& values,
const std::string& comment);
bool handleEntry(const std::string &entry, const std::string &comment);
bool handleInclude(const std::string &fileName);
void handleAssignment(const std::string &name, const std::string &content,
std::vector<std::string> &values,
const std::string &comment);
std::vector<std::string> tokenize(const std::string& entry);
static bool reference(const std::string &name,
std::vector<std::string> &value,
const SymbolTable *symtab);
static bool parseRValue(const std::string& entry,
std::vector<std::string>& parsedValues,
static bool parseRValue(const std::string &entry,
std::vector<std::string> &parsedValues,
const SymbolTable *symtab,
bool resolveReferences,
bool rawMode,
@ -289,34 +321,34 @@ class SC_CONFIG_API Config {
int stage = -1, bool raw = false);
template <typename T>
T get(const std::string& name) const;
T get(const std::string &name) const;
template <typename T>
T get(const std::string& name, bool* error) const;
T get(const std::string &name, bool *error) const;
template <typename T>
bool get(T& value, const std::string& name) const;
bool get(T &value, const std::string &name) const;
template <typename T>
std::vector<T> getVec(const std::string& name) const;
std::vector<T> getVec(const std::string &name) const;
template <typename T>
std::vector<T> getVec(const std::string& name, bool* error) const;
std::vector<T> getVec(const std::string &name, bool *error) const;
template <typename T>
void add(const std::string& name, const T& value);
void add(const std::string &name, const T &value);
template <typename T>
void add(const std::string& name, const std::vector<T>& values);
void add(const std::string &name, const std::vector<T> &values);
/** Sets an value in the configuration file
* @param element name of the element
* @param value value for the element */
template <typename T>
bool set(const std::string& name, const T& value);
bool set(const std::string &name, const T &value);
template <typename T>
bool set(const std::string& name, const std::vector<T>& values);
bool set(const std::string &name, const std::vector<T> &values);
inline void addVariable(const std::string &name, const char *type) const;
@ -327,7 +359,8 @@ class SC_CONFIG_API Config {
// Private data members
// ------------------------------------------------------------------------
private:
typedef std::deque<std::string> Namespaces;
using Namespaces = std::deque<std::string>;
int _stage;
int _line;
bool _resolveReferences;
@ -346,4 +379,5 @@ class SC_CONFIG_API Config {
} // namespace Config
} // namespace Seiscomp
#endif

View File

@ -38,7 +38,7 @@ class SC_CONFIG_API Exception : public std::exception {
Exception(const char *str) : _what(str) {}
virtual ~Exception() throw() {}
const char *what() const throw() { return _what.c_str(); }
const char *what() const throw() override { return _what.c_str(); }
private:
std::string _what;

View File

@ -23,6 +23,7 @@
#include <seiscomp/config/api.h>
#include <fmt/printf.h>
#include <cstdio>
@ -44,13 +45,10 @@ struct SC_CONFIG_API Logger {
};
extern char log_msg_buffer[1024];
#define CONFIG_LOG_CHANNEL(chan, msg, ...) \
if ( _logger ) {\
snprintf(log_msg_buffer, 1023, msg, __VA_ARGS__);\
_logger->log(chan, _fileName.c_str(), _line, log_msg_buffer);\
auto line = fmt::sprintf(msg, __VA_ARGS__);\
_logger->log(chan, _fileName.c_str(), _line, line.c_str());\
}

View File

@ -17,9 +17,11 @@
* gempa GmbH. *
***************************************************************************/
#ifndef __SEISCOMP_CONFIG_SYMBOLTABLE__
#define __SEISCOMP_CONFIG_SYMBOLTABLE__
#include <string>
#include <vector>
#include <map>
@ -28,6 +30,7 @@
#include <seiscomp/config/log.h>
namespace Seiscomp {
namespace Config {
@ -65,23 +68,22 @@ struct SC_CONFIG_API Symbol {
class SC_CONFIG_API SymbolTable {
private:
typedef std::map<std::string, Symbol> Symbols;
typedef std::vector<Symbol*> SymbolOrder;
typedef std::map<std::string, Symbols::iterator> CISymbols;
public:
typedef SymbolOrder::const_iterator iterator;
typedef std::set<std::string> IncludedFiles;
typedef IncludedFiles::iterator file_iterator;
public:
SymbolTable();
using Symbols = std::map<std::string, Symbol>;
using SymbolOrder = std::vector<Symbol*>;
public:
using iterator = SymbolOrder::const_iterator;
using IncludedFiles = std::set<std::string>;
using file_iterator = IncludedFiles::iterator;
public:
SymbolTable() = default;
public:
void setCaseSensitivityCheck(bool);
void setLogger(Logger *);
Logger *logger();
@ -114,22 +116,18 @@ class SC_CONFIG_API SymbolTable {
iterator begin();
iterator end();
private:
//! Returns true if an inconsistent definition has been found
bool checkCI(const std::string &name, const Symbol *) const;
private:
bool _csCheck;
Symbols _symbols;
CISymbols _cisymbols;
SymbolOrder _symbolOrder;
IncludedFiles _includedFiles;
int _objectCount;
Logger *_logger;
Symbols _symbols;
SymbolOrder _symbolOrder;
IncludedFiles _includedFiles;
int _objectCount{0};
Logger *_logger{nullptr};
};
} // namespace Config
} // namespace Seiscomp
#endif

View File

@ -61,7 +61,7 @@ namespace Generic {
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
/** \brief A template archive interface
An archive offers an interface to read from and write to datasources.
An archive offers an interface to read from and write to datasources.
*/
template <typename ROOT_TYPE>
class Archive {
@ -130,7 +130,7 @@ class Archive {
//! Creates a new archive
virtual bool create(const char* dataSource);
virtual void close() = 0;
/**
@ -279,7 +279,7 @@ class Archive {
void read(::boost::intrusive_ptr<T> &object);
template <typename T>
void read(::boost::optional<T> &object);
void read(Optional<T> &object);
// ------------------------------------------------------------------
@ -347,7 +347,7 @@ class Archive {
void write(::boost::intrusive_ptr<T>&);
template <typename T>
void write(::boost::optional<T>&);
void write(Optional<T>&);
// ------------------------------------------------------------------
@ -361,7 +361,7 @@ class Archive {
//! Writes a smartpointer into the archive
template <typename T>
Archive& operator<<(::boost::intrusive_ptr<T>&);
//! Writes a named object into the archive
template <typename T>
Archive& operator<<(const ObjectNamer<T>&);
@ -416,12 +416,12 @@ class Archive {
//! Reads a list from the archive
template <typename T>
Archive& operator>>(const ObjectNamer<std::list<T> >&);
//! Stream operator that decides by means of the _isReading flag
//! whether a the object has to be written or to be read.
template <typename T>
Archive& operator&(ObjectNamer<T>);
// ------------------------------------------------------------------
@ -436,15 +436,15 @@ class Archive {
template <typename T>
struct TypedSerializeDispatcher : SerializeDispatcher {
TypedSerializeDispatcher(T* t = nullptr) : target(t) {}
TypedSerializeDispatcher& operator=(T* t) {
target = t;
return *this;
}
TypedSerializeDispatcher* operator->() { return this; }
virtual void operator()(Archive<ROOT_TYPE>& ar) {
virtual void operator()(Archive<ROOT_TYPE>& ar) override {
target->serialize(ar);
}
@ -454,7 +454,7 @@ class Archive {
};
bool findObject(const char *name, const char *targetClass, bool nullable);
//! Locates an object inside the archive. A derived class
//! must provide its specific location code.
virtual bool locateObjectByName(const char *name, const char *targetClass, bool nullable) = 0;
@ -510,7 +510,7 @@ class Archive {
template <typename T>
void readPtr(void*, T *&object);
//! Helper function to distinguish between pointer and non pointer
//! types to avoid nullptr pointer serialization.
template <typename T>
@ -523,8 +523,8 @@ class Archive {
void read(const char *name, ::boost::intrusive_ptr<T> &object, const char *targetClass);
template <typename T>
void read(const char *name, ::boost::optional<T> &object, const char *targetClass);
void read(const char *name, Optional<T> &object, const char *targetClass);
template <typename T>
void write(const char *name, T &object, const char *targetClass);
@ -538,7 +538,7 @@ class Archive {
//! Helper function to distinguish between C pointer and Optionals
template <typename T>
void write(const char *name, ::boost::optional<T> &object, const char *targetClass);
void write(const char *name, Optional<T> &object, const char *targetClass);
int setChildHint(int h);

View File

@ -47,10 +47,10 @@ namespace {
class IsTypeOf {
class No { };
class Yes { No no[2]; };
static Yes Test(BASECLASS*); // declared, but not defined
static No Test(...); // declared, but not defined
public:
enum { Value = sizeof(Test(static_cast<DERIVEDCLASS*>(0))) == sizeof(Yes) };
};
@ -155,7 +155,7 @@ struct ClassQuery<T,1> {
};
template <typename ROOT_TYPE, typename TYPE>
const char *checkClassName(const ::boost::optional<TYPE>*, const ::boost::optional<TYPE>&) {
const char *checkClassName(const Optional<TYPE>*, const Optional<TYPE>&) {
ClassQuery<TYPE, boost::is_base_of<ROOT_TYPE, TYPE>::value> query;
return query();
}
@ -367,7 +367,7 @@ inline Archive<ROOT_TYPE>& Archive<ROOT_TYPE>::operator>>(T*& object) {
return *this;
//_validObject = true;
read(classname, object, classname);
return *this;
@ -454,13 +454,13 @@ template <typename T>
inline Archive<ROOT_TYPE>& Archive<ROOT_TYPE>::operator>>(const ObjectNamer<T>& namedObject) {
int h = setChildHint(namedObject.hint());
//setHint(h | namedObject.hint());
//_validObject = true;
ContainerReader<ROOT_TYPE,T,boost::is_const<T>::value?1:0> reader;
reader(*this, namedObject);
setHint(h);
return *this;
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@ -516,7 +516,7 @@ inline Archive<ROOT_TYPE>& Archive<ROOT_TYPE>::operator>>(const ObjectNamer<std:
//setHint(h | namedObject.hint());
typedef typename boost::remove_pointer<T>::type RAW_T;
//_validObject = true;
VectorReader<ROOT_TYPE,T,
@ -544,7 +544,7 @@ inline Archive<ROOT_TYPE>& Archive<ROOT_TYPE>::operator>>(const ObjectNamer<std:
reader(*this, namedObject);
setHint(h);
return *this;
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@ -600,7 +600,7 @@ inline Archive<ROOT_TYPE>& Archive<ROOT_TYPE>::operator>>(const ObjectNamer<std:
//setHint(h | namedObject.hint());
typedef typename boost::remove_pointer<T>::type RAW_T;
//_validObject = true;
ListReader<ROOT_TYPE,T,
boost::is_class<RAW_T>::value?
@ -626,7 +626,7 @@ inline Archive<ROOT_TYPE>& Archive<ROOT_TYPE>::operator>>(const ObjectNamer<std:
reader(*this, namedObject);
setHint(h);
return *this;
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@ -673,18 +673,20 @@ inline void Archive<ROOT_TYPE>::read(::boost::intrusive_ptr<T>& object) {
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
template <typename ROOT_TYPE>
template <typename T>
inline void Archive<ROOT_TYPE>::read(::boost::optional<T>& object) {
inline void Archive<ROOT_TYPE>::read(Optional<T>& object) {
bool oldState = success();
object = T();
read(*object);
if ( !success() )
object = boost::none;
if ( !success() ) {
object = None;
}
// Restore old state if not in strict mode otherwise pass it through
if ( !_strict )
if ( !_strict ) {
_validObject = oldState;
}
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@ -698,7 +700,7 @@ inline void Archive<ROOT_TYPE>::readPtr(ROOT_TYPE*, T*& object) {
if ( (hint() & STATIC_TYPE) == 0 ) {
std::string className = determineClassName();
if ( className.empty() ) return;
if ( !ClassFactoryInterface<ROOT_TYPE>::IsTypeOf(T::ClassName(), className.c_str()) ) {
_validObject = false;
return;
@ -811,12 +813,12 @@ inline void Archive<ROOT_TYPE>::read(const char *name, ::boost::intrusive_ptr<T>
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
template <typename ROOT_TYPE>
template <typename T>
inline void Archive<ROOT_TYPE>::read(const char *name, ::boost::optional<T> &object, const char *targetClass) {
inline void Archive<ROOT_TYPE>::read(const char *name, Optional<T> &object, const char *targetClass) {
if ( findObject(name, targetClass, true) )
read(object);
else {
//_validObject = false;
object = boost::none;
object = None;
}
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@ -897,7 +899,7 @@ inline void Archive<ROOT_TYPE>::write(const char *name, ::boost::intrusive_ptr<T
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
template <typename ROOT_TYPE>
template <typename T>
inline void Archive<ROOT_TYPE>::write(const char *name, ::boost::optional<T> &object, const char *targetClass) {
write(name, object.get_ptr(), targetClass);
inline void Archive<ROOT_TYPE>::write(const char *name, Optional<T> &object, const char *targetClass) {
write(name, object ? std::addressof(*object) : nullptr, targetClass);
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

View File

@ -63,7 +63,7 @@ class SC_SYSTEM_CORE_API Array : public Seiscomp::Core::BaseObject {
DataType dataType() const { return _datatype; }
//! Returns a clone of the array
Array* clone() const;
Array *clone() const override;
//! Returns a copy of the array of the specified data type.
virtual Array* copy(DataType dt) const = 0;

View File

@ -17,250 +17,448 @@
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_CORE_DATETIME_H
#define SEISCOMP_CORE_DATETIME_H
#include <seiscomp/core.h>
#include <seiscomp/core/optional.h>
#ifdef WIN32
#include <winsock.h>
#else
#include <sys/time.h>
#endif
#include <string>
#include <cstdint>
#include <chrono>
#include <limits>
#include <iostream>
#include <cmath>
#include <string_view>
struct tm;
namespace Seiscomp {
namespace Core {
class SC_SYSTEM_CORE_API TimeSpan {
/**
* @brief The TimeSpan class holds the amount of microseconds passed between
* two times.
*
* Internally it is represented with a std::chrono::duration with microsecond
* precision. It can be constructed from a std::chrono::duration object
* Its binary represention is 64bit signed integer regardless of the
* underlying architecture.
*
* The limit of a representable time span is +/-32768 years.
*/
class TimeSpan {
public:
using Storage = int64_t;
using Weeks = std::chrono::duration<Storage, std::ratio<7*86400> >;
using Days = std::chrono::duration<Storage, std::ratio<86400> >;
using Hours = std::chrono::duration<Storage, std::ratio<3600> >;
using Minutes = std::chrono::duration<Storage, std::ratio<60> >;
using Seconds = std::chrono::duration<Storage, std::ratio<1> >;
using MilliSeconds = std::chrono::duration<Storage, std::milli>;
using MicroSeconds = std::chrono::duration<Storage, std::micro>;
using F1 = std::chrono::duration<Storage, std::ratio<1, 10> >;
using F2 = std::chrono::duration<Storage, std::ratio<1, 100> >;
using F3 = std::chrono::duration<Storage, std::ratio<1, 1000> >;
using F4 = std::chrono::duration<Storage, std::ratio<1, 10000> >;
using F5 = std::chrono::duration<Storage, std::ratio<1, 100000> >;
using F6 = std::chrono::duration<Storage, std::ratio<1, 1000000> >;
using Duration = MicroSeconds;
static const double MinSpan;
static const double MaxSpan;
static const Storage MinSeconds;
static const Storage MaxSeconds;
// ----------------------------------------------------------------------
// X'truction
// ----------------------------------------------------------------------
public:
TimeSpan() = default;
TimeSpan(const TimeSpan &other) = default;
constexpr TimeSpan(Storage secs, Storage usecs = 0);
TimeSpan(double ts);
template<typename Rep, typename Period>
constexpr TimeSpan(const std::chrono::duration<Rep, Period> &duration);
// ----------------------------------------------------------------------
// Assignment operators
// ----------------------------------------------------------------------
public:
//! Assigns integer epoch seconds
TimeSpan &operator=(int t);
//! Assigns integer epoch seconds
TimeSpan &operator=(Storage t);
//! Assigns floating point epoch seconds
TimeSpan &operator=(double t);
// ----------------------------------------------------------------------
// Comparison operators
// ----------------------------------------------------------------------
public:
constexpr bool operator==(const TimeSpan &other) const noexcept;
constexpr bool operator!=(const TimeSpan &other) const noexcept;
constexpr bool operator<=(const TimeSpan &other) const noexcept;
constexpr bool operator<(const TimeSpan &other) const noexcept;
constexpr bool operator>=(const TimeSpan &other) const noexcept;
constexpr bool operator>(const TimeSpan &other) const noexcept;
// ----------------------------------------------------------------------
// Arithmetic operators
// ----------------------------------------------------------------------
public:
constexpr TimeSpan operator+(const TimeSpan &other) const;
constexpr TimeSpan operator-(const TimeSpan &other) const;
constexpr TimeSpan operator*(int op) const;
constexpr TimeSpan operator*(size_t op) const;
constexpr TimeSpan operator*(double op) const;
constexpr TimeSpan operator/(int op) const;
constexpr TimeSpan operator/(size_t op) const;
constexpr TimeSpan operator/(double op) const;
constexpr TimeSpan operator-() const;
TimeSpan &operator+=(const TimeSpan &other);
TimeSpan &operator-=(const TimeSpan &other);
TimeSpan &operator*=(int op);
TimeSpan &operator*=(size_t op);
TimeSpan &operator*=(double op);
TimeSpan &operator/=(int op);
TimeSpan &operator/=(size_t op);
TimeSpan &operator/=(double op);
// ----------------------------------------------------------------------
// Conversion operators
// ----------------------------------------------------------------------
public:
constexpr explicit operator Duration() const noexcept;
constexpr explicit operator double() const noexcept;
//! Returns whether the timespan is empty or not.
constexpr explicit operator bool() const noexcept;
//! Returns an std::chrono::time_point
constexpr const Duration &repr() const noexcept;
// ----------------------------------------------------------------------
// Setter and getter
// ----------------------------------------------------------------------
public:
/**
* @brief Returns the maximum number of full seconds of this
* time span.
* @return Number of full seconds.
*/
constexpr Storage seconds() const;
/**
* @brief Returns the fractional part of the time span in
* microseconds.
* The number of microseconds returns is guaranteed to be less than
* one million (1000000).
* @return Fraction in microseconds.
*/
constexpr Storage microseconds() const noexcept;
/**
* @brief Returns this time span expressed in microseconds.
* @return Number of ticks in microseconds.
*/
constexpr Storage count() const noexcept;
//! Returns the absolute value of time
TimeSpan abs() const;
TimeSpan &set(Storage seconds, Storage usecs = 0);
void get(int *days, int *hours = nullptr,
int *minutes = nullptr, int *seconds = nullptr) const;
[[deprecated("Use get() instead")]]
void elapsedTime(int *days, int *hours = nullptr,
int *minutes = nullptr, int *seconds = nullptr) const;
//! Sets the microseconds
TimeSpan &setUSecs(Storage);
/**
* @brief Returns the time span in frational seconds.
* @return Fractional seconds as double.
*/
constexpr double length() const;
// ----------------------------------------------------------------------
// Public interface
// ----------------------------------------------------------------------
public:
/**
* @return A string representing the current time span.
*/
std::string toString() const;
/**
* @brief Converts a string to a time span representation.
* @param sv The input string_view
* @return The conversion result
*/
bool fromString(std::string_view sv);
// ----------------------------------------------------------------------
// Private members
// ----------------------------------------------------------------------
private:
Duration _repr{0};
friend class Time;
};
namespace Literals {
TimeSpan operator "" _weeks(long double weeks);
TimeSpan operator "" _weeks(unsigned long long int weeks);
TimeSpan operator "" _days(long double days);
TimeSpan operator "" _days(unsigned long long int days);
TimeSpan operator "" _hours(long double hours);
TimeSpan operator "" _hours(unsigned long long int hours);
TimeSpan operator "" _minutes(long double minutes);
TimeSpan operator "" _minutes(unsigned long long int minutes);
TimeSpan operator "" _seconds(long double seconds);
TimeSpan operator "" _seconds(unsigned long long int seconds);
TimeSpan operator "" _milliseconds(long double milliseconds);
TimeSpan operator "" _milliseconds(unsigned long long int milliseconds);
}
std::ostream &operator<<(std::ostream &os, const TimeSpan &ts);
/**
* @brief The Time class implements the representation of a point in time
* with microsecond precision.
*
* Internally it is represented with a date::time_point instance from the
* C++ date library of Howard Hinnant [1].
*
* Due to microseconds precision the valid date range is defined from
* -32768-01-01 to 32767-12-31.
*
* [1] https://github.com/HowardHinnant/date
*/
class Time {
// ----------------------------------------------------------------------
// Public types
// ----------------------------------------------------------------------
public:
using Storage = TimeSpan::Storage;
using Duration = TimeSpan::Duration;
using TimePoint = std::chrono::time_point<std::chrono::system_clock, Duration>;
static Time Null;
static const double MinTime;
static const double MaxTime;
// ----------------------------------------------------------------------
// Xstruction
// X'truction
// ----------------------------------------------------------------------
public:
TimeSpan();
TimeSpan(struct timeval*);
TimeSpan(const struct timeval&);
TimeSpan(double);
TimeSpan(long secs, long usecs);
//! Copy constructor
TimeSpan(const TimeSpan&);
// ----------------------------------------------------------------------
// Operators
// ----------------------------------------------------------------------
public:
//! Comparison
bool operator==(const TimeSpan&) const;
bool operator!=(const TimeSpan&) const;
bool operator< (const TimeSpan&) const;
bool operator<=(const TimeSpan&) const;
bool operator> (const TimeSpan&) const;
bool operator>=(const TimeSpan&) const;
//! Conversion
operator double() const;
operator const timeval&() const;
//! Assignment
TimeSpan& operator=(long t);
TimeSpan& operator=(double t);
TimeSpan& operator=(const TimeSpan& t);
//! Arithmetic
TimeSpan operator+(const TimeSpan&) const;
TimeSpan operator-(const TimeSpan&) const;
TimeSpan& operator+=(const TimeSpan&);
TimeSpan& operator-=(const TimeSpan&);
// ----------------------------------------------------------------------
// Interface
// ----------------------------------------------------------------------
public:
//! Returns the absolute value of time
TimeSpan abs() const;
//! Returns the seconds of the timespan
long seconds() const;
//! Returns the microseconds of the timespan
long microseconds() const;
//! Returns the (possibly negative) length of the timespan in seconds
double length() const;
//! Sets the seconds
TimeSpan& set(long seconds);
//! Sets the microseconds
TimeSpan& setUSecs(long);
//! Assigns the elapsed time to the passed out parameters
void elapsedTime(int* days, int* hours = nullptr,
int* minutes = nullptr, int* seconds = nullptr) const;
// ----------------------------------------------------------------------
// Implementation
// ----------------------------------------------------------------------
protected:
struct timeval _timeval;
};
class SC_SYSTEM_CORE_API Time : public TimeSpan {
// ----------------------------------------------------------------------
// Public static data members
// ----------------------------------------------------------------------
public:
static const Time Null;
// ----------------------------------------------------------------------
// Xstruction
// ----------------------------------------------------------------------
public:
Time();
Time(long secs, long usecs);
explicit Time(const TimeSpan&);
explicit Time(const struct timeval&);
explicit Time(struct timeval*);
Time() = default;
Time(const Time &other) = default;
explicit constexpr Time(const TimePoint &tp);
explicit constexpr Time(Storage epochSeconds, Storage microSeconds = 0);
explicit Time(double);
Time(int year, int month, int day,
int hour = 0, int min = 0, int sec = 0,
int usec = 0);
//! Copy constructor
Time(const Time&);
// ----------------------------------------------------------------------
// Operators
// Assignment operators
// ----------------------------------------------------------------------
public:
//! Conversion
operator bool() const;
operator time_t() const;
//! Assignment
Time& operator=(const struct timeval& t);
Time& operator=(struct timeval* t);
Time& operator=(time_t t);
Time& operator=(double t);
//! Arithmetic
Time operator+(const TimeSpan&) const;
Time operator-(const TimeSpan&) const;
TimeSpan operator-(const Time&) const;
Time& operator+=(const TimeSpan&);
Time& operator-=(const TimeSpan&);
Time &operator=(double epoch);
// ----------------------------------------------------------------------
// Interface
// Comparison operators
// ----------------------------------------------------------------------
public:
//! Sets the time
Time& set(int year, int month, int day,
constexpr bool operator==(const Time &other) const noexcept;
constexpr bool operator!=(const Time &other) const noexcept;
constexpr bool operator<(const Time &other) const noexcept;
constexpr bool operator<=(const Time &other) const noexcept;
constexpr bool operator>(const Time &other) const noexcept;
constexpr bool operator>=(const Time &other) const noexcept;
// ----------------------------------------------------------------------
// Arithmetic operators
// ----------------------------------------------------------------------
public:
Time &operator+=(const TimeSpan &ts);
Time &operator-=(const TimeSpan &ts);
constexpr Time operator+(const TimeSpan &ts) const;
constexpr Time operator-(const TimeSpan &ts) const;
constexpr TimeSpan operator-(const Time &tp) const;
// ----------------------------------------------------------------------
// Conversion operators
// ----------------------------------------------------------------------
public:
constexpr explicit operator TimePoint() const noexcept;
constexpr explicit operator double() const noexcept;
[[deprecated("Use OPT(Time) instead")]]
constexpr explicit operator bool() const noexcept;
constexpr const TimePoint &repr() const noexcept;
// ----------------------------------------------------------------------
// Public interface
// ----------------------------------------------------------------------
public:
/**
* @brief Returns whether the time object is a valid time or not.
* Internally the minimum possible value is used to declare an invalid
* time which is for backwards compatibility 1970-01-01 00:00:00.
* @return True if valid, false otherwise.
*/
[[deprecated("Use OPT(Time) instead")]]
constexpr bool valid() const;
/**
* @brief Sets the time object with y/m/d and h/m/s/u individually.
* The resulting time will be defined in seconds from Jan. 1, 1970 UTC.
* If local time is desired then call toLocalTime() afterwards.
* \code
* Time t;
* t.set(2020,1,1,12,00,00).toLocalTime()
* \endcode
* @param year The year between -32767 and 32768
* @param month The month between 1 and 12
* @param day The day between 1 and 31
* @param hour The hour of the day between 0 and 23
* @param min The minute of the hour between 0 and 59
* @param sec The second of the minute between 0 and 59
* @param usec The microseconds of the second between 0 and 999999
* @return this instance
*/
Time &set(int year, int month, int day,
int hour, int min, int sec,
int usec);
//! Sets the time with yday intepreted as the days since January 1st
//! (0-365)
Time& set2(int year, int yday,
int hour, int min, int sec,
int usec);
//! Fill the parameters with the currently set time values
//! @return The error flag
/**
* @brief Retrieves individual date and time components.
* @param year The year between -32767 and 32768
* @param month The month of the year between 1 and 12
* @param day The day of the month between 1 and 31
* @param hour The hour of the day between 0 and 23
* @param min The minute of the hour between 0 and 59
* @param sec The second of the minute between 0 and 59
* @param usec The microseconds of the second between 0 and 999999
* @return Success flag
*/
bool get(int *year, int *month = nullptr, int *day = nullptr,
int *hour = nullptr, int *min = nullptr, int *sec = nullptr,
int *usec = nullptr) const;
//! Fill the parameters with the currently set time values with yday
//! set to the days since January 1st (0-365)
//! @return The error flag
/**
* @brief Sets the time object with y/d and h/m/s/u individually.
* The resulting time will be defined in seconds from Jan. 1, 1970 UTC.
* If local time is desired then call toLocalTime() afterwards.
* \code
* Time t;
* t.set(2020,1,1,12,00,00).toLocalTime()
* \endcode
* @param year The year between -32767 and 32768
* @param yday The day of the year between 0 and 365
* @param hour The hour of the day between 0 and 23
* @param min The minute of the hour between 0 and 59
* @param sec The second of the minute between 0 and 59
* @param usec The microseconds of the second between 0 and 999999
* @return this instance
*/
Time &set2(int year, int yday,
int hour, int min, int sec,
int usec);
/**
* @brief Retrieves individual date and time components.
* @param year The year between -32767 and 32768
* @param yday The day of the year between 0 and 365
* @param hour The hour of the day between 0 and 23
* @param min The minute of the hour between 0 and 59
* @param sec The second of the minute between 0 and 59
* @param usec The microseconds of the second between 0 and 999999
* @return Success flag
*/
bool get2(int *year, int *yday = nullptr,
int *hour = nullptr, int *min = nullptr, int *sec = nullptr,
int *usec = nullptr) const;
//! Returns the current localtime
static Time LocalTime();
/**
* @brief Alias for utc()
* @return The current time in UTC
*/
Time &now();
/**
* @return A string containing the local time zone name/abbreviation
* This is an alias for utc().
* @return The current time in UTC
*/
static std::string LocalTimeZone();
//! Returns the current gmtime
static Time UTC();
//! Alias for UTC()
static Time GMT();
/** Creates a time from the year and the day of the year
@param year The year, including the century (for example, 1988)
@param year_day The day of the year [0..365]
@return The time value
*/
static Time FromYearDay(int year, int year_day);
/**
* @return The offset from UTC/GMT time to local time, essentially
* localtime minus GMT.
*/
TimeSpan localTimeZoneOffset() const;
//! Saves the current localtime in the calling object
Time &localtime();
//! Saves the current gmtime in the calling object
Time &utc();
//! Alias for utc()
Time &gmt();
//! Converts the time to localtime
Time toLocalTime() const;
//! Converts the time to gmtime
Time toUTC() const;
//! Alias for toUTC()
Time toGMT() const;
//! Returns whether the date is valid or not
bool valid() const;
/** Converts the time to string using format fmt.
@param fmt The format string can contain any specifiers
as allowed for strftime. Additional the '%f'
specifier is replaced by the fraction of the seconds.
Example:
toString("%FT%T.%fZ") = "1970-01-01T00:00:00.0000Z"
@return A formatted string
/**
* @return The current time in UTC
*/
std::string toString(const char* fmt) const;
Time &utc();
/**
* Converts the time to a string using the ISO time description
* @return A formatted string
* @return The ISO string of the time in UTC
*/
std::string iso() const;
/**
* @return A string representing the current time point without
* time zone information, UTC time.
*/
std::string toString(const char *format) const;
/**
* @brief Converts the time point to a string in the current
* system's time zone.
* @param format The string format.
* @return The formatted string
*/
std::string toLocalString(const char *format) const;
/**
* @brief Converts the time point to a string in a given
* time zone.
* This method may throw an std::runtime_error if the provided time
* zone does not exist.
* @param format The string format.
* @return The formatted string
*/
std::string toZonedString(const char *format, const std::string &tz) const;
/**
* Converts a string into a time representation.
* @param str The string representation of the time
* @return The conversion result
*/
bool fromString(std::string_view sv);
/**
* Converts a string into a time representation.
* @param str The string representation of the time
@ -268,43 +466,120 @@ class SC_SYSTEM_CORE_API Time : public TimeSpan {
* specification (-> toString)
* @return The conversion result
*/
bool fromString(const char* str, const char* fmt);
bool fromString(std::string_view sv, const char *format);
/**
* Converts a string into a time representation.
* @brief Converts a string to a Time object.
* This method throws a runtime_error if the input string cannot
* be parsed into a valid Time.
* @param str The string representation of the time
* @return The conversion result
* @return A Time object
*/
bool fromString(const char* str);
static Time FromString(const std::string &str);
/**
* Converts a string into a time representation.
* @brief Converts a string to a Time object.
* This method throws a runtime_error if the input string cannot
* be parsed into a valid Time given the format.
* @param str The string representation of the time
* @return The conversion result
* @param fmt The format string containing the conversion
* specification (-> toString)
* @return A Time object
*/
bool fromString(const std::string &str);
static Time FromString(const std::string &str, const char *format);
/**
* Static method to create a time value from a string.
* The parameters are the same as in Time::fromString.
*/
static Time FromString(const char* str, const char* fmt);
* @brief Constructs a time object from a year and the day of the year.
* @param year The year between -32767 and 32768
* @param doy The day of the year between 1 and 366. Note that in
* contrast to set2 and get2 the doy is not starting with 0
* at January 1st but with 1.
* @return
*/
static Time FromYearDay(int year, int doy);
/**
* Static method to convert a time from a string without
* an explicit format.
* @param str The string representation of the time.
* @return None if conversion failed, a valid instance otherwise.
* @return The number of seconds since Jan. 1, 1970.
*
* Backwards compatibility alias for epochSeconds().
*/
static OPT(Time) FromString(const char* str);
[[deprecated("Use epochSeconds() instead")]]
constexpr Storage seconds() const;
/**
* Convenience method for fromString(const char*).
* @return The number of seconds since Jan. 1, 1970.
*/
static OPT(Time) FromString(const std::string &str);
constexpr Storage epochSeconds() const;
/**
* @return The number of seconds with fractional seconds since
* Jan. 1, 1970.
*/
constexpr double epoch() const;
/**
* @return Seconds fraction.
*/
constexpr int microseconds() const;
Time &setUSecs(Storage ms);
static Time FromEpoch(Storage secs, Storage usecs);
static Time FromEpoch(double secs);
//! Returns the current time in UTC. This is an alias for UTC().
static Time Now();
//! Returns the current time in GMT. This is an alias for UTC().
[[deprecated("Use UTC() instead")]] static Time GMT();
//! Returns the current time in UTC
static Time UTC();
//! Returns the current time as UTC plus the time zone offset.
static Time LocalTime();
static std::string LocalTimeZone();
//! Converts the time of the UTC representation to local time.
//! This effectively adds the local timezone offset.
Time toLocalTime() const;
//! Converts the time of the local time representation to UTC. This
//! effectively removes the local timezone offset.
Time toUTC() const;
//! Converts the time of the local time representation to UTC. This
//! effectively removes the local timezone offset.
[[deprecated("Use toUTC() instead")]] Time toGMT() const;
/**
* @brief Returns the local timezone offset with respect to the
* time currently stored.
* @return The local timezone offset as @TimeSpan
*/
TimeSpan localTimeZoneOffset() const;
/**
* @brief Returns the timezone offset for a given timezone.
*
* If the timezone is unknown then a runtime_error will be thrown.
* @return The timezone offset as @TimeSpan
*/
TimeSpan timeZoneOffset(const std::string &tzName) const;
private:
TimePoint _repr{Duration{0}};
};
std::ostream &operator<<(std::ostream &os, const Time &time);
#include "datetime.ipp"
}
}

View File

@ -0,0 +1,546 @@
// --------------------------------------------------------------------------
// Implementation of inline functions
// --------------------------------------------------------------------------
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline constexpr TimeSpan::TimeSpan(Storage secs, Storage usecs)
: _repr(Seconds(secs) + MicroSeconds(usecs)) {}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline TimeSpan::TimeSpan(double ts) {
*this = ts;
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
template<typename Rep, typename Period>
inline constexpr TimeSpan::TimeSpan(const std::chrono::duration<Rep, Period> &duration)
: _repr(std::chrono::duration_cast<Duration>(duration)) {}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline constexpr bool TimeSpan::operator==(const TimeSpan &other) const noexcept {
return _repr == other._repr;
}
inline constexpr bool TimeSpan::operator!=(const TimeSpan &other) const noexcept {
return _repr != other._repr;
}
inline constexpr bool TimeSpan::operator<=(const TimeSpan &other) const noexcept {
return _repr <= other._repr;
}
inline constexpr bool TimeSpan::operator<(const TimeSpan &other) const noexcept {
return _repr < other._repr;
}
inline constexpr bool TimeSpan::operator>=(const TimeSpan &other) const noexcept {
return _repr >= other._repr;
}
inline constexpr bool TimeSpan::operator>(const TimeSpan &other) const noexcept {
return _repr > other._repr;
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline constexpr TimeSpan TimeSpan::operator+(const TimeSpan &other) const {
return TimeSpan(_repr + other._repr);
}
inline constexpr TimeSpan TimeSpan::operator-(const TimeSpan &other) const {
return TimeSpan(_repr - other._repr);
}
inline constexpr TimeSpan TimeSpan::operator*(int op) const {
return TimeSpan(Duration(Storage(_repr.count() * op)));
}
inline constexpr TimeSpan TimeSpan::operator*(size_t op) const {
return TimeSpan(Duration(Storage(_repr.count() * op)));
}
inline constexpr TimeSpan TimeSpan::operator*(double op) const {
return TimeSpan(Duration(Storage(_repr.count() * op)));
}
inline constexpr TimeSpan TimeSpan::operator/(int op) const {
return TimeSpan(Duration(Storage(_repr.count() / op)));
}
inline constexpr TimeSpan TimeSpan::operator/(size_t op) const {
return TimeSpan(Duration(Storage(_repr.count() / op)));
}
inline constexpr TimeSpan TimeSpan::operator/(double op) const {
return TimeSpan(Duration(Storage(_repr.count() / op)));
}
inline constexpr TimeSpan TimeSpan::operator-() const {
return TimeSpan(Duration(Storage(-_repr.count())));
}
inline TimeSpan &TimeSpan::operator+=(const TimeSpan &other) {
_repr += other._repr;
return *this;
}
inline TimeSpan &TimeSpan::operator-=(const TimeSpan &other) {
_repr -= other._repr;
return *this;
}
inline TimeSpan &TimeSpan::operator*=(int op) {
_repr = Duration(Storage(_repr.count() * op));
return *this;
}
inline TimeSpan &TimeSpan::operator*=(size_t op) {
_repr = Duration(Storage(_repr.count() * op));
return *this;
}
inline TimeSpan &TimeSpan::operator*=(double op) {
_repr = Duration(Storage(_repr.count() * op));
return *this;
}
inline TimeSpan &TimeSpan::operator/=(int op) {
_repr = Duration(Storage(_repr.count() / op));
return *this;
}
inline TimeSpan &TimeSpan::operator/=(size_t op) {
_repr = Duration(Storage(_repr.count() / op));
return *this;
}
inline TimeSpan &TimeSpan::operator/=(double op) {
_repr = Duration(Storage(_repr.count() / op));
return *this;
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline constexpr TimeSpan::operator Duration() const noexcept {
return _repr;
}
inline constexpr TimeSpan::operator double() const noexcept {
return length();
}
inline constexpr TimeSpan::operator bool() const noexcept {
return count() > 0;
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline constexpr const TimeSpan::Duration &TimeSpan::repr() const noexcept {
return _repr;
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
namespace Literals {
inline TimeSpan operator "" _weeks(long double weeks) {
using namespace std::chrono;
return duration_cast<TimeSpan::Duration>(duration<double, std::ratio<86400*7> >(weeks));
}
inline TimeSpan operator "" _weeks(unsigned long long int weeks) {
using namespace std::chrono;
return duration_cast<TimeSpan::Duration>(duration<unsigned long long int, std::ratio<86400*7> >(weeks));
}
inline TimeSpan operator "" _days(long double days) {
using namespace std::chrono;
return duration_cast<TimeSpan::Duration>(duration<double, std::ratio<86400> >(days));
}
inline TimeSpan operator "" _days(unsigned long long int days) {
using namespace std::chrono;
return duration_cast<TimeSpan::Duration>(duration<unsigned long long int, std::ratio<86400> >(days));
}
inline TimeSpan operator "" _hours(long double hours) {
using namespace std::chrono;
return duration_cast<TimeSpan::Duration>(duration<double, std::ratio<3600> >(hours));
}
inline TimeSpan operator "" _hours(unsigned long long int hours) {
using namespace std::chrono;
return duration_cast<TimeSpan::Duration>(duration<unsigned long long int, std::ratio<3600> >(hours));
}
inline TimeSpan operator "" _minutes(long double minutes) {
using namespace std::chrono;
return duration_cast<TimeSpan::Duration>(duration<double, std::ratio<60> >(minutes));
}
inline TimeSpan operator "" _minutes(unsigned long long int minutes) {
using namespace std::chrono;
return duration_cast<TimeSpan::Duration>(duration<unsigned long long int, std::ratio<60> >(minutes));
}
inline TimeSpan operator "" _seconds(long double seconds) {
using namespace std::chrono;
return duration_cast<TimeSpan::Duration>(duration<double, std::ratio<1> >(seconds));
}
inline TimeSpan operator "" _seconds(unsigned long long int seconds) {
using namespace std::chrono;
return duration_cast<TimeSpan::Duration>(duration<unsigned long long int, std::ratio<1> >(seconds));
}
inline TimeSpan operator "" _milliseconds(long double mseconds) {
using namespace std::chrono;
return duration_cast<TimeSpan::Duration>(duration<double, std::ratio<1, 1000> >(mseconds));
}
inline TimeSpan operator "" _milliseconds(unsigned long long int mseconds) {
using namespace std::chrono;
return duration_cast<TimeSpan::Duration>(duration<unsigned long long int, std::ratio<1, 1000> >(mseconds));
}
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline void TimeSpan::elapsedTime(int* days, int* hours,
int* minutes, int* seconds) const {
get(days, hours, minutes, seconds);
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline constexpr TimeSpan::Storage TimeSpan::seconds() const {
return std::chrono::duration_cast<Seconds>(_repr).count();
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline constexpr TimeSpan::Storage TimeSpan::microseconds() const noexcept {
// _repr is microseconds
return _repr.count() % 1000000;
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline constexpr TimeSpan::Storage TimeSpan::count() const noexcept {
return _repr.count();
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline TimeSpan &TimeSpan::set(Storage secs, Storage usecs) {
using namespace std::chrono;
_repr = MicroSeconds(secs * 1000000 + usecs);
return *this;
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline TimeSpan &TimeSpan::setUSecs(Storage usecs) {
using namespace std::chrono;
_repr = MicroSeconds(seconds() * 1000000 + usecs);
return *this;
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline constexpr double TimeSpan::length() const {
return std::chrono::duration_cast<MicroSeconds>(_repr).count() * 1E-6;
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline constexpr Time::Time(Storage epochSeconds, Storage epochMicroSeconds)
: _repr(TimePoint(TimeSpan::Seconds(epochSeconds) + TimeSpan::MicroSeconds(epochMicroSeconds)))
{}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline constexpr Time::Time(const TimePoint &tp) : _repr(tp) {}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline constexpr bool Time::operator==(const Time &other) const noexcept {
return _repr == other._repr;
}
inline constexpr bool Time::operator!=(const Time &other) const noexcept {
return _repr != other._repr;
}
inline constexpr bool Time::operator<(const Time &other) const noexcept {
return _repr < other._repr;
}
inline constexpr bool Time::operator<=(const Time &other) const noexcept {
return _repr <= other._repr;
}
inline constexpr bool Time::operator>(const Time &other) const noexcept {
return _repr > other._repr;
}
inline constexpr bool Time::operator>=(const Time &other) const noexcept {
return _repr >= other._repr;
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline Time &Time::operator+=(const TimeSpan &ts) {
_repr += ts._repr;
return *this;
}
inline Time &Time::operator-=(const TimeSpan &ts) {
_repr -= ts._repr;
return *this;
}
inline constexpr Time Time::operator+(const TimeSpan &ts) const {
return Time(_repr + ts._repr);
}
inline constexpr Time Time::operator-(const TimeSpan &ts) const {
return Time(_repr - ts._repr);
}
inline constexpr TimeSpan Time::operator-(const Time &tp) const {
return TimeSpan(_repr - tp._repr);
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline constexpr Time::operator TimePoint() const noexcept {
return _repr;
}
inline constexpr Time::operator double() const noexcept {
return epoch();
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline constexpr bool Time::valid() const {
return *this != Null;
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline constexpr Time::operator bool() const noexcept {
return *this != Null;
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline constexpr const Time::TimePoint &Time::repr() const noexcept {
return _repr;
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline constexpr Time::Storage Time::seconds() const {
return epochSeconds();
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline constexpr Time::Storage Time::epochSeconds() const {
return std::chrono::duration_cast<std::chrono::seconds>(_repr.time_since_epoch()).count();
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline constexpr double Time::epoch() const {
return std::chrono::duration_cast<std::chrono::microseconds>(_repr.time_since_epoch()).count() * 1E-6;
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline Time &Time::setUSecs(Storage usecs) {
using namespace std::chrono;
_repr = TimePoint(
std::chrono::duration_cast<Duration>(
TimeSpan::MicroSeconds(
static_cast<Storage>(
std::chrono::duration_cast<std::chrono::seconds>(
_repr.time_since_epoch()
).count() * 1000000 + usecs
)
)
)
);
return *this;
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline constexpr int Time::microseconds() const {
return std::chrono::duration_cast<std::chrono::microseconds>(_repr.time_since_epoch()).count() % 1000000;
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline Time &Time::gmt() {
return utc();
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline Time Time::UTC() {
return Now();
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline Time Time::LocalTime() {
return UTC().toLocalTime();
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline Time Time::GMT() {
return Now();
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline Time Time::Now() {
return Time().now();
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline Time Time::toLocalTime() const {
return *this + localTimeZoneOffset();
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline Time Time::toUTC() const {
return *this - localTimeZoneOffset();
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
inline Time Time::toGMT() const {
return toUTC();
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

View File

@ -30,9 +30,7 @@ namespace Core {
template <typename T>
struct SmartPointer {
typedef ::boost::intrusive_ptr<T> Impl;
};
using SmartPointer = ::boost::intrusive_ptr<T>;
template <typename B, typename D>
@ -52,10 +50,10 @@ struct isTypeOf {
#define TYPEDEF_SMARTPOINTER(classname) \
typedef Seiscomp::Core::SmartPointer<classname>::Impl classname##Ptr
using classname##Ptr = Seiscomp::Core::SmartPointer<classname>
#define TYPEDEF_CONST_SMARTPOINTER(classname) \
typedef Seiscomp::Core::SmartPointer<const classname>::Impl classname##CPtr
using classname##CPtr = Seiscomp::Core::SmartPointer<const classname>
#define DEFINE_SMARTPOINTER(classname) \
class classname; \

View File

@ -25,6 +25,7 @@
#include <seiscomp/core/io.h>
#include <ostream>
#include <string_view>
#include <fmt/ostream.h>
@ -48,7 +49,7 @@ class SC_SYSTEM_CORE_API Enumeration {
* case sensitive.
* @return The result of the conversion
*/
virtual bool fromString(const std::string &str) = 0;
virtual bool fromString(std::string_view sv) = 0;
/**
* Converts an enumeration value to an integer
@ -160,7 +161,7 @@ class Enum : public Enumeration {
// ------------------------------------------------------------------
public:
const char *toString() const override;
bool fromString(const std::string &str) override;
bool fromString(std::string_view sv) override;
int toInt() const override;
bool fromInt(int value) override;

View File

@ -90,13 +90,15 @@ inline const char* Enum<ENUMTYPE, END, NAMES>::toString() const {
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
template <typename ENUMTYPE, ENUMTYPE END, typename NAMES>
inline bool
Enum<ENUMTYPE, END, NAMES>::fromString(const std::string& str) {
Enum<ENUMTYPE, END, NAMES>::fromString(std::string_view sv) {
int index = int(0);
while( str != std::string(NAMES::name(index-0)) ) {
while ( sv != NAMES::name(index - 0) ) {
++index;
if ( index >= int(END) )
if ( index >= int(END) ) {
return false;
}
}
_value = static_cast<ENUMTYPE>(index);

View File

@ -37,8 +37,8 @@ class SC_SYSTEM_CORE_API GeneralException : public std::exception {
GeneralException( const std::string& str);
virtual ~GeneralException() throw();
virtual const char* what( void ) const throw();
virtual const char* what( void ) const throw() override;
private:
std::string _descr;

View File

@ -62,8 +62,9 @@ class ClassFactoryInterface {
using RootType = ROOT_TYPE;
using ClassPool = std::map<std::string, ClassFactoryInterface<ROOT_TYPE>*>;
using ClassNames = std::map<const RTTI*, std::string>;
using NameList = std::list<std::string>;
// ----------------------------------------------------------------------
// X'truction
// ----------------------------------------------------------------------
@ -93,12 +94,17 @@ class ClassFactoryInterface {
static const char* ClassName(const RTTI *rtti);
//! Looks up a class factory for a given class name
static ClassFactoryInterface* FindByClassName(const char *className);
static ClassFactoryInterface *FindByClassName(const char *className);
static ClassFactoryInterface *FindByClassName(const std::string &className);
static bool IsTypeOf(const char *baseName, const char *derivedName);
//! Returns the number of registered classes
static unsigned int NumberOfRegisteredClasses();
//! Returns the number of registered classes. This is equal to
//! Classes().size().
static size_t NumberOfRegisteredClasses();
//! Returns the registered classes.
static const ClassNames &RegisteredClasses();
//! Returns the name of the class (as given during construction) which can be created
//! by this factory
@ -167,7 +173,7 @@ class AbstractClassFactory : public ClassFactoryInterface<ROOT_TYPE> {
protected:
//! Always returns nullptr
ROOT_TYPE *create() const;
ROOT_TYPE *create() const override;
};
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@ -200,7 +206,7 @@ class ClassFactory : public ClassFactoryInterface<ROOT_TYPE> {
protected:
//! The actual creation
ROOT_TYPE* create() const;
ROOT_TYPE* create() const override;
};

View File

@ -124,12 +124,14 @@ const char *ClassFactoryInterface<ROOT_TYPE>::ClassName(const RTTI *info) {
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
template <typename ROOT_TYPE>
ClassFactoryInterface<ROOT_TYPE> *ClassFactoryInterface<ROOT_TYPE>::FindByClassName(const char *className) {
if ( !className )
if ( !className ) {
return nullptr;
}
typename ClassPool::iterator it = Classes().find(className);
if ( it == Classes().end() )
auto it = Classes().find(className);
if ( it == Classes().end() ) {
return nullptr;
}
return (*it).second;
}
@ -140,8 +142,33 @@ ClassFactoryInterface<ROOT_TYPE> *ClassFactoryInterface<ROOT_TYPE>::FindByClassN
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
template <typename ROOT_TYPE>
unsigned int ClassFactoryInterface<ROOT_TYPE>::NumberOfRegisteredClasses() {
return static_cast<unsigned int>(Classes().size());
ClassFactoryInterface<ROOT_TYPE> *
ClassFactoryInterface<ROOT_TYPE>::FindByClassName(const std::string &className) {
if ( auto it = Classes().find(className); it != Classes().end() ) {
return it->second;
}
return nullptr;
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
template <typename ROOT_TYPE>
size_t ClassFactoryInterface<ROOT_TYPE>::NumberOfRegisteredClasses() {
return Classes().size();
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
template <typename ROOT_TYPE>
const typename ClassFactoryInterface<ROOT_TYPE>::ClassNames &
ClassFactoryInterface<ROOT_TYPE>::RegisteredClasses() {
return Names();
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@ -216,7 +243,7 @@ bool ClassFactoryInterface<ROOT_TYPE>::RegisterFactory(ClassFactoryInterface<ROO
Classes()[factory->className()] = factory;
Names()[factory->typeInfo()] = factory->className();
return true;
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

View File

@ -42,7 +42,7 @@ class GenericMessage : public ::Seiscomp::Core::Message {
// ----------------------------------------------------------------------
public:
using AttachmentType = T;
using AttachmentList = std::list<typename Seiscomp::Core::SmartPointer<T>::Impl>;
using AttachmentList = std::list<Seiscomp::Core::SmartPointer<T>>;
typedef typename AttachmentList::iterator iterator;
typedef typename AttachmentList::const_iterator const_iterator;
@ -70,8 +70,8 @@ class GenericMessage : public ::Seiscomp::Core::Message {
* @retval true The operation was successfull and the object has been attached properly
* @retval false The object is nullptr or the object has been attached already
*/
bool attach(AttachmentType* attachment);
bool attach(typename Seiscomp::Core::SmartPointer<AttachmentType>::Impl& attachment);
bool attach(AttachmentType *attachment);
bool attach(typename Seiscomp::Core::SmartPointer<AttachmentType> &attachment);
/**
* Detaches an already attached object from the message
@ -79,8 +79,8 @@ class GenericMessage : public ::Seiscomp::Core::Message {
* @retval true The object has been detached successfully
* @retval false The object has not been attached before
*/
bool detach(AttachmentType* attachment);
bool detach(typename Seiscomp::Core::SmartPointer<AttachmentType>::Impl& attachment);
bool detach(AttachmentType *attachment);
bool detach(typename Seiscomp::Core::SmartPointer<AttachmentType> &attachment);
/**
* Detaches an object from the message
@ -91,7 +91,7 @@ class GenericMessage : public ::Seiscomp::Core::Message {
iterator detach(iterator it);
//! Removes all attachments from the message
void clear();
virtual void clear() override;
//! Returns the iterators for begin and end of
//! the attachment list
@ -102,19 +102,19 @@ class GenericMessage : public ::Seiscomp::Core::Message {
const_iterator end() const;
//! Implemented from baseclass
bool empty() const;
bool empty() const override;
/**
* @return Returns the number of objects attached to a message
*/
int size() const;
int size() const override;
// ----------------------------------------------------------------------
// Protected interface
// ----------------------------------------------------------------------
protected:
MessageIterator::Impl* iterImpl() const;
MessageIterator::Impl* iterImpl() const override;
// ----------------------------------------------------------------------
// Implementation
@ -132,7 +132,7 @@ class GenericMessage : public ::Seiscomp::Core::Message {
class APIDef TYPENAME : public ::Seiscomp::Core::GenericMessage<CLASS> { \
DECLARE_SC_CLASS(TYPENAME); \
}; \
typedef ::Seiscomp::Core::SmartPointer<TYPENAME>::Impl TYPENAME##Ptr
using TYPENAME##Ptr = ::Seiscomp::Core::SmartPointer<TYPENAME>
#define IMPLEMENT_MESSAGE_FOR(CLASS, TYPENAME, NAME) \
IMPLEMENT_SC_CLASS_DERIVED(TYPENAME, ::Seiscomp::Core::Message, NAME)

View File

@ -26,15 +26,15 @@ class MessageIteratorImplT : public MessageIterator::Impl {
: _it(it), _end(end) {}
public:
MessageIterator::Impl* clone() const {
MessageIterator::Impl* clone() const override {
return new MessageIteratorImplT<T>(_it, _end);
}
Seiscomp::Core::BaseObject* get() const {
Seiscomp::Core::BaseObject* get() const override {
return _it == _end?nullptr:(*_it).get();
}
void next() {
void next() override {
++_it;
}
@ -86,10 +86,10 @@ inline bool GenericMessage<T>::attach(AttachmentType* attachment) {
iterator it = std::find(_attachments.begin(), _attachments.end(), attachment);
if ( it != _attachments.end() )
return false;
_attachments.push_back(attachment);
return true;
return true;
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@ -98,9 +98,9 @@ inline bool GenericMessage<T>::attach(AttachmentType* attachment) {
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
template <typename T>
inline bool GenericMessage<T>::attach(typename Seiscomp::Core::SmartPointer<AttachmentType>::Impl& attachment) {
inline bool GenericMessage<T>::attach(typename Seiscomp::Core::SmartPointer<AttachmentType> &attachment) {
return attach(attachment.get());
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@ -124,7 +124,7 @@ inline bool GenericMessage<T>::detach(AttachmentType* attachment) {
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
template <typename T>
inline bool GenericMessage<T>::detach(typename Seiscomp::Core::SmartPointer<AttachmentType>::Impl& attachment) {
inline bool GenericMessage<T>::detach(typename Seiscomp::Core::SmartPointer<AttachmentType> &attachment) {
return detach(attachment.get());
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

View File

@ -44,23 +44,23 @@ class SC_SYSTEM_CORE_API GenericRecord : public Record {
public:
//! Default Constructor
GenericRecord(Array::DataType dt = Array::DOUBLE, Hint h = DATA_ONLY);
//! Initializing Constructor
GenericRecord(std::string net, std::string sta,
std::string loc, std::string cha,
Core::Time stime, double fsamp, int tqual = -1,
Array::DataType dt = Array::DOUBLE,
Hint h = DATA_ONLY);
//! Copy Constructor
GenericRecord(const GenericRecord& rec);
//! Another Constructor
GenericRecord(const Record& rec);
//! Destructor
virtual ~GenericRecord();
// ----------------------------------------------------------------------
// Operators
@ -68,7 +68,7 @@ class SC_SYSTEM_CORE_API GenericRecord : public Record {
public:
//! Assignment operator
GenericRecord& operator=(const GenericRecord& rec);
// ----------------------------------------------------------------------
// Public interface
@ -78,20 +78,20 @@ class SC_SYSTEM_CORE_API GenericRecord : public Record {
void setSamplingFrequency(double freq);
//! Returns the data samples if the data is available; otherwise 0
Array* data();
Array *data();
//! Returns the data samples if the data is available; otherwise 0
const Array* data() const;
const Array* data() const override;
//! Same as data()
const Array* raw() const;
const Array* raw() const override;
//! Returns the clipmask. The size of the clipmask matches the size
//! of the data array and each element (bit) is set to one if the
//! sample at the same index is clipped. The returned pointer is
//! managed by this instance and must not be deleted. But it is safe
//! to store it in a smart pointer.
const BitSet *clipMask() const;
const BitSet *clipMask() const override;
//! Sets the data sample array. The ownership goes over to the record.
//! Note that this call will remove any clip mask set with previous
@ -113,14 +113,14 @@ class SC_SYSTEM_CORE_API GenericRecord : public Record {
void dataUpdated();
//! This method does nothing.
void saveSpace() const;
void saveSpace() const override;
//! Returns a deep copy of the calling object.
Record* copy() const;
Record* copy() const override;
void read(std::istream &in) override;
void write(std::ostream &out) override;
void read(std::istream &in);
void write(std::ostream &out);
// ----------------------------------------------------------------------
// Private members
@ -129,7 +129,7 @@ class SC_SYSTEM_CORE_API GenericRecord : public Record {
ArrayPtr _data;
BitSetPtr _clipMask;
};
}
#endif

View File

@ -114,7 +114,7 @@ class InterfaceFactory : public InterfaceFactoryInterface<T> {
public:
//! The actual creation
typename InterfaceFactoryInterface<T>::Interface* create() const { return new TYPE; }
typename InterfaceFactoryInterface<T>::Interface* create() const override { return new TYPE; }
};
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

View File

@ -39,7 +39,19 @@ namespace Core {
class BaseObject;
typedef boost::any MetaValue;
using MetaValue = boost::any;
template<typename ValueType>
inline ValueType metaValueCast(const MetaValue &operand) {
return boost::any_cast<ValueType>(operand);
}
template<typename ValueType>
inline ValueType metaValueCast(MetaValue &&operand) {
return boost::any_cast<ValueType>(operand);
}
using BadMetaValueCast = boost::bad_any_cast;
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

View File

@ -36,7 +36,7 @@ class Yes { No no[2]; };
template <typename T>
Yes isOptionalTester(boost::optional<T>*);
Yes isOptionalTester(Optional<T>*);
No isOptionalTester(void*);
@ -84,13 +84,13 @@ class MetaEnumImpl : public MetaEnum {
MetaEnumImpl() : MetaEnum() {}
public:
int keyCount() const { return T::Quantity; }
int keyCount() const override { return T::Quantity; }
//! Returns the key name at a given index
const char *key(int index) const;
const char *key(int index) const override;
const char *valueToKey(int value) const;
int keyToValue(const char *key) const;
const char *valueToKey(int value) const override;
int keyToValue(const char *key) const override;
};
#define DECLARE_METAENUM(CLASS, var) Seiscomp::Core::MetaEnumImpl<CLASS> var
@ -148,7 +148,7 @@ class MetaClassProperty : public MetaProperty {
public:
BaseObject *createClass() const {
BaseObject *createClass() const override {
return new T();
}
};
@ -235,14 +235,14 @@ class SimplePropertyHelper<T,U,F1,F2,0> : public MetaProperty {
SimplePropertyHelper(F1 setter, F2 getter)
: _setter(setter), _getter(getter) {}
bool write(BaseObject *object, MetaValue value) const {
bool write(BaseObject *object, MetaValue value) const override {
T *target = T::Cast(object);
if ( !target ) return false;
(target->*_setter)(boost::any_cast<U>(value));
(target->*_setter)(metaValueCast<U>(value));
return true;
}
bool writeString(BaseObject *object, const std::string &value) const {
bool writeString(BaseObject *object, const std::string &value) const override {
T *target = T::Cast(object);
if ( !target ) return false;
@ -254,13 +254,13 @@ class SimplePropertyHelper<T,U,F1,F2,0> : public MetaProperty {
return true;
}
MetaValue read(const BaseObject *object) const {
MetaValue read(const BaseObject *object) const override {
const T *target = T::ConstCast(object);
if ( !target ) throw GeneralException("invalid object");
return (target->*_getter)();
}
std::string readString(const BaseObject *object) const {
std::string readString(const BaseObject *object) const override {
const T *target = T::ConstCast(object);
if ( !target ) throw GeneralException("invalid object");
return toString((target->*_getter)());
@ -277,18 +277,18 @@ class SimplePropertyHelper<T,U,F1,F2,1> : public MetaProperty {
SimplePropertyHelper(F1 setter, F2 getter)
: _setter(setter), _getter(getter) {}
bool write(BaseObject *object, MetaValue value) const {
bool write(BaseObject *object, MetaValue value) const override {
T *target = T::Cast(object);
if ( !target ) return false;
if ( value.empty() )
(target->*_setter)(Core::None);
else
(target->*_setter)(boost::any_cast<U>(value));
(target->*_setter)(metaValueCast<U>(value));
return true;
}
bool writeString(BaseObject *object, const std::string &value) const {
bool writeString(BaseObject *object, const std::string &value) const override {
T *target = T::Cast(object);
if ( !target ) return false;
@ -298,19 +298,19 @@ class SimplePropertyHelper<T,U,F1,F2,1> : public MetaProperty {
typename Core::Generic::remove_optional<U>::type tmp;
if ( !fromString(tmp, value) )
return false;
(target->*_setter)(tmp);
}
return true;
}
MetaValue read(const BaseObject *object) const {
MetaValue read(const BaseObject *object) const override {
const T *target = T::ConstCast(object);
if ( !target ) throw GeneralException("invalid object");
return (target->*_getter)();
}
std::string readString(const BaseObject *object) const {
std::string readString(const BaseObject *object) const override {
const T *target = T::ConstCast(object);
if ( !target ) throw GeneralException("invalid object");
return toString((target->*_getter)());

View File

@ -21,41 +21,66 @@
#ifndef SEISCOMP_CORE_OPTIONAL_H
#define SEISCOMP_CORE_OPTIONAL_H
#include <seiscomp/core.h>
#include <exception>
#include <boost/optional.hpp>
#include <boost/none.hpp>
#include <exception>
#include <optional>
#include <type_traits>
namespace Seiscomp {
namespace Core {
/** \brief Redefines boost::optional<T>
/** \brief Redefines std::optional<T>
* Optional values can be set or unset.
* \code
* void print(const Optional<int>::Impl& v) {
* void print(const Optional<int> &v) {
* if ( !v )
* cout << "value of v is not set" << endl;
* else
* cout << *v << endl;
* }
*
* Optional<int>::Impl a = 5;
* Optional<int> a = 5;
* print(a); // output: "5"
* a = None;
* print(a); // output: "value of v is not set"
* \endcode
*/
template <typename T>
struct Optional {
typedef ::boost::optional<T> Impl;
};
using Optional = ::std::optional<T>;
using NoneType = ::std::nullopt_t;
/** Defines None */
SC_SYSTEM_CORE_API extern ::boost::none_t const None;
SC_SYSTEM_CORE_API extern NoneType const None;
template <class...>
struct False : std::integral_constant<bool, false> {};
template <class...>
struct True : std::integral_constant<bool, true> {};
// Checks whether a type is wrapped with optional or not.
template <typename>
struct isOptional : std::false_type {};
template<template<class...> class U, typename ...Args>
struct isOptional<U<Args...>>
: std::integral_constant<
bool,
std::is_base_of<std::optional<Args...>, U<Args...>>::value
|| std::is_base_of<boost::optional<Args...>, U<Args...>>::value
> {};
template <typename T>
T value(const boost::optional<T>&);
T value(const Optional<T>&);
class SC_SYSTEM_CORE_API ValueError : public std::exception {
public:
@ -63,16 +88,19 @@ class SC_SYSTEM_CORE_API ValueError : public std::exception {
~ValueError() throw();
public:
const char* what() const throw();
const char* what() const throw() override;
};
/** Macro to use optional values easily */
#define OPT(T) Seiscomp::Core::Optional<T>::Impl
#define OPT(T) Seiscomp::Core::Optional<T>
/** Macro to use optional values as const reference */
#define OPT_CR(T) const Seiscomp::Core::Optional<T>::Impl&
#define OPT_CR(T) const Seiscomp::Core::Optional<T>&
#include <seiscomp/core/optional.inl>
}
}

View File

@ -19,7 +19,7 @@
template <typename T>
T value(const boost::optional<T>& v) {
T value(const Optional<T>& v) {
if ( v )
return *v;

View File

@ -43,8 +43,8 @@ class SC_SYSTEM_CORE_API RecordSequence : public std::deque<RecordCPtr> {
// Public types
// ----------------------------------------------------------------------
public:
typedef std::deque<Core::TimeWindow> TimeWindowArray;
typedef std::pair<double,double> Range;
using TimeWindowArray = std::deque<Core::TimeWindow>;
using Range = std::pair<double,double>;
// ----------------------------------------------------------------------
@ -81,28 +81,36 @@ class SC_SYSTEM_CORE_API RecordSequence : public std::deque<RecordCPtr> {
//! Set the time tolerance in samples
void setTolerance(double);
/**
* @brief Returns the lowest iterator to the element which intersects
* or is after a given timestamp.
* @param ts The timestamp.
* @return The iterator
*/
const_iterator lowerBound(const Core::Time &ts) const;
/**
* @brief Returns a highest iterator to the element which intersects
* or is before a given timestamp.
* @param ts The timestamp.
* @return The iterator.
*/
const_iterator upperBound(const Core::Time &ts) const;
//! Return Record's as one contiguous record. Compiled in is support for
//! float, double and int. If interpolation is enabled gaps will be linearly
//! interpolated between the last and the next sample.
template <typename T>
GenericRecord *contiguousRecord(const Seiscomp::Core::TimeWindow *tw = nullptr,
GenericRecord *contiguousRecord(const Core::TimeWindow *tw = nullptr,
bool interpolate = false) const;
//! DECPRECATED: For backward compatibility, does exactly the same as
//! contiguousRecord. Please use contiguousRecord in your
//! code. This method will be removed in future releases.
template <typename T>
GenericRecord *continuousRecord(const Seiscomp::Core::TimeWindow *tw = nullptr,
bool interpolate = false) const;
//! Time window currently in buffer, irrespective of gaps
Core::TimeWindow timeWindow() const;
//! The amplitude range in a given time window.
//! Returns (0,0) if the sequence is empty or no records fall inside
//! the given optional time window.
Range amplitudeRange(const Seiscomp::Core::TimeWindow *tw = nullptr) const;
Range amplitudeRange(const Core::TimeWindow *tw = nullptr) const;
//! returns the continuous time windows available
//! This is usually one time window but may be split into
@ -163,9 +171,9 @@ class SC_SYSTEM_CORE_API TimeWindowBuffer : public RecordSequence {
// Public RecordSequence interface overrides
// ----------------------------------------------------------------------
public:
virtual bool feed(const Record*);
virtual RecordSequence *copy() const;
virtual RecordSequence *clone() const;
virtual bool feed(const Record*) override;
virtual RecordSequence *copy() const override;
virtual RecordSequence *clone() const override;
// ----------------------------------------------------------------------
@ -215,9 +223,9 @@ class SC_SYSTEM_CORE_API RingBuffer : public RecordSequence {
// Public RecordSequence interface overrides
// ----------------------------------------------------------------------
public:
virtual bool feed(const Record*);
virtual RecordSequence *copy() const;
virtual RecordSequence *clone() const;
virtual bool feed(const Record*) override;
virtual RecordSequence *copy() const override;
virtual RecordSequence *clone() const override;
// ----------------------------------------------------------------------
@ -229,7 +237,7 @@ class SC_SYSTEM_CORE_API RingBuffer : public RecordSequence {
//! Return the maximum number of records the RingBuffer stores
unsigned int numberOfRecordsToStore() const;
//! Return the TimeSpan the RingBuffer stores
const Core::TimeSpan &timeSpanToStore() const;
@ -266,11 +274,11 @@ inline const Core::TimeWindow &TimeWindowBuffer::timeWindowToStore() const {
inline unsigned int RingBuffer::numberOfRecordsToStore() const {
return _nmax;
}
inline const Core::TimeSpan &RingBuffer::timeSpanToStore() const {
return _span;
}
}
#endif

View File

@ -131,13 +131,13 @@ class ObjectContainer {
typedef T Type;
//typedef C<T, std::allocator<T> > ContainerType;
typedef C ContainerType;
ObjectContainer(ContainerType& c, ADD a) : _container(&c), _add(a) {}
ContainerType& container() const {
return *_container;
}
bool add(T& v) const {
_add(v);
return true;
@ -188,9 +188,9 @@ ObjectContainer<C<T, std::allocator<T> >, T, ADD> containerMember(C<T, std::allo
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
template <typename Tgt, class ret, class T>
std::function<ret (const typename Core::SmartPointer<Tgt>::Impl &ptr)>
std::function<ret (const Core::SmartPointer<Tgt> &ptr)>
bindMemberFunction(ret (T::*f)(Tgt*), T* c) {
return [c,f](const typename Core::SmartPointer<Tgt>::Impl &ptr) {
return [c,f](const Core::SmartPointer<Tgt> &ptr) {
return (c->*f)(ptr.get());
};
}

View File

@ -32,6 +32,7 @@
#include <limits>
#include <string>
#include <string_view>
#include <vector>
#include <complex>
@ -72,10 +73,10 @@ template <typename ENUMTYPE, ENUMTYPE END, typename NAMES>
std::string toString(const Enum<ENUMTYPE, END, NAMES> &value);
template <typename T>
std::string toString(const std::vector<T> &v);
std::string toString(const std::vector<T> &v, char delimiter = ' ');
template <typename T>
std::string toString(const ::boost::optional<T> &v);
std::string toString(const Optional<T> &v);
template <typename T>
@ -102,20 +103,28 @@ std::ostream &operator<<(std::ostream &os, const Number<double> &s);
* @param str The source string
*/
template <typename T>
bool fromString(T &value, const std::string &str);
bool fromString(T &value, std::string_view sv);
template <typename T>
bool fromString(std::complex<T> &value, const std::string &str);
bool fromString(std::complex<T> &value, std::string_view sv);
SC_SYSTEM_CORE_API bool fromString(Time &value, const std::string &str);
SC_SYSTEM_CORE_API bool fromString(Enumeration &value, const std::string &str);
SC_SYSTEM_CORE_API bool fromString(std::string &value, const std::string &str);
template <>
bool fromString(TimeSpan &value, std::string_view sv);
template <>
bool fromString(Time &value, std::string_view sv);
template <>
bool fromString(Enumeration &value, std::string_view sv);
template <>
bool fromString(std::string &value, std::string_view sv);
template <typename ENUMTYPE, ENUMTYPE END, typename NAMES>
bool fromString(Enum<ENUMTYPE, END, NAMES> &value, const std::string &str);
bool fromString(Enum<ENUMTYPE, END, NAMES> &value, std::string_view sv);
template <typename T>
bool fromString(std::vector<T> &vec, const std::string &str);
bool fromString(std::vector<T> &vec, std::string_view sv, char delimiter = ' ');
/**
@ -142,12 +151,12 @@ int split(std::vector<std::string> &tokens, const char *source,
const char *delimiter, bool compressOn = true);
/**
* @brief Convenience function which takes an std::string as source parameter
* @brief Convenience function which takes an std::string_view as source parameter
* rather than a const char pointer.
* See @ref split(std::vector<std::string> &, const char *, const char *, bool).
*/
SC_SYSTEM_CORE_API
int split(std::vector<std::string> &tokens, const std::string &source,
int split(std::vector<std::string> &tokens, std::string_view source,
const char *delimiter, bool compressOn = true);
/**
@ -205,13 +214,7 @@ SC_SYSTEM_CORE_API bool isEmpty(const char*);
* A case-insensitive comparison.
* @return Result as defined by strcmp
*/
SC_SYSTEM_CORE_API int compareNoCase(const std::string &a, const std::string &b);
/** Removes whitespace at the beginning and end of the string.
* @param string to be trimmed (in/out parameter)
* @return returns the trimmed string
*/
SC_SYSTEM_CORE_API std::string &trim(std::string &str);
SC_SYSTEM_CORE_API int compareNoCase(std::string_view a, std::string_view b);
template <typename T>
void toHex(std::string &target, T source);
@ -237,25 +240,17 @@ SC_SYSTEM_CORE_API bool wildcmp(const std::string &wild, const std::string &str)
SC_SYSTEM_CORE_API bool wildicmp(const char *wild, const char *str);
SC_SYSTEM_CORE_API bool wildicmp(const std::string &wild, const std::string &str);
// -------------------------------------------------------------------------
// Plain C string functions which do not modify the input string and work
// mostly with length rather than an terminating null byte.
// -------------------------------------------------------------------------
/**
* @brief Tokenizes an input string. Empty tokens will be skipped and not
* returned (also referred to as compression).
* @param str The input string. The address is modified that it will point to
* the next token.
* @param sv The input string. The address is modified that it will point to
* the next token.
* @param delim A string of characters of allowed delimiters
* @param len_source The source length. This parameter will be modified
* to match the remaining length of the string.
* @param len_tok The length of the returned token.
* @return The address to the token found or nullptr.
* @return The matching substring as string_view. If the data pointer is
* nullptr then no further matches are possible.
*/
template <typename T>
T *tokenize(T *&str, const char *delim, size_t &len_source, size_t &len_tok);
SC_SYSTEM_CORE_API
std::string_view tokenize(std::string_view &sv, const char *delim);
/**
* @brief Works like tokenize but does not compress empty tokens.
@ -267,6 +262,18 @@ T *tokenize(T *&str, const char *delim, size_t &len_source, size_t &len_tok);
* @param len_tok The length of the returned token.
* @return The address to the token found or nullptr.
*/
SC_SYSTEM_CORE_API
std::string_view tokenize2(std::string_view &sv, const char *delim);
// -------------------------------------------------------------------------
// Plain C string functions which do not modify the input string and work
// mostly with length rather than an terminating null byte.
// -------------------------------------------------------------------------
template <typename T>
T *tokenize(T *&str, const char *delim, size_t &len_source, size_t &len_tok);
template <typename T>
T *tokenize2(T *&str, const char *delim, size_t &len_source, size_t &len_tok);
@ -298,7 +305,7 @@ const char *tokenizeExt(size_t &lenTok, size_t &lenSource, const char *&source,
const char *whitespaces = " \t\n\v\f\r",
const char *quotes = "\"'");
/**
/**split(
* @brief Splits a string into several tokens separated by one of the specified
* delimiter characters. A delimiter character is ignored if it occurs in
* a quoted string or if it is protected by a backslash. Likewise quotes
@ -343,6 +350,7 @@ SC_SYSTEM_CORE_API bool isEmpty(const char*);
*/
char *trimFront(char *&data, size_t &len);
const char *trimFront(const char *&data, size_t &len);
SC_SYSTEM_CORE_API std::string_view trimFront(std::string_view sv);
/**
* @brief Removes whitespaces from the back of a string.
@ -353,6 +361,7 @@ const char *trimFront(const char *&data, size_t &len);
*/
char *trimBack(char *data, size_t &len);
const char *trimBack(const char *data, size_t &len);
SC_SYSTEM_CORE_API std::string_view trimBack(std::string_view sv);
/**
* @brief Strips whitespaces from the front and the back of the string.
@ -364,6 +373,9 @@ const char *trimBack(const char *data, size_t &len);
*/
char *trim(char *&data, size_t &len);
const char *trim(const char *&data, size_t &len);
SC_SYSTEM_CORE_API std::string_view trim(std::string_view sv);
SC_SYSTEM_CORE_API std::string &trim(std::string &str);
char *strnchr(char *p, size_t n, char c);
const char *strnchr(const char *p, size_t n, char c);
@ -460,6 +472,26 @@ class ContainerSource {
};
struct InputStringViewBuf : std::streambuf {
InputStringViewBuf(std::string_view sv) {
auto d = const_cast<char*>(sv.data());
this->setg(d, d, d + sv.size());
}
virtual pos_type seekoff(off_type off, std::ios_base::seekdir,
std::ios_base::openmode) override {
return off ? -1 : gptr() - eback();
}
};
struct InputStringViewStream : virtual InputStringViewBuf, std::istream {
InputStringViewStream(std::string_view sv)
: InputStringViewBuf(sv)
, std::istream(static_cast<std::streambuf*>(this)) {}
};
}
}

View File

@ -18,11 +18,8 @@
***************************************************************************/
#include <seiscomp/core/enumeration.h>
#include <cctype>
#include <sstream>
#include <complex>
namespace Seiscomp {
@ -92,18 +89,20 @@ std::string toString(const Enum<ENUMTYPE, END, NAMES>& value) {
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
template <typename T>
inline std::string toString(const std::vector<T>& v) {
typename std::vector<T>::const_iterator it = v.begin();
inline std::string toString(const std::vector<T>& v, char delimiter) {
auto it = v.begin();
std::string str;
if ( it != v.end() )
if ( it != v.end() ) {
str += toString(*it);
else
}
else {
return "";
}
++it;
while ( it != v.end() ) {
str += " ";
str += delimiter;
str += toString(*it);
++it;
}
@ -117,7 +116,7 @@ inline std::string toString(const std::vector<T>& v) {
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
template <typename T>
inline std::string toString(const ::boost::optional<T>& v) {
inline std::string toString(const Seiscomp::Core::Optional<T> &v) {
if ( !v )
return "None";
@ -128,6 +127,36 @@ inline std::string toString(const ::boost::optional<T>& v) {
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
#if __cplusplus >= 201703L
template <typename T>
bool fromString(boost::optional<T> &value, const std::string &str) {
static_assert(
False<T>::value,
"String conversion for boost optional values is not supported"
);
return false;
}
#endif
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
template <typename T>
bool fromString(Optional<T> &value, const std::string &str) {
static_assert(
False<T>::value,
"String conversion for optional values is not supported"
);
return false;
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
template <typename ENUMTYPE, ENUMTYPE END, typename NAMES>
bool fromString(Enum<ENUMTYPE, END, NAMES>& value, const std::string& str) {
@ -154,7 +183,7 @@ inline bool fromString(std::complex<T>& value, const std::string& str) {
return false;
T realPart, imgPart;
if ( !fromString(realPart, str.substr(s+1, delimPos-s-1)) ) return false;
if ( !fromString(imgPart, str.substr(delimPos+1, e-delimPos-1)) ) return false;
@ -169,13 +198,16 @@ inline bool fromString(std::complex<T>& value, const std::string& str) {
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
template <typename T>
inline bool fromString(std::vector<T>& vec, const std::string& str) {
inline bool fromString(std::vector<T>& vec, std::string_view sv, char delimiter) {
std::vector<std::string> tokens;
split(tokens, str.c_str(), " ");
char tmp[2] = { delimiter, '\0' };
split(tokens, sv, tmp);
vec.clear();
for ( size_t i = 0; i < tokens.size(); ++i ) {
T v;
if ( !fromString(v, tokens[i]) )
if ( !fromString(v, tokens[i]) ) {
return false;
}
vec.push_back(v);
}
@ -188,28 +220,39 @@ inline bool fromString(std::vector<T>& vec, const std::string& str) {
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
template <typename T>
inline bool fromString(std::vector<std::complex<T> >& vec, const std::string& str) {
inline bool fromString(std::vector<std::complex<T> >& vec, std::string_view sv, char delimiter) {
std::vector<std::string> tokens;
split(tokens, str.c_str(), " ");
char tmp[2] = { delimiter, '\0' };
split(tokens, sv, tmp);
vec.clear();
for ( size_t i = 0; i < tokens.size(); ++i ) {
std::complex<T> v;
int count = 1;
size_t countPos = tokens[i].find_first_not_of(' ');
size_t countPos = tokens[i].find_first_not_of(delimiter);
if ( countPos != std::string::npos ) {
if ( tokens[i][countPos] != '(' ) {
size_t bracketPos = tokens[i].find('(', countPos);
// Invalid complex string
if ( bracketPos == std::string::npos ) continue;
if ( !fromString(count, tokens[i].substr(countPos, bracketPos-countPos)) )
if ( bracketPos == std::string::npos ) {
continue;
}
if ( !fromString(count, tokens[i].substr(countPos, bracketPos-countPos)) ) {
return false;
}
tokens[i] = tokens[i].substr(bracketPos);
}
}
if ( !fromString(v, tokens[i]) ) return false;
for ( int i = 0; i < count; ++i )
if ( !fromString(v, tokens[i]) ) {
return false;
}
for ( int c = 0; c < count; ++c ) {
vec.push_back(v);
}
}
return true;
@ -428,7 +471,7 @@ std::string join(const CONT &tokens, const std::string &separator) {
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
template <typename S, typename... Args>
inline std::string stringify(const S &format, Args &&...args) {
return fmt::vsprintf(format, fmt::make_printf_args(args...));
return fmt::sprintf(format, args...);
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

View File

@ -21,44 +21,80 @@
#ifndef SC_CORE_TIMESPAN_H
#define SC_CORE_TIMESPAN_H
#include<seiscomp/core.h>
#include<seiscomp/core/datetime.h>
#include <seiscomp/core.h>
#include <seiscomp/core/datetime.h>
#include <seiscomp/core/optional.h>
#include <ostream>
namespace Seiscomp {
namespace Core {
class SC_SYSTEM_CORE_API TimeWindow {
// Xstruction
// ----------------------------------------------------------------------
// X'truction
// ----------------------------------------------------------------------
public:
TimeWindow();
TimeWindow() = default;
TimeWindow(const Time &startTime, double length);
TimeWindow(const Time &startTime, const TimeSpan length);
TimeWindow(const Time &startTime, const Time &endTime);
TimeWindow(const TimeWindow &tw);
~TimeWindow() {}
TimeWindow(const TimeWindow &other);
// Operators
// ----------------------------------------------------------------------
// Assignment operators
// ----------------------------------------------------------------------
public:
TimeWindow &operator=(const TimeWindow&);
// ----------------------------------------------------------------------
// Comparison operators
// ----------------------------------------------------------------------
public:
bool operator==(const TimeWindow&) const;
bool operator!=(const TimeWindow&) const;
// ----------------------------------------------------------------------
// Arithmetic operators
// ----------------------------------------------------------------------
public:
//! Returns the minimal timewindow including this and other
TimeWindow operator|(const TimeWindow &other) const;
//! Sets the minimal timewindow including this and other
TimeWindow &operator|=(const TimeWindow &other);
//! Returns the intersection of this and other
TimeWindow operator&(const TimeWindow &other) const;
//! Sets the intersection of this and other
TimeWindow &operator&=(const TimeWindow &other);
// ----------------------------------------------------------------------
// Cast operators
// ----------------------------------------------------------------------
public:
//! Returns if the time window has length larger than 0.
operator bool() const;
//! Returns the minimal timewindow including this and other
TimeWindow operator|(const TimeWindow &other) const;
// more operators :-)
// Interface
// ----------------------------------------------------------------------
// Public interface
// ----------------------------------------------------------------------
public:
Time startTime() const;
Time endTime() const;
double length() const;
TimeSpan length() const;
void set(const Time &t1, const Time &t2);
void setStartTime(const Time &t);
void setEndTime(const Time &t);
//! set length in seconds, affects endTime
void setLength(double length);
void setLength(TimeSpan length);
//! does it contain time t?
bool contains(const Time &t) const;
@ -68,111 +104,102 @@ class SC_SYSTEM_CORE_API TimeWindow {
//! is equal to time window?
//! +/- tolerance in seconds
bool equals(const TimeWindow &tw, double tolerance=0.0) const;
bool equals(const TimeWindow &tw, TimeSpan tolerance = TimeSpan(0, 0)) const;
//! does it overlap with time window tw?
bool overlaps(const TimeWindow &tw) const;
//! compute overlap with time window tw
TimeWindow overlap(const TimeWindow &tw) const;
//! test if this+other would form a contiguous time window
bool contiguous(const TimeWindow&, double tolerance=0) const;
bool contiguous(const TimeWindow &, TimeSpan tolerance = TimeSpan(0, 0)) const;
//! extend time window by appending the other (without check!)
void extend(const TimeWindow&);
//! Sets the intersection time window with this and other
TimeWindow &overlap(const TimeWindow &other);
//! merges this and other to the minimal timewindow overlapping both
TimeWindow merge(const TimeWindow&) const;
//! Computes the intersection with time window other
TimeWindow overlapped(const TimeWindow &other) const;
// Implementation
//! Merges other into this to the minimal timewindow overlapping both.
TimeWindow &merge(const TimeWindow &other);
//! Returns the minimal timewindow including this and other
TimeWindow merged(const TimeWindow &other) const;
// ----------------------------------------------------------------------
// Private members
// ----------------------------------------------------------------------
private:
Time _startTime, _endTime;
Time _startTime;
Time _endTime;
};
inline TimeWindow::TimeWindow()
{
set(Time(), Time());
}
inline TimeWindow::TimeWindow(const Time &startTime, double length)
{
set(startTime, startTime + Time(length)); // FIXME
}
class SC_SYSTEM_CORE_API OpenTimeWindow {
// ----------------------------------------------------------------------
// X'truction
// ----------------------------------------------------------------------
public:
OpenTimeWindow() = default;
OpenTimeWindow(const OPT(Time) &startTime, const OPT(Time) &endTime);
OpenTimeWindow(const OpenTimeWindow &other);
inline TimeWindow::TimeWindow(const Time &startTime, const Time &endTime)
{
set(startTime, endTime);
}
inline TimeWindow::TimeWindow(const TimeWindow &tw)
{
set(tw._startTime, tw._endTime);
}
// ----------------------------------------------------------------------
// Assignment operators
// ----------------------------------------------------------------------
public:
OpenTimeWindow &operator=(const OpenTimeWindow&);
inline bool TimeWindow::operator==(const TimeWindow &tw) const
{
return _startTime == tw._startTime && _endTime == tw._endTime;
}
inline bool TimeWindow::operator!=(const TimeWindow &tw) const
{
return _startTime != tw._startTime || _endTime != tw._endTime;
}
// ----------------------------------------------------------------------
// Comparison operators
// ----------------------------------------------------------------------
public:
bool operator==(const OpenTimeWindow&) const;
bool operator!=(const OpenTimeWindow&) const;
inline TimeWindow::operator bool() const
{
return (bool)_startTime && (bool)_endTime;
}
inline Time TimeWindow::startTime() const
{
return _startTime;
}
// ----------------------------------------------------------------------
// Public interface
// ----------------------------------------------------------------------
public:
OPT(Time) startTime() const;
OPT(Time) endTime() const;
OPT(TimeSpan) length() const;
inline Time TimeWindow::endTime() const
{
return _endTime;
}
void set(const OPT(Time) &t1, const OPT(Time) &t2);
void setStartTime(const OPT(Time) &t);
void setEndTime(const OPT(Time) &t);
inline double TimeWindow::length() const
{
return (double)(_endTime-_startTime);
}
//! does it contain time t?
bool contains(const Time &t) const;
inline void TimeWindow::set(const Time &startTime, const Time &endTime)
{
_startTime = startTime;
_endTime = endTime;
}
//! does it contain time window tw completely?
bool contains(const OpenTimeWindow &tw) const;
inline void TimeWindow::setStartTime(const Time &t)
{
_startTime = t;
}
//! does it overlap with time window tw?
bool overlaps(const OpenTimeWindow &tw) const;
inline void TimeWindow::setEndTime(const Time &t)
{
_endTime = t;
}
inline void TimeWindow::setLength(double length)
{
_endTime = _startTime + Time(length); // FIXME
}
// ----------------------------------------------------------------------
// Private members
// ----------------------------------------------------------------------
private:
OPT(Time) _startTime;
OPT(Time) _endTime;
};
inline bool TimeWindow::contains(const Time &t) const
{
return t >= _startTime && t < _endTime;
}
inline bool TimeWindow::contains(const TimeWindow &tw) const
{
return tw._startTime >= _startTime && tw._endTime <= _endTime;
}
std::ostream &operator<<(std::ostream &os, const TimeWindow &timeWindow);
std::ostream &operator<<(std::ostream &os, const OpenTimeWindow &timeWindow);
#include "timewindow.ipp"
}
}
#endif

View File

@ -31,12 +31,12 @@ namespace Seiscomp {
namespace Core {
/* #if (SC_API_VERSION >= SC_API_VERSION_CHECK(16, 4, 0)) */
/* #if (SC_API_VERSION >= SC_API_VERSION_CHECK(17, 0, 0)) */
#define SC_API_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch))
/* SC_API_VERSION is (major << 16) + (minor << 8) + patch. */
#define SC_API_VERSION 0x100400
#define SC_API_VERSION 0x110000
#define SC_API_VERSION_MAJOR(v) (v >> 16)
#define SC_API_VERSION_MINOR(v) ((v >> 8) & 0xff)
@ -46,6 +46,62 @@ namespace Core {
/******************************************************************************
API Changelog
******************************************************************************
"17.0.0" 0x110000
- Added Seiscomp::Gui::Scheme::records.showEngineeringValues
- Added Seiscomp::Gui::RecordView::showEngineeringValues(bool)
- Added Seiscomp::Gui::RecordWidget::showEngineeringValues(bool)
- Added Seiscomp::Client::Application::handleSOH
- Added Seiscomp::Processing::MagnitudeProcessor_MLc _c6, _H and _minDepth.
- Added Seiscomp::Processing::AmplitudeProcessor::parameter
- Made Seiscomp::IO::DatabaseInterface::escape a const method
- Increased TILESTORE_API version to 5
- Added Seiscomp::Processing::WaveformProcessor::Status enumeration PeriodOutOfRange
- Renamed Seiscomp::Core::Time::seconds() to Time::epochSeconds()
- Added Seiscomp::Core::Time::epoch()
- Deprecated Seiscomp::Core::Time::valid()
- Removed implicit Seiscomp::Core::TimeSpan and Seiscomp::Core::Time double cast
- Removed Seiscomp::System::CommandLine::parse(inv argc, char **argv, *)
- Added Seiscomp::System::CommandLine::parse(std::vector<std::string>, *)
- Changed Seiscomp::Core::Time in Seiscomp::IO::RecordStream::addStream,
Seiscomp::IO::RecordStream::setStartTime and
Seiscomp::IO::RecordStream::setEndTime to OPT(Seiscomp::Core::Time)
- Changed Seiscomp::Core::Time in Seiscomp::Client::StreamApplication::setStartTime
and Seiscomp::Client::StreamApplication::setEndTime to OPT(Seiscomp::Core::Time)
- Rename Seiscomp::Wired::ClientSession::inAvail to outputBufferSize and
remove virtual declaration
- Added abstract virtual function MagnitudeProcessor::setDefaults() which must
be implemented by all derived classes.
- Changed Seiscomp::Core::TimeWindow cast to bool semantic
- Changed Seiscomp::Core::TimeWindow::length return type, from double to
Seiscomp::Core::TimeSpan
- Changed Seiscomp::Core::TimeWindow::setLength length argument from double
to Seiscomp::Core::TimeSpan
- Changed Seiscomp::Core::TimeWindow::equals tolerance argument from double
to Seiscomp::Core::TimeSpan
- Changed Seiscomp::Core::TimeWindow::contiguous tolerance argument from double
to Seiscomp::Core::TimeSpan
- Added Seiscomp::Core::metaValueCast
- Removed typedef Seiscomp::Core::SmartPointer::Impl
- Added Seiscomp::Core::SmartPointer as typedef for boost::instrusive_ptr
- Removed typedef Seiscomp::Core::Optional::Impl
- Added Seiscomp::Core::Optional as typedef for boost::optional
- Added Seiscomp::Math::Geo::WGS84_MEAN_RADIUS
- Added Seiscomp::Math::Geo::WGS84_KM_OF_DEGREE
- Added Seiscomp::Math::Geo::WGS84_SEMI_MAJOR_AXIS
- Added Seiscomp::Math::Geo::WGS84_FLATTENING
- Removed defined KM_OF_DEGREE
- Renamed Seiscomp::ellipcorr to Seiscomp::ellipticityCorrection
- Removed Seiscomp::DataModel::DatabaseQuery::getStation
- Added Seiscomp::Geo::readFEP
- Added Seiscomp::Geo::writeGeoJSON
- Added Seiscomp::Math::Matrix3<T> ostream output operator
- Added Seiscomp::Math::Vector3<T> ostream output operator
- Added Seiscomp::Math::Matrix3<T>::operator*
- Added Seiscomp::Math::Matrix3<T>::operator=
- Added static Seiscomp::Math::Matrix3<T>::Rotate[X|Y|Z]
- Added unary Seiscomp::Math::Vector3<T>::operator+
- Added unary Seiscomp::Math::Vector3<T>::operator-
- Added Seiscomp::Math::Vector3<T>::normalized
"16.4.0" 0x100400
- Added Seiscomp::Math::double2frac

View File

@ -92,25 +92,25 @@ class SC_SYSTEM_CORE_API Access : public Object {
Access();
//! Copy constructor
Access(const Access& other);
Access(const Access &other);
//! Destructor
~Access() override;
// ------------------------------------------------------------------
// Operators
// ------------------------------------------------------------------
public:
//! Copies the metadata of other to this
Access& operator=(const Access& other);
Access &operator=(const Access &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const Access& other) const;
bool operator!=(const Access& other) const;
bool operator==(const Access &other) const;
bool operator!=(const Access &other) const;
//! Wrapper that calls operator==
bool equal(const Access& other) const;
bool equal(const Access &other) const;
// ------------------------------------------------------------------
@ -151,17 +151,17 @@ class SC_SYSTEM_CORE_API Access : public Object {
// ------------------------------------------------------------------
public:
//! Returns the object's index
const AccessIndex& index() const;
const AccessIndex &index() const;
//! Checks two objects for equality regarding their index
bool equalIndex(const Access* lhs) const;
bool equalIndex(const Access *lhs) const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
public:
Routing* routing() const;
Routing *routing() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -67,28 +67,28 @@ class SC_SYSTEM_CORE_API Amplitude : public PublicObject {
public:
//! Copy constructor
Amplitude(const Amplitude& other);
Amplitude(const Amplitude &other);
//! Constructor with publicID
Amplitude(const std::string& publicID);
//! Destructor
~Amplitude() override;
// ------------------------------------------------------------------
// Creators
// ------------------------------------------------------------------
public:
static Amplitude* Create();
static Amplitude* Create(const std::string& publicID);
static Amplitude *Create();
static Amplitude *Create(const std::string& publicID);
// ------------------------------------------------------------------
// Lookup
// ------------------------------------------------------------------
public:
static Amplitude* Find(const std::string& publicID);
static Amplitude *Find(const std::string& publicID);
// ------------------------------------------------------------------
@ -97,14 +97,14 @@ class SC_SYSTEM_CORE_API Amplitude : public PublicObject {
public:
//! Copies the metadata of other to this
//! No changes regarding child objects are made
Amplitude& operator=(const Amplitude& other);
Amplitude &operator=(const Amplitude &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const Amplitude& other) const;
bool operator!=(const Amplitude& other) const;
bool operator==(const Amplitude &other) const;
bool operator!=(const Amplitude &other) const;
//! Wrapper that calls operator==
bool equal(const Amplitude& other) const;
bool equal(const Amplitude &other) const;
// ------------------------------------------------------------------
@ -219,7 +219,7 @@ class SC_SYSTEM_CORE_API Amplitude : public PublicObject {
CreationInfo& creationInfo();
const CreationInfo& creationInfo() const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
@ -232,7 +232,7 @@ class SC_SYSTEM_CORE_API Amplitude : public PublicObject {
* because it already exists in the list
* or it already has another parent
*/
bool add(Comment* obj);
bool add(Comment *obj);
/**
* Removes an object.
@ -241,7 +241,7 @@ class SC_SYSTEM_CORE_API Amplitude : public PublicObject {
* @return false The object has not been removed
* because it does not exist in the list
*/
bool remove(Comment* obj);
bool remove(Comment *obj);
/**
* Removes an object of a particular class.
@ -250,19 +250,19 @@ class SC_SYSTEM_CORE_API Amplitude : public PublicObject {
* @return false The index is out of bounds
*/
bool removeComment(size_t i);
bool removeComment(const CommentIndex& i);
bool removeComment(const CommentIndex &i);
//! Retrieve the number of objects of a particular class
size_t commentCount() const;
//! Index access
//! @return The object at index i
Comment* comment(size_t i) const;
Comment* comment(const CommentIndex& i) const;
Comment *comment(size_t i) const;
Comment *comment(const CommentIndex &i) const;
//! Find an object by its unique attribute(s)
EventParameters* eventParameters() const;
EventParameters *eventParameters() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -78,28 +78,28 @@ class SC_SYSTEM_CORE_API AmplitudeReference : public Object {
AmplitudeReference();
//! Copy constructor
AmplitudeReference(const AmplitudeReference& other);
AmplitudeReference(const AmplitudeReference &other);
//! Custom constructor
AmplitudeReference(const std::string& amplitudeID);
//! Destructor
~AmplitudeReference() override;
// ------------------------------------------------------------------
// Operators
// ------------------------------------------------------------------
public:
//! Copies the metadata of other to this
AmplitudeReference& operator=(const AmplitudeReference& other);
AmplitudeReference &operator=(const AmplitudeReference &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const AmplitudeReference& other) const;
bool operator!=(const AmplitudeReference& other) const;
bool operator==(const AmplitudeReference &other) const;
bool operator!=(const AmplitudeReference &other) const;
//! Wrapper that calls operator==
bool equal(const AmplitudeReference& other) const;
bool equal(const AmplitudeReference &other) const;
// ------------------------------------------------------------------
@ -115,17 +115,17 @@ class SC_SYSTEM_CORE_API AmplitudeReference : public Object {
// ------------------------------------------------------------------
public:
//! Returns the object's index
const AmplitudeReferenceIndex& index() const;
const AmplitudeReferenceIndex &index() const;
//! Checks two objects for equality regarding their index
bool equalIndex(const AmplitudeReference* lhs) const;
bool equalIndex(const AmplitudeReference *lhs) const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
public:
Reading* reading() const;
Reading *reading() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -52,11 +52,11 @@ class SC_SYSTEM_CORE_API ArclinkLog : public PublicObject {
ArclinkLog();
//! Copy constructor
ArclinkLog(const ArclinkLog& other);
ArclinkLog(const ArclinkLog &other);
//! Destructor
~ArclinkLog() override;
// ------------------------------------------------------------------
// Operators
@ -64,16 +64,16 @@ class SC_SYSTEM_CORE_API ArclinkLog : public PublicObject {
public:
//! Copies the metadata of other to this
//! No changes regarding child objects are made
ArclinkLog& operator=(const ArclinkLog& other);
ArclinkLog &operator=(const ArclinkLog &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const ArclinkLog& other) const;
bool operator!=(const ArclinkLog& other) const;
bool operator==(const ArclinkLog &other) const;
bool operator!=(const ArclinkLog &other) const;
//! Wrapper that calls operator==
bool equal(const ArclinkLog& other) const;
bool equal(const ArclinkLog &other) const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
@ -86,8 +86,8 @@ class SC_SYSTEM_CORE_API ArclinkLog : public PublicObject {
* because it already exists in the list
* or it already has another parent
*/
bool add(ArclinkRequest* obj);
bool add(ArclinkUser* obj);
bool add(ArclinkRequest *obj);
bool add(ArclinkUser *obj);
/**
* Removes an object.
@ -96,8 +96,8 @@ class SC_SYSTEM_CORE_API ArclinkLog : public PublicObject {
* @return false The object has not been removed
* because it does not exist in the list
*/
bool remove(ArclinkRequest* obj);
bool remove(ArclinkUser* obj);
bool remove(ArclinkRequest *obj);
bool remove(ArclinkUser *obj);
/**
* Removes an object of a particular class.
@ -106,9 +106,9 @@ class SC_SYSTEM_CORE_API ArclinkLog : public PublicObject {
* @return false The index is out of bounds
*/
bool removeArclinkRequest(size_t i);
bool removeArclinkRequest(const ArclinkRequestIndex& i);
bool removeArclinkRequest(const ArclinkRequestIndex &i);
bool removeArclinkUser(size_t i);
bool removeArclinkUser(const ArclinkUserIndex& i);
bool removeArclinkUser(const ArclinkUserIndex &i);
//! Retrieve the number of objects of a particular class
size_t arclinkRequestCount() const;
@ -116,15 +116,15 @@ class SC_SYSTEM_CORE_API ArclinkLog : public PublicObject {
//! Index access
//! @return The object at index i
ArclinkRequest* arclinkRequest(size_t i) const;
ArclinkRequest* arclinkRequest(const ArclinkRequestIndex& i) const;
ArclinkRequest *arclinkRequest(size_t i) const;
ArclinkRequest *arclinkRequest(const ArclinkRequestIndex &i) const;
ArclinkUser* arclinkUser(size_t i) const;
ArclinkUser* arclinkUser(const ArclinkUserIndex& i) const;
ArclinkUser *arclinkUser(size_t i) const;
ArclinkUser *arclinkUser(const ArclinkUserIndex &i) const;
//! Find an object by its unique attribute(s)
ArclinkRequest* findArclinkRequest(const std::string& publicID) const;
ArclinkUser* findArclinkUser(const std::string& publicID) const;
ArclinkRequest *findArclinkRequest(const std::string& publicID) const;
ArclinkUser *findArclinkUser(const std::string& publicID) const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -91,28 +91,28 @@ class SC_SYSTEM_CORE_API ArclinkRequest : public PublicObject {
public:
//! Copy constructor
ArclinkRequest(const ArclinkRequest& other);
ArclinkRequest(const ArclinkRequest &other);
//! Constructor with publicID
ArclinkRequest(const std::string& publicID);
//! Destructor
~ArclinkRequest() override;
// ------------------------------------------------------------------
// Creators
// ------------------------------------------------------------------
public:
static ArclinkRequest* Create();
static ArclinkRequest* Create(const std::string& publicID);
static ArclinkRequest *Create();
static ArclinkRequest *Create(const std::string& publicID);
// ------------------------------------------------------------------
// Lookup
// ------------------------------------------------------------------
public:
static ArclinkRequest* Find(const std::string& publicID);
static ArclinkRequest *Find(const std::string& publicID);
// ------------------------------------------------------------------
@ -121,14 +121,14 @@ class SC_SYSTEM_CORE_API ArclinkRequest : public PublicObject {
public:
//! Copies the metadata of other to this
//! No changes regarding child objects are made
ArclinkRequest& operator=(const ArclinkRequest& other);
ArclinkRequest &operator=(const ArclinkRequest &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const ArclinkRequest& other) const;
bool operator!=(const ArclinkRequest& other) const;
bool operator==(const ArclinkRequest &other) const;
bool operator!=(const ArclinkRequest &other) const;
//! Wrapper that calls operator==
bool equal(const ArclinkRequest& other) const;
bool equal(const ArclinkRequest &other) const;
// ------------------------------------------------------------------
@ -178,12 +178,12 @@ class SC_SYSTEM_CORE_API ArclinkRequest : public PublicObject {
// ------------------------------------------------------------------
public:
//! Returns the object's index
const ArclinkRequestIndex& index() const;
const ArclinkRequestIndex &index() const;
//! Checks two objects for equality regarding their index
bool equalIndex(const ArclinkRequest* lhs) const;
bool equalIndex(const ArclinkRequest *lhs) const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
@ -196,8 +196,8 @@ class SC_SYSTEM_CORE_API ArclinkRequest : public PublicObject {
* because it already exists in the list
* or it already has another parent
*/
bool add(ArclinkStatusLine* obj);
bool add(ArclinkRequestLine* obj);
bool add(ArclinkStatusLine *obj);
bool add(ArclinkRequestLine *obj);
/**
* Removes an object.
@ -206,8 +206,8 @@ class SC_SYSTEM_CORE_API ArclinkRequest : public PublicObject {
* @return false The object has not been removed
* because it does not exist in the list
*/
bool remove(ArclinkStatusLine* obj);
bool remove(ArclinkRequestLine* obj);
bool remove(ArclinkStatusLine *obj);
bool remove(ArclinkRequestLine *obj);
/**
* Removes an object of a particular class.
@ -216,9 +216,9 @@ class SC_SYSTEM_CORE_API ArclinkRequest : public PublicObject {
* @return false The index is out of bounds
*/
bool removeArclinkStatusLine(size_t i);
bool removeArclinkStatusLine(const ArclinkStatusLineIndex& i);
bool removeArclinkStatusLine(const ArclinkStatusLineIndex &i);
bool removeArclinkRequestLine(size_t i);
bool removeArclinkRequestLine(const ArclinkRequestLineIndex& i);
bool removeArclinkRequestLine(const ArclinkRequestLineIndex &i);
//! Retrieve the number of objects of a particular class
size_t arclinkStatusLineCount() const;
@ -226,15 +226,15 @@ class SC_SYSTEM_CORE_API ArclinkRequest : public PublicObject {
//! Index access
//! @return The object at index i
ArclinkStatusLine* arclinkStatusLine(size_t i) const;
ArclinkStatusLine* arclinkStatusLine(const ArclinkStatusLineIndex& i) const;
ArclinkStatusLine *arclinkStatusLine(size_t i) const;
ArclinkStatusLine *arclinkStatusLine(const ArclinkStatusLineIndex &i) const;
ArclinkRequestLine* arclinkRequestLine(size_t i) const;
ArclinkRequestLine* arclinkRequestLine(const ArclinkRequestLineIndex& i) const;
ArclinkRequestLine *arclinkRequestLine(size_t i) const;
ArclinkRequestLine *arclinkRequestLine(const ArclinkRequestLineIndex &i) const;
//! Find an object by its unique attribute(s)
ArclinkLog* arclinkLog() const;
ArclinkLog *arclinkLog() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -85,25 +85,25 @@ class SC_SYSTEM_CORE_API ArclinkRequestLine : public Object {
ArclinkRequestLine();
//! Copy constructor
ArclinkRequestLine(const ArclinkRequestLine& other);
ArclinkRequestLine(const ArclinkRequestLine &other);
//! Destructor
~ArclinkRequestLine() override;
// ------------------------------------------------------------------
// Operators
// ------------------------------------------------------------------
public:
//! Copies the metadata of other to this
ArclinkRequestLine& operator=(const ArclinkRequestLine& other);
ArclinkRequestLine &operator=(const ArclinkRequestLine &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const ArclinkRequestLine& other) const;
bool operator!=(const ArclinkRequestLine& other) const;
bool operator==(const ArclinkRequestLine &other) const;
bool operator!=(const ArclinkRequestLine &other) const;
//! Wrapper that calls operator==
bool equal(const ArclinkRequestLine& other) const;
bool equal(const ArclinkRequestLine &other) const;
// ------------------------------------------------------------------
@ -142,17 +142,17 @@ class SC_SYSTEM_CORE_API ArclinkRequestLine : public Object {
// ------------------------------------------------------------------
public:
//! Returns the object's index
const ArclinkRequestLineIndex& index() const;
const ArclinkRequestLineIndex &index() const;
//! Checks two objects for equality regarding their index
bool equalIndex(const ArclinkRequestLine* lhs) const;
bool equalIndex(const ArclinkRequestLine *lhs) const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
public:
ArclinkRequest* arclinkRequest() const;
ArclinkRequest *arclinkRequest() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -47,25 +47,25 @@ class SC_SYSTEM_CORE_API ArclinkRequestSummary : public Core::BaseObject {
ArclinkRequestSummary();
//! Copy constructor
ArclinkRequestSummary(const ArclinkRequestSummary& other);
ArclinkRequestSummary(const ArclinkRequestSummary &other);
//! Destructor
~ArclinkRequestSummary() override;
// ------------------------------------------------------------------
// Operators
// ------------------------------------------------------------------
public:
//! Copies the metadata of other to this
ArclinkRequestSummary& operator=(const ArclinkRequestSummary& other);
ArclinkRequestSummary &operator=(const ArclinkRequestSummary &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const ArclinkRequestSummary& other) const;
bool operator!=(const ArclinkRequestSummary& other) const;
bool operator==(const ArclinkRequestSummary &other) const;
bool operator!=(const ArclinkRequestSummary &other) const;
//! Wrapper that calls operator==
bool equal(const ArclinkRequestSummary& other) const;
bool equal(const ArclinkRequestSummary &other) const;
// ------------------------------------------------------------------

View File

@ -82,25 +82,25 @@ class SC_SYSTEM_CORE_API ArclinkStatusLine : public Object {
ArclinkStatusLine();
//! Copy constructor
ArclinkStatusLine(const ArclinkStatusLine& other);
ArclinkStatusLine(const ArclinkStatusLine &other);
//! Destructor
~ArclinkStatusLine() override;
// ------------------------------------------------------------------
// Operators
// ------------------------------------------------------------------
public:
//! Copies the metadata of other to this
ArclinkStatusLine& operator=(const ArclinkStatusLine& other);
ArclinkStatusLine &operator=(const ArclinkStatusLine &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const ArclinkStatusLine& other) const;
bool operator!=(const ArclinkStatusLine& other) const;
bool operator==(const ArclinkStatusLine &other) const;
bool operator!=(const ArclinkStatusLine &other) const;
//! Wrapper that calls operator==
bool equal(const ArclinkStatusLine& other) const;
bool equal(const ArclinkStatusLine &other) const;
// ------------------------------------------------------------------
@ -128,17 +128,17 @@ class SC_SYSTEM_CORE_API ArclinkStatusLine : public Object {
// ------------------------------------------------------------------
public:
//! Returns the object's index
const ArclinkStatusLineIndex& index() const;
const ArclinkStatusLineIndex &index() const;
//! Checks two objects for equality regarding their index
bool equalIndex(const ArclinkStatusLine* lhs) const;
bool equalIndex(const ArclinkStatusLine *lhs) const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
public:
ArclinkRequest* arclinkRequest() const;
ArclinkRequest *arclinkRequest() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -81,28 +81,28 @@ class SC_SYSTEM_CORE_API ArclinkUser : public PublicObject {
public:
//! Copy constructor
ArclinkUser(const ArclinkUser& other);
ArclinkUser(const ArclinkUser &other);
//! Constructor with publicID
ArclinkUser(const std::string& publicID);
//! Destructor
~ArclinkUser() override;
// ------------------------------------------------------------------
// Creators
// ------------------------------------------------------------------
public:
static ArclinkUser* Create();
static ArclinkUser* Create(const std::string& publicID);
static ArclinkUser *Create();
static ArclinkUser *Create(const std::string& publicID);
// ------------------------------------------------------------------
// Lookup
// ------------------------------------------------------------------
public:
static ArclinkUser* Find(const std::string& publicID);
static ArclinkUser *Find(const std::string& publicID);
// ------------------------------------------------------------------
@ -111,14 +111,14 @@ class SC_SYSTEM_CORE_API ArclinkUser : public PublicObject {
public:
//! Copies the metadata of other to this
//! No changes regarding child objects are made
ArclinkUser& operator=(const ArclinkUser& other);
ArclinkUser &operator=(const ArclinkUser &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const ArclinkUser& other) const;
bool operator!=(const ArclinkUser& other) const;
bool operator==(const ArclinkUser &other) const;
bool operator!=(const ArclinkUser &other) const;
//! Wrapper that calls operator==
bool equal(const ArclinkUser& other) const;
bool equal(const ArclinkUser &other) const;
// ------------------------------------------------------------------
@ -140,17 +140,17 @@ class SC_SYSTEM_CORE_API ArclinkUser : public PublicObject {
// ------------------------------------------------------------------
public:
//! Returns the object's index
const ArclinkUserIndex& index() const;
const ArclinkUserIndex &index() const;
//! Checks two objects for equality regarding their index
bool equalIndex(const ArclinkUser* lhs) const;
bool equalIndex(const ArclinkUser *lhs) const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
public:
ArclinkLog* arclinkLog() const;
ArclinkLog *arclinkLog() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -100,25 +100,25 @@ class SC_SYSTEM_CORE_API Arrival : public Object {
Arrival();
//! Copy constructor
Arrival(const Arrival& other);
Arrival(const Arrival &other);
//! Destructor
~Arrival() override;
// ------------------------------------------------------------------
// Operators
// ------------------------------------------------------------------
public:
//! Copies the metadata of other to this
Arrival& operator=(const Arrival& other);
Arrival &operator=(const Arrival &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const Arrival& other) const;
bool operator!=(const Arrival& other) const;
bool operator==(const Arrival &other) const;
bool operator!=(const Arrival &other) const;
//! Wrapper that calls operator==
bool equal(const Arrival& other) const;
bool equal(const Arrival &other) const;
// ------------------------------------------------------------------
@ -221,17 +221,17 @@ class SC_SYSTEM_CORE_API Arrival : public Object {
// ------------------------------------------------------------------
public:
//! Returns the object's index
const ArrivalIndex& index() const;
const ArrivalIndex &index() const;
//! Checks two objects for equality regarding their index
bool equalIndex(const Arrival* lhs) const;
bool equalIndex(const Arrival *lhs) const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
public:
Origin* origin() const;
Origin *origin() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -87,28 +87,28 @@ class SC_SYSTEM_CORE_API AuxDevice : public PublicObject {
public:
//! Copy constructor
AuxDevice(const AuxDevice& other);
AuxDevice(const AuxDevice &other);
//! Constructor with publicID
AuxDevice(const std::string& publicID);
//! Destructor
~AuxDevice() override;
// ------------------------------------------------------------------
// Creators
// ------------------------------------------------------------------
public:
static AuxDevice* Create();
static AuxDevice* Create(const std::string& publicID);
static AuxDevice *Create();
static AuxDevice *Create(const std::string& publicID);
// ------------------------------------------------------------------
// Lookup
// ------------------------------------------------------------------
public:
static AuxDevice* Find(const std::string& publicID);
static AuxDevice *Find(const std::string& publicID);
// ------------------------------------------------------------------
@ -117,14 +117,14 @@ class SC_SYSTEM_CORE_API AuxDevice : public PublicObject {
public:
//! Copies the metadata of other to this
//! No changes regarding child objects are made
AuxDevice& operator=(const AuxDevice& other);
AuxDevice &operator=(const AuxDevice &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const AuxDevice& other) const;
bool operator!=(const AuxDevice& other) const;
bool operator==(const AuxDevice &other) const;
bool operator!=(const AuxDevice &other) const;
//! Wrapper that calls operator==
bool equal(const AuxDevice& other) const;
bool equal(const AuxDevice &other) const;
// ------------------------------------------------------------------
@ -157,12 +157,12 @@ class SC_SYSTEM_CORE_API AuxDevice : public PublicObject {
// ------------------------------------------------------------------
public:
//! Returns the object's index
const AuxDeviceIndex& index() const;
const AuxDeviceIndex &index() const;
//! Checks two objects for equality regarding their index
bool equalIndex(const AuxDevice* lhs) const;
bool equalIndex(const AuxDevice *lhs) const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
@ -175,7 +175,7 @@ class SC_SYSTEM_CORE_API AuxDevice : public PublicObject {
* because it already exists in the list
* or it already has another parent
*/
bool add(AuxSource* obj);
bool add(AuxSource *obj);
/**
* Removes an object.
@ -184,7 +184,7 @@ class SC_SYSTEM_CORE_API AuxDevice : public PublicObject {
* @return false The object has not been removed
* because it does not exist in the list
*/
bool remove(AuxSource* obj);
bool remove(AuxSource *obj);
/**
* Removes an object of a particular class.
@ -193,19 +193,19 @@ class SC_SYSTEM_CORE_API AuxDevice : public PublicObject {
* @return false The index is out of bounds
*/
bool removeAuxSource(size_t i);
bool removeAuxSource(const AuxSourceIndex& i);
bool removeAuxSource(const AuxSourceIndex &i);
//! Retrieve the number of objects of a particular class
size_t auxSourceCount() const;
//! Index access
//! @return The object at index i
AuxSource* auxSource(size_t i) const;
AuxSource* auxSource(const AuxSourceIndex& i) const;
AuxSource *auxSource(size_t i) const;
AuxSource *auxSource(const AuxSourceIndex &i) const;
//! Find an object by its unique attribute(s)
Inventory* inventory() const;
Inventory *inventory() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -82,7 +82,7 @@ class SC_SYSTEM_CORE_API AuxSource : public Object {
AuxSource();
//! Copy constructor
AuxSource(const AuxSource& other);
AuxSource(const AuxSource &other);
//! Custom constructor
AuxSource(const std::string& name);
@ -96,21 +96,21 @@ class SC_SYSTEM_CORE_API AuxSource : public Object {
//! Destructor
~AuxSource() override;
// ------------------------------------------------------------------
// Operators
// ------------------------------------------------------------------
public:
//! Copies the metadata of other to this
AuxSource& operator=(const AuxSource& other);
AuxSource &operator=(const AuxSource &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const AuxSource& other) const;
bool operator!=(const AuxSource& other) const;
bool operator==(const AuxSource &other) const;
bool operator!=(const AuxSource &other) const;
//! Wrapper that calls operator==
bool equal(const AuxSource& other) const;
bool equal(const AuxSource &other) const;
// ------------------------------------------------------------------
@ -153,17 +153,17 @@ class SC_SYSTEM_CORE_API AuxSource : public Object {
// ------------------------------------------------------------------
public:
//! Returns the object's index
const AuxSourceIndex& index() const;
const AuxSourceIndex &index() const;
//! Checks two objects for equality regarding their index
bool equalIndex(const AuxSource* lhs) const;
bool equalIndex(const AuxSource *lhs) const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
public:
AuxDevice* auxDevice() const;
AuxDevice *auxDevice() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -85,25 +85,25 @@ class SC_SYSTEM_CORE_API AuxStream : public Object {
AuxStream();
//! Copy constructor
AuxStream(const AuxStream& other);
AuxStream(const AuxStream &other);
//! Destructor
~AuxStream() override;
// ------------------------------------------------------------------
// Operators
// ------------------------------------------------------------------
public:
//! Copies the metadata of other to this
AuxStream& operator=(const AuxStream& other);
AuxStream &operator=(const AuxStream &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const AuxStream& other) const;
bool operator!=(const AuxStream& other) const;
bool operator==(const AuxStream &other) const;
bool operator!=(const AuxStream &other) const;
//! Wrapper that calls operator==
bool equal(const AuxStream& other) const;
bool equal(const AuxStream &other) const;
// ------------------------------------------------------------------
@ -157,17 +157,17 @@ class SC_SYSTEM_CORE_API AuxStream : public Object {
// ------------------------------------------------------------------
public:
//! Returns the object's index
const AuxStreamIndex& index() const;
const AuxStreamIndex &index() const;
//! Checks two objects for equality regarding their index
bool equalIndex(const AuxStream* lhs) const;
bool equalIndex(const AuxStream *lhs) const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
public:
SensorLocation* sensorLocation() const;
SensorLocation *sensorLocation() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -55,25 +55,25 @@ class SC_SYSTEM_CORE_API Axis : public Core::BaseObject {
Axis();
//! Copy constructor
Axis(const Axis& other);
Axis(const Axis &other);
//! Destructor
~Axis() override;
// ------------------------------------------------------------------
// Operators
// ------------------------------------------------------------------
public:
//! Copies the metadata of other to this
Axis& operator=(const Axis& other);
Axis &operator=(const Axis &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const Axis& other) const;
bool operator!=(const Axis& other) const;
bool operator==(const Axis &other) const;
bool operator!=(const Axis &other) const;
//! Wrapper that calls operator==
bool equal(const Axis& other) const;
bool equal(const Axis &other) const;
// ------------------------------------------------------------------

View File

@ -48,25 +48,25 @@ class SC_SYSTEM_CORE_API Blob : public Core::BaseObject {
Blob();
//! Copy constructor
Blob(const Blob& other);
Blob(const Blob &other);
//! Destructor
~Blob() override;
// ------------------------------------------------------------------
// Operators
// ------------------------------------------------------------------
public:
//! Copies the metadata of other to this
Blob& operator=(const Blob& other);
Blob &operator=(const Blob &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const Blob& other) const;
bool operator!=(const Blob& other) const;
bool operator==(const Blob &other) const;
bool operator!=(const Blob &other) const;
//! Wrapper that calls operator==
bool equal(const Blob& other) const;
bool equal(const Blob &other) const;
// ------------------------------------------------------------------

View File

@ -0,0 +1,217 @@
/***************************************************************************
* 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_DATAMODEL_CATALOG_H
#define SEISCOMP_DATAMODEL_CATALOG_H
#include <string>
#include <seiscomp/datamodel/creationinfo.h>
#include <seiscomp/core/datetime.h>
#include <vector>
#include <seiscomp/datamodel/comment.h>
#include <seiscomp/datamodel/notifier.h>
#include <seiscomp/datamodel/publicobject.h>
#include <seiscomp/core/exceptions.h>
namespace Seiscomp {
namespace DataModel {
DEFINE_SMARTPOINTER(Catalog);
DEFINE_SMARTPOINTER(Comment);
DEFINE_SMARTPOINTER(Event);
class EventParameters;
class SC_SYSTEM_CORE_API Catalog : public PublicObject {
DECLARE_SC_CLASS(Catalog)
DECLARE_SERIALIZATION;
DECLARE_METAOBJECT;
// ------------------------------------------------------------------
// Xstruction
// ------------------------------------------------------------------
protected:
//! Protected constructor
Catalog();
public:
//! Copy constructor
Catalog(const Catalog &other);
//! Constructor with publicID
Catalog(const std::string& publicID);
//! Destructor
~Catalog() override;
// ------------------------------------------------------------------
// Creators
// ------------------------------------------------------------------
public:
static Catalog *Create();
static Catalog *Create(const std::string& publicID);
// ------------------------------------------------------------------
// Lookup
// ------------------------------------------------------------------
public:
static Catalog *Find(const std::string& publicID);
// ------------------------------------------------------------------
// Operators
// ------------------------------------------------------------------
public:
//! Copies the metadata of other to this
//! No changes regarding child objects are made
Catalog &operator=(const Catalog &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const Catalog &other) const;
bool operator!=(const Catalog &other) const;
//! Wrapper that calls operator==
bool equal(const Catalog &other) const;
// ------------------------------------------------------------------
// Setters/Getters
// ------------------------------------------------------------------
public:
void setName(const std::string& name);
const std::string& name() const;
//! Catalog description
void setDescription(const std::string& description);
const std::string& description() const;
//! CreationInfo for the Catalog object.
void setCreationInfo(const OPT(CreationInfo)& creationInfo);
CreationInfo& creationInfo();
const CreationInfo& creationInfo() const;
//! Start of epoch in ISO datetime format
void setStart(Seiscomp::Core::Time start);
Seiscomp::Core::Time start() const;
//! End of epoch (empty if the catalog epoch is open)
void setEnd(const OPT(Seiscomp::Core::Time)& end);
Seiscomp::Core::Time end() const;
void setDynamic(bool dynamic);
bool dynamic() const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
public:
/**
* Add an object.
* @param obj The object pointer
* @return true The object has been added
* @return false The object has not been added
* because it already exists in the list
* or it already has another parent
*/
bool add(Comment *obj);
bool add(Event *obj);
/**
* Removes an object.
* @param obj The object pointer
* @return true The object has been removed
* @return false The object has not been removed
* because it does not exist in the list
*/
bool remove(Comment *obj);
bool remove(Event *obj);
/**
* Removes an object of a particular class.
* @param i The object index
* @return true The object has been removed
* @return false The index is out of bounds
*/
bool removeComment(size_t i);
bool removeComment(const CommentIndex &i);
bool removeEvent(size_t i);
//! Retrieve the number of objects of a particular class
size_t commentCount() const;
size_t eventCount() const;
//! Index access
//! @return The object at index i
Comment *comment(size_t i) const;
Comment *comment(const CommentIndex &i) const;
Event *event(size_t i) const;
//! Find an object by its unique attribute(s)
Event *findEvent(const std::string& publicID) const;
EventParameters *eventParameters() const;
//! Implement Object interface
bool assign(Object *other) override;
bool attachTo(PublicObject *parent) override;
bool detachFrom(PublicObject *parent) override;
bool detach() override;
//! Creates a clone
Object *clone() const override;
//! Implement PublicObject interface
bool updateChild(Object *child) override;
void accept(Visitor *visitor) override;
// ------------------------------------------------------------------
// Implementation
// ------------------------------------------------------------------
private:
// Attributes
std::string _name;
std::string _description;
OPT(CreationInfo) _creationInfo;
Seiscomp::Core::Time _start;
OPT(Seiscomp::Core::Time) _end;
bool _dynamic;
// Aggregations
std::vector<CommentPtr> _comments;
std::vector<EventPtr> _events;
DECLARE_SC_CLASSFACTORY_FRIEND(Catalog);
};
}
}
#endif

View File

@ -42,6 +42,7 @@ class Magnitude;
class StationMagnitude;
class Pick;
class Event;
class Catalog;
class Origin;
class Parameter;
class ParameterSet;
@ -97,25 +98,25 @@ class SC_SYSTEM_CORE_API Comment : public Object {
Comment();
//! Copy constructor
Comment(const Comment& other);
Comment(const Comment &other);
//! Destructor
~Comment() override;
// ------------------------------------------------------------------
// Operators
// ------------------------------------------------------------------
public:
//! Copies the metadata of other to this
Comment& operator=(const Comment& other);
Comment &operator=(const Comment &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const Comment& other) const;
bool operator!=(const Comment& other) const;
bool operator==(const Comment &other) const;
bool operator!=(const Comment &other) const;
//! Wrapper that calls operator==
bool equal(const Comment& other) const;
bool equal(const Comment &other) const;
// ------------------------------------------------------------------
@ -149,12 +150,12 @@ class SC_SYSTEM_CORE_API Comment : public Object {
// ------------------------------------------------------------------
public:
//! Returns the object's index
const CommentIndex& index() const;
const CommentIndex &index() const;
//! Checks two objects for equality regarding their index
bool equalIndex(const Comment* lhs) const;
bool equalIndex(const Comment *lhs) const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
@ -164,20 +165,21 @@ class SC_SYSTEM_CORE_API Comment : public Object {
* Because different parent types are possible, just one
* of these methods will return a valid pointer at a time.
*/
MomentTensor* momentTensor() const;
FocalMechanism* focalMechanism() const;
Amplitude* amplitude() const;
Magnitude* magnitude() const;
StationMagnitude* stationMagnitude() const;
Pick* pick() const;
Event* event() const;
Origin* origin() const;
Parameter* parameter() const;
ParameterSet* parameterSet() const;
Stream* stream() const;
SensorLocation* sensorLocation() const;
Station* station() const;
Network* network() const;
MomentTensor *momentTensor() const;
FocalMechanism *focalMechanism() const;
Amplitude *amplitude() const;
Magnitude *magnitude() const;
StationMagnitude *stationMagnitude() const;
Pick *pick() const;
Event *event() const;
Catalog *catalog() const;
Origin *origin() const;
Parameter *parameter() const;
ParameterSet *parameterSet() const;
Stream *stream() const;
SensorLocation *sensorLocation() const;
Station *station() const;
Network *network() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -49,25 +49,25 @@ class SC_SYSTEM_CORE_API ComplexArray : public Core::BaseObject {
ComplexArray();
//! Copy constructor
ComplexArray(const ComplexArray& other);
ComplexArray(const ComplexArray &other);
//! Destructor
~ComplexArray() override;
// ------------------------------------------------------------------
// Operators
// ------------------------------------------------------------------
public:
//! Copies the metadata of other to this
ComplexArray& operator=(const ComplexArray& other);
ComplexArray &operator=(const ComplexArray &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const ComplexArray& other) const;
bool operator!=(const ComplexArray& other) const;
bool operator==(const ComplexArray &other) const;
bool operator!=(const ComplexArray &other) const;
//! Wrapper that calls operator==
bool equal(const ComplexArray& other) const;
bool equal(const ComplexArray &other) const;
// ------------------------------------------------------------------
@ -75,8 +75,8 @@ class SC_SYSTEM_CORE_API ComplexArray : public Core::BaseObject {
// ------------------------------------------------------------------
public:
void setContent(const std::vector< std::complex<double> >&);
const std::vector< std::complex<double> >& content() const;
std::vector< std::complex<double> >& content();
const std::vector< std::complex<double> > &content() const;
std::vector< std::complex<double> > &content();
// ------------------------------------------------------------------

View File

@ -83,25 +83,25 @@ class SC_SYSTEM_CORE_API CompositeTime : public Object {
CompositeTime();
//! Copy constructor
CompositeTime(const CompositeTime& other);
CompositeTime(const CompositeTime &other);
//! Destructor
~CompositeTime() override;
// ------------------------------------------------------------------
// Operators
// ------------------------------------------------------------------
public:
//! Copies the metadata of other to this
CompositeTime& operator=(const CompositeTime& other);
CompositeTime &operator=(const CompositeTime &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const CompositeTime& other) const;
bool operator!=(const CompositeTime& other) const;
bool operator==(const CompositeTime &other) const;
bool operator!=(const CompositeTime &other) const;
//! Wrapper that calls operator==
bool equal(const CompositeTime& other) const;
bool equal(const CompositeTime &other) const;
// ------------------------------------------------------------------
@ -139,12 +139,12 @@ class SC_SYSTEM_CORE_API CompositeTime : public Object {
RealQuantity& second();
const RealQuantity& second() const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
public:
Origin* origin() const;
Origin *origin() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -101,25 +101,25 @@ class SC_SYSTEM_CORE_API ConfidenceEllipsoid : public Core::BaseObject {
ConfidenceEllipsoid();
//! Copy constructor
ConfidenceEllipsoid(const ConfidenceEllipsoid& other);
ConfidenceEllipsoid(const ConfidenceEllipsoid &other);
//! Destructor
~ConfidenceEllipsoid() override;
// ------------------------------------------------------------------
// Operators
// ------------------------------------------------------------------
public:
//! Copies the metadata of other to this
ConfidenceEllipsoid& operator=(const ConfidenceEllipsoid& other);
ConfidenceEllipsoid &operator=(const ConfidenceEllipsoid &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const ConfidenceEllipsoid& other) const;
bool operator!=(const ConfidenceEllipsoid& other) const;
bool operator==(const ConfidenceEllipsoid &other) const;
bool operator!=(const ConfidenceEllipsoid &other) const;
//! Wrapper that calls operator==
bool equal(const ConfidenceEllipsoid& other) const;
bool equal(const ConfidenceEllipsoid &other) const;
// ------------------------------------------------------------------

View File

@ -50,11 +50,11 @@ class SC_SYSTEM_CORE_API Config : public PublicObject {
Config();
//! Copy constructor
Config(const Config& other);
Config(const Config &other);
//! Destructor
~Config() override;
// ------------------------------------------------------------------
// Operators
@ -62,16 +62,16 @@ class SC_SYSTEM_CORE_API Config : public PublicObject {
public:
//! Copies the metadata of other to this
//! No changes regarding child objects are made
Config& operator=(const Config& other);
Config &operator=(const Config &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const Config& other) const;
bool operator!=(const Config& other) const;
bool operator==(const Config &other) const;
bool operator!=(const Config &other) const;
//! Wrapper that calls operator==
bool equal(const Config& other) const;
bool equal(const Config &other) const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
@ -84,8 +84,8 @@ class SC_SYSTEM_CORE_API Config : public PublicObject {
* because it already exists in the list
* or it already has another parent
*/
bool add(ParameterSet* obj);
bool add(ConfigModule* obj);
bool add(ParameterSet *obj);
bool add(ConfigModule *obj);
/**
* Removes an object.
@ -94,8 +94,8 @@ class SC_SYSTEM_CORE_API Config : public PublicObject {
* @return false The object has not been removed
* because it does not exist in the list
*/
bool remove(ParameterSet* obj);
bool remove(ConfigModule* obj);
bool remove(ParameterSet *obj);
bool remove(ConfigModule *obj);
/**
* Removes an object of a particular class.
@ -112,12 +112,12 @@ class SC_SYSTEM_CORE_API Config : public PublicObject {
//! Index access
//! @return The object at index i
ParameterSet* parameterSet(size_t i) const;
ConfigModule* configModule(size_t i) const;
ParameterSet *parameterSet(size_t i) const;
ConfigModule *configModule(size_t i) const;
//! Find an object by its unique attribute(s)
ParameterSet* findParameterSet(const std::string& publicID) const;
ConfigModule* findConfigModule(const std::string& publicID) const;
ParameterSet *findParameterSet(const std::string& publicID) const;
ConfigModule *findConfigModule(const std::string& publicID) const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -54,28 +54,28 @@ class SC_SYSTEM_CORE_API ConfigModule : public PublicObject {
public:
//! Copy constructor
ConfigModule(const ConfigModule& other);
ConfigModule(const ConfigModule &other);
//! Constructor with publicID
ConfigModule(const std::string& publicID);
//! Destructor
~ConfigModule() override;
// ------------------------------------------------------------------
// Creators
// ------------------------------------------------------------------
public:
static ConfigModule* Create();
static ConfigModule* Create(const std::string& publicID);
static ConfigModule *Create();
static ConfigModule *Create(const std::string& publicID);
// ------------------------------------------------------------------
// Lookup
// ------------------------------------------------------------------
public:
static ConfigModule* Find(const std::string& publicID);
static ConfigModule *Find(const std::string& publicID);
// ------------------------------------------------------------------
@ -84,14 +84,14 @@ class SC_SYSTEM_CORE_API ConfigModule : public PublicObject {
public:
//! Copies the metadata of other to this
//! No changes regarding child objects are made
ConfigModule& operator=(const ConfigModule& other);
ConfigModule &operator=(const ConfigModule &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const ConfigModule& other) const;
bool operator!=(const ConfigModule& other) const;
bool operator==(const ConfigModule &other) const;
bool operator!=(const ConfigModule &other) const;
//! Wrapper that calls operator==
bool equal(const ConfigModule& other) const;
bool equal(const ConfigModule &other) const;
// ------------------------------------------------------------------
@ -107,7 +107,7 @@ class SC_SYSTEM_CORE_API ConfigModule : public PublicObject {
void setEnabled(bool enabled);
bool enabled() const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
@ -120,7 +120,7 @@ class SC_SYSTEM_CORE_API ConfigModule : public PublicObject {
* because it already exists in the list
* or it already has another parent
*/
bool add(ConfigStation* obj);
bool add(ConfigStation *obj);
/**
* Removes an object.
@ -129,7 +129,7 @@ class SC_SYSTEM_CORE_API ConfigModule : public PublicObject {
* @return false The object has not been removed
* because it does not exist in the list
*/
bool remove(ConfigStation* obj);
bool remove(ConfigStation *obj);
/**
* Removes an object of a particular class.
@ -138,20 +138,20 @@ class SC_SYSTEM_CORE_API ConfigModule : public PublicObject {
* @return false The index is out of bounds
*/
bool removeConfigStation(size_t i);
bool removeConfigStation(const ConfigStationIndex& i);
bool removeConfigStation(const ConfigStationIndex &i);
//! Retrieve the number of objects of a particular class
size_t configStationCount() const;
//! Index access
//! @return The object at index i
ConfigStation* configStation(size_t i) const;
ConfigStation* configStation(const ConfigStationIndex& i) const;
ConfigStation *configStation(size_t i) const;
ConfigStation *configStation(const ConfigStationIndex &i) const;
//! Find an object by its unique attribute(s)
ConfigStation* findConfigStation(const std::string& publicID) const;
ConfigStation *findConfigStation(const std::string& publicID) const;
Config* config() const;
Config *config() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -86,28 +86,28 @@ class SC_SYSTEM_CORE_API ConfigStation : public PublicObject {
public:
//! Copy constructor
ConfigStation(const ConfigStation& other);
ConfigStation(const ConfigStation &other);
//! Constructor with publicID
ConfigStation(const std::string& publicID);
//! Destructor
~ConfigStation() override;
// ------------------------------------------------------------------
// Creators
// ------------------------------------------------------------------
public:
static ConfigStation* Create();
static ConfigStation* Create(const std::string& publicID);
static ConfigStation *Create();
static ConfigStation *Create(const std::string& publicID);
// ------------------------------------------------------------------
// Lookup
// ------------------------------------------------------------------
public:
static ConfigStation* Find(const std::string& publicID);
static ConfigStation *Find(const std::string& publicID);
// ------------------------------------------------------------------
@ -116,14 +116,14 @@ class SC_SYSTEM_CORE_API ConfigStation : public PublicObject {
public:
//! Copies the metadata of other to this
//! No changes regarding child objects are made
ConfigStation& operator=(const ConfigStation& other);
ConfigStation &operator=(const ConfigStation &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const ConfigStation& other) const;
bool operator!=(const ConfigStation& other) const;
bool operator==(const ConfigStation &other) const;
bool operator!=(const ConfigStation &other) const;
//! Wrapper that calls operator==
bool equal(const ConfigStation& other) const;
bool equal(const ConfigStation &other) const;
// ------------------------------------------------------------------
@ -150,12 +150,12 @@ class SC_SYSTEM_CORE_API ConfigStation : public PublicObject {
// ------------------------------------------------------------------
public:
//! Returns the object's index
const ConfigStationIndex& index() const;
const ConfigStationIndex &index() const;
//! Checks two objects for equality regarding their index
bool equalIndex(const ConfigStation* lhs) const;
bool equalIndex(const ConfigStation *lhs) const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
@ -168,7 +168,7 @@ class SC_SYSTEM_CORE_API ConfigStation : public PublicObject {
* because it already exists in the list
* or it already has another parent
*/
bool add(Setup* obj);
bool add(Setup *obj);
/**
* Removes an object.
@ -177,7 +177,7 @@ class SC_SYSTEM_CORE_API ConfigStation : public PublicObject {
* @return false The object has not been removed
* because it does not exist in the list
*/
bool remove(Setup* obj);
bool remove(Setup *obj);
/**
* Removes an object of a particular class.
@ -186,19 +186,19 @@ class SC_SYSTEM_CORE_API ConfigStation : public PublicObject {
* @return false The index is out of bounds
*/
bool removeSetup(size_t i);
bool removeSetup(const SetupIndex& i);
bool removeSetup(const SetupIndex &i);
//! Retrieve the number of objects of a particular class
size_t setupCount() const;
//! Index access
//! @return The object at index i
Setup* setup(size_t i) const;
Setup* setup(const SetupIndex& i) const;
Setup *setup(size_t i) const;
Setup *setup(const SetupIndex &i) const;
//! Find an object by its unique attribute(s)
ConfigModule* configModule() const;
ConfigModule *configModule() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -53,25 +53,25 @@ class SC_SYSTEM_CORE_API CreationInfo : public Core::BaseObject {
CreationInfo();
//! Copy constructor
CreationInfo(const CreationInfo& other);
CreationInfo(const CreationInfo &other);
//! Destructor
~CreationInfo() override;
// ------------------------------------------------------------------
// Operators
// ------------------------------------------------------------------
public:
//! Copies the metadata of other to this
CreationInfo& operator=(const CreationInfo& other);
CreationInfo &operator=(const CreationInfo &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const CreationInfo& other) const;
bool operator!=(const CreationInfo& other) const;
bool operator==(const CreationInfo &other) const;
bool operator!=(const CreationInfo &other) const;
//! Wrapper that calls operator==
bool equal(const CreationInfo& other) const;
bool equal(const CreationInfo &other) const;
// ------------------------------------------------------------------

View File

@ -81,25 +81,25 @@ class SC_SYSTEM_CORE_API DataAttributeExtent : public Object {
DataAttributeExtent();
//! Copy constructor
DataAttributeExtent(const DataAttributeExtent& other);
DataAttributeExtent(const DataAttributeExtent &other);
//! Destructor
~DataAttributeExtent() override;
// ------------------------------------------------------------------
// Operators
// ------------------------------------------------------------------
public:
//! Copies the metadata of other to this
DataAttributeExtent& operator=(const DataAttributeExtent& other);
DataAttributeExtent &operator=(const DataAttributeExtent &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const DataAttributeExtent& other) const;
bool operator!=(const DataAttributeExtent& other) const;
bool operator==(const DataAttributeExtent &other) const;
bool operator!=(const DataAttributeExtent &other) const;
//! Wrapper that calls operator==
bool equal(const DataAttributeExtent& other) const;
bool equal(const DataAttributeExtent &other) const;
// ------------------------------------------------------------------
@ -138,17 +138,17 @@ class SC_SYSTEM_CORE_API DataAttributeExtent : public Object {
// ------------------------------------------------------------------
public:
//! Returns the object's index
const DataAttributeExtentIndex& index() const;
const DataAttributeExtentIndex &index() const;
//! Checks two objects for equality regarding their index
bool equalIndex(const DataAttributeExtent* lhs) const;
bool equalIndex(const DataAttributeExtent *lhs) const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
public:
DataExtent* dataExtent() const;
DataExtent *dataExtent() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -54,11 +54,11 @@ class SC_SYSTEM_CORE_API DataAvailability : public PublicObject {
DataAvailability();
//! Copy constructor
DataAvailability(const DataAvailability& other);
DataAvailability(const DataAvailability &other);
//! Destructor
~DataAvailability() override;
// ------------------------------------------------------------------
// Operators
@ -66,16 +66,16 @@ class SC_SYSTEM_CORE_API DataAvailability : public PublicObject {
public:
//! Copies the metadata of other to this
//! No changes regarding child objects are made
DataAvailability& operator=(const DataAvailability& other);
DataAvailability &operator=(const DataAvailability &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const DataAvailability& other) const;
bool operator!=(const DataAvailability& other) const;
bool operator==(const DataAvailability &other) const;
bool operator!=(const DataAvailability &other) const;
//! Wrapper that calls operator==
bool equal(const DataAvailability& other) const;
bool equal(const DataAvailability &other) const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
@ -88,7 +88,7 @@ class SC_SYSTEM_CORE_API DataAvailability : public PublicObject {
* because it already exists in the list
* or it already has another parent
*/
bool add(DataExtent* obj);
bool add(DataExtent *obj);
/**
* Removes an object.
@ -97,7 +97,7 @@ class SC_SYSTEM_CORE_API DataAvailability : public PublicObject {
* @return false The object has not been removed
* because it does not exist in the list
*/
bool remove(DataExtent* obj);
bool remove(DataExtent *obj);
/**
* Removes an object of a particular class.
@ -106,18 +106,18 @@ class SC_SYSTEM_CORE_API DataAvailability : public PublicObject {
* @return false The index is out of bounds
*/
bool removeDataExtent(size_t i);
bool removeDataExtent(const DataExtentIndex& i);
bool removeDataExtent(const DataExtentIndex &i);
//! Retrieve the number of objects of a particular class
size_t dataExtentCount() const;
//! Index access
//! @return The object at index i
DataExtent* dataExtent(size_t i) const;
DataExtent* dataExtent(const DataExtentIndex& i) const;
DataExtent *dataExtent(size_t i) const;
DataExtent *dataExtent(const DataExtentIndex &i) const;
//! Find an object by its unique attribute(s)
DataExtent* findDataExtent(const std::string& publicID) const;
DataExtent *findDataExtent(const std::string& publicID) const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -241,10 +241,10 @@ class SC_SYSTEM_CORE_API DatabaseArchive : protected Core::Archive,
//! Implements derived method
//! @param dataSource user:password@host:port/database
bool open(const char* dataSource);
bool open(const char* dataSource) override;
//! Implements derived method
void close();
void close() override;
//! Returns the used database driver
Seiscomp::IO::DatabaseInterface* driver() const;
@ -261,6 +261,22 @@ class SC_SYSTEM_CORE_API DatabaseArchive : protected Core::Archive,
void benchmarkQueries(int count);
/**
* @brief Returns the query to fetch objects of a particular type.
* @param parentID The publicID of the parent object. When empty then
* it won't be included in the query.
* @param classType The type of the object to be read.
* @param ignorePublicObject If true then the PublicObject table will
* not be joined. That might be important if
* during a schema evolution an objectsturned
* into a PublicObject but an old version
* should be read.
* @return The query and a flag if a where clause is present.
*/
std::pair<std::string,bool> getObjectsQuery(const std::string &parentID,
const Seiscomp::Core::RTTI &classType,
bool ignorePublicObject = false);
/**
* Reads a public object from the database.
* @param classType The type of the object to be read. The type has
@ -269,8 +285,8 @@ class SC_SYSTEM_CORE_API DatabaseArchive : protected Core::Archive,
* @return An unmanaged object pointer. The ownership goes over
* to the caller.
*/
PublicObject* getObject(const Seiscomp::Core::RTTI& classType,
const std::string& publicID);
PublicObject* getObject(const Seiscomp::Core::RTTI &classType,
const std::string &publicID);
/**
* Returns an iterator over all objects of a given type.
@ -285,8 +301,8 @@ class SC_SYSTEM_CORE_API DatabaseArchive : protected Core::Archive,
* should be read.
* @return The database iterator
*/
DatabaseIterator getObjects(const std::string& parentID,
const Seiscomp::Core::RTTI& classType,
DatabaseIterator getObjects(const std::string &parentID,
const Seiscomp::Core::RTTI &classType,
bool ignorePublicObject = false);
/**
@ -302,8 +318,8 @@ class SC_SYSTEM_CORE_API DatabaseArchive : protected Core::Archive,
* should be read.
* @return The database iterator
*/
DatabaseIterator getObjects(const PublicObject* parent,
const Seiscomp::Core::RTTI& classType,
DatabaseIterator getObjects(const PublicObject *parent,
const Seiscomp::Core::RTTI &classType,
bool ignorePublicObject = false);
/**
@ -314,8 +330,8 @@ class SC_SYSTEM_CORE_API DatabaseArchive : protected Core::Archive,
* @param classType The type of the objects to iterate over.
* @return The object count
*/
size_t getObjectCount(const std::string& parentID,
const Seiscomp::Core::RTTI& classType);
size_t getObjectCount(const std::string &parentID,
const Seiscomp::Core::RTTI &classType);
/**
* Returns the number of objects of a given type for a parent
@ -325,7 +341,7 @@ class SC_SYSTEM_CORE_API DatabaseArchive : protected Core::Archive,
* @param classType The type of the objects to iterate over.
* @return The object count
*/
size_t getObjectCount(const PublicObject* parent,
size_t getObjectCount(const PublicObject *parent,
const Seiscomp::Core::RTTI &classType);
@ -338,7 +354,7 @@ class SC_SYSTEM_CORE_API DatabaseArchive : protected Core::Archive,
* @param object The PublicObject whose parent is queried.
* @return The publicID of the parent or an empty string.
*/
std::string parentPublicID(const PublicObject* object);
std::string parentPublicID(const PublicObject *object);
/**
* Inserts an object into the database.
@ -390,7 +406,7 @@ class SC_SYSTEM_CORE_API DatabaseArchive : protected Core::Archive,
// ----------------------------------------------------------------------
protected:
//! Implements derived method
bool create(const char* dataSource);
bool create(const char* dataSource) override;
// ----------------------------------------------------------------------
@ -398,40 +414,40 @@ class SC_SYSTEM_CORE_API DatabaseArchive : protected Core::Archive,
// ----------------------------------------------------------------------
protected:
//! 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;
//! Reads a float complex
virtual void read(std::complex<float>& value);
virtual void read(std::complex<float>& value) override;
//! Reads a double complex
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 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 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;
// ------------------------------------------------------------------
@ -439,47 +455,47 @@ class SC_SYSTEM_CORE_API DatabaseArchive : protected Core::Archive,
// ------------------------------------------------------------------
protected:
//! 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(double value) override;
//! Writes a float complex
virtual void write(std::complex<float>& value);
virtual void write(std::complex<float>& value) override;
//! Writes a double complex
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 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 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;
// ------------------------------------------------------------------
// Protected observer interface
// ------------------------------------------------------------------
protected:
virtual void onObjectDestroyed(Object* object);
virtual void onObjectDestroyed(Object* object) override;
// ------------------------------------------------------------------
@ -487,23 +503,23 @@ class SC_SYSTEM_CORE_API DatabaseArchive : protected Core::Archive,
// ------------------------------------------------------------------
protected:
//! Implements derived method
virtual bool locateObjectByName(const char* name, const char* targetClass, bool nullable);
virtual bool locateObjectByName(const char* name, const char* targetClass, bool nullable) override;
//! Implements derived method
virtual bool locateNextObjectByName(const char* name, const char* targetClass);
virtual bool locateNextObjectByName(const char* name, const char* targetClass) override;
//! Implements derived method
virtual void locateNullObjectByName(const char* name, const char* targetClass, bool first);
virtual void locateNullObjectByName(const char* name, const char* targetClass, bool first) override;
//! Implements derived method
virtual std::string determineClassName();
virtual std::string determineClassName() override;
//! Implements derived method
virtual void setClassName(const char*);
virtual void setClassName(const char*) override;
//! Implements derived method
void serialize(RootType* object);
void serialize(RootType* object) override;
//! Implements derived method
void serialize(SerializeDispatcher&);
void serialize(SerializeDispatcher&) override;
std::string buildQuery(const std::string& table,
const std::string& filter = "");
@ -546,7 +562,7 @@ class SC_SYSTEM_CORE_API DatabaseArchive : protected Core::Archive,
//! Removes an objects from the id cache
void removeId(Object*);
//! Returns the current field content
const char* cfield() const { return _field; }

View File

@ -74,10 +74,6 @@ class SC_SYSTEM_CORE_API DatabaseQuery : public DatabaseReader {
// Query interface
// ----------------------------------------------------------------------
public:
Station* getStation(const std::string& network_code,
const std::string& station_code,
Seiscomp::Core::Time time);
/**
* Returns the Event referencing a particular Origin.
* @param originID The publicID of the Origin
@ -324,6 +320,17 @@ class SC_SYSTEM_CORE_API DatabaseQuery : public DatabaseReader {
DatabaseIterator getEvents(Seiscomp::Core::Time startTime,
Seiscomp::Core::Time endTime);
/**
* Returns events in a given time range
* @param catalogID the publicID of the parent catalog
* @param startTime start time
* @param endTime end time
* @return An iterator to iterate over the events
*/
DatabaseIterator getEvents(const std::string& catalogID,
Seiscomp::Core::Time startTime,
Seiscomp::Core::Time endTime);
/**
* Returns origins for a given event ordered by creation date
* the oldest first.

View File

@ -48,6 +48,7 @@ class DataUsed;
class MomentTensorPhaseSetting;
class MomentTensorStationContribution;
class MomentTensorComponentContribution;
class Catalog;
class Event;
class EventDescription;
class OriginReference;
@ -132,16 +133,17 @@ class SC_SYSTEM_CORE_API DatabaseReader : public DatabaseArchive {
* over to the caller. If no object has been found, NULL
* is returned.
*/
PublicObject* loadObject(const Seiscomp::Core::RTTI& classType,
PublicObject *loadObject(const Seiscomp::Core::RTTI& classType,
const std::string& publicID);
EventParameters* loadEventParameters();
EventParameters *loadEventParameters();
int load(EventParameters*);
int loadPicks(EventParameters*);
int loadAmplitudes(EventParameters*);
int loadReadings(EventParameters*);
int loadOrigins(EventParameters*);
int loadFocalMechanisms(EventParameters*);
int loadCatalogs(EventParameters*);
int loadEvents(EventParameters*);
int load(Pick*);
int loadComments(Pick*);
@ -171,13 +173,16 @@ class SC_SYSTEM_CORE_API DatabaseReader : public DatabaseArchive {
int loadMomentTensorStationContributions(MomentTensor*);
int load(MomentTensorStationContribution*);
int loadMomentTensorComponentContributions(MomentTensorStationContribution*);
int load(Catalog*);
int loadComments(Catalog*);
int loadEvents(Catalog*);
int load(Event*);
int loadEventDescriptions(Event*);
int loadComments(Event*);
int loadOriginReferences(Event*);
int loadFocalMechanismReferences(Event*);
Config* loadConfig();
Config *loadConfig();
int load(Config*);
int loadParameterSets(Config*);
int loadConfigModules(Config*);
@ -190,14 +195,14 @@ class SC_SYSTEM_CORE_API DatabaseReader : public DatabaseArchive {
int loadConfigStations(ConfigModule*);
int load(ConfigStation*);
int loadSetups(ConfigStation*);
QualityControl* loadQualityControl();
QualityControl *loadQualityControl();
int load(QualityControl*);
int loadQCLogs(QualityControl*);
int loadWaveformQualitys(QualityControl*);
int loadOutages(QualityControl*);
Inventory* loadInventory();
Inventory *loadInventory();
int load(Inventory*);
int loadStationGroups(Inventory*);
int loadAuxDevices(Inventory*);
@ -230,34 +235,33 @@ class SC_SYSTEM_CORE_API DatabaseReader : public DatabaseArchive {
int loadStreams(SensorLocation*);
int load(Stream*);
int loadComments(Stream*);
Routing* loadRouting();
Routing *loadRouting();
int load(Routing*);
int loadRoutes(Routing*);
int loadAccesss(Routing*);
int load(Route*);
int loadRouteArclinks(Route*);
int loadRouteSeedlinks(Route*);
Journaling* loadJournaling();
Journaling *loadJournaling();
int load(Journaling*);
int loadJournalEntrys(Journaling*);
ArclinkLog* loadArclinkLog();
ArclinkLog *loadArclinkLog();
int load(ArclinkLog*);
int loadArclinkRequests(ArclinkLog*);
int loadArclinkUsers(ArclinkLog*);
int load(ArclinkRequest*);
int loadArclinkStatusLines(ArclinkRequest*);
int loadArclinkRequestLines(ArclinkRequest*);
DataAvailability* loadDataAvailability();
DataAvailability *loadDataAvailability();
int load(DataAvailability*);
int loadDataExtents(DataAvailability*);
int load(DataExtent*);
int loadDataSegments(DataExtent*);
int loadDataAttributeExtents(DataExtent*);
};
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

View File

@ -86,28 +86,28 @@ class SC_SYSTEM_CORE_API DataExtent : public PublicObject {
public:
//! Copy constructor
DataExtent(const DataExtent& other);
DataExtent(const DataExtent &other);
//! Constructor with publicID
DataExtent(const std::string& publicID);
//! Destructor
~DataExtent() override;
// ------------------------------------------------------------------
// Creators
// ------------------------------------------------------------------
public:
static DataExtent* Create();
static DataExtent* Create(const std::string& publicID);
static DataExtent *Create();
static DataExtent *Create(const std::string& publicID);
// ------------------------------------------------------------------
// Lookup
// ------------------------------------------------------------------
public:
static DataExtent* Find(const std::string& publicID);
static DataExtent *Find(const std::string& publicID);
// ------------------------------------------------------------------
@ -116,14 +116,14 @@ class SC_SYSTEM_CORE_API DataExtent : public PublicObject {
public:
//! Copies the metadata of other to this
//! No changes regarding child objects are made
DataExtent& operator=(const DataExtent& other);
DataExtent &operator=(const DataExtent &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const DataExtent& other) const;
bool operator!=(const DataExtent& other) const;
bool operator==(const DataExtent &other) const;
bool operator!=(const DataExtent &other) const;
//! Wrapper that calls operator==
bool equal(const DataExtent& other) const;
bool equal(const DataExtent &other) const;
// ------------------------------------------------------------------
@ -160,12 +160,12 @@ class SC_SYSTEM_CORE_API DataExtent : public PublicObject {
// ------------------------------------------------------------------
public:
//! Returns the object's index
const DataExtentIndex& index() const;
const DataExtentIndex &index() const;
//! Checks two objects for equality regarding their index
bool equalIndex(const DataExtent* lhs) const;
bool equalIndex(const DataExtent *lhs) const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
@ -178,8 +178,8 @@ class SC_SYSTEM_CORE_API DataExtent : public PublicObject {
* because it already exists in the list
* or it already has another parent
*/
bool add(DataSegment* obj);
bool add(DataAttributeExtent* obj);
bool add(DataSegment *obj);
bool add(DataAttributeExtent *obj);
/**
* Removes an object.
@ -188,8 +188,8 @@ class SC_SYSTEM_CORE_API DataExtent : public PublicObject {
* @return false The object has not been removed
* because it does not exist in the list
*/
bool remove(DataSegment* obj);
bool remove(DataAttributeExtent* obj);
bool remove(DataSegment *obj);
bool remove(DataAttributeExtent *obj);
/**
* Removes an object of a particular class.
@ -198,9 +198,9 @@ class SC_SYSTEM_CORE_API DataExtent : public PublicObject {
* @return false The index is out of bounds
*/
bool removeDataSegment(size_t i);
bool removeDataSegment(const DataSegmentIndex& i);
bool removeDataSegment(const DataSegmentIndex &i);
bool removeDataAttributeExtent(size_t i);
bool removeDataAttributeExtent(const DataAttributeExtentIndex& i);
bool removeDataAttributeExtent(const DataAttributeExtentIndex &i);
//! Retrieve the number of objects of a particular class
size_t dataSegmentCount() const;
@ -208,15 +208,15 @@ class SC_SYSTEM_CORE_API DataExtent : public PublicObject {
//! Index access
//! @return The object at index i
DataSegment* dataSegment(size_t i) const;
DataSegment* dataSegment(const DataSegmentIndex& i) const;
DataSegment *dataSegment(size_t i) const;
DataSegment *dataSegment(const DataSegmentIndex &i) const;
DataAttributeExtent* dataAttributeExtent(size_t i) const;
DataAttributeExtent* dataAttributeExtent(const DataAttributeExtentIndex& i) const;
DataAttributeExtent *dataAttributeExtent(size_t i) const;
DataAttributeExtent *dataAttributeExtent(const DataAttributeExtentIndex &i) const;
//! Find an object by its unique attribute(s)
DataAvailability* dataAvailability() const;
DataAvailability *dataAvailability() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -89,28 +89,28 @@ class SC_SYSTEM_CORE_API Datalogger : public PublicObject {
public:
//! Copy constructor
Datalogger(const Datalogger& other);
Datalogger(const Datalogger &other);
//! Constructor with publicID
Datalogger(const std::string& publicID);
//! Destructor
~Datalogger() override;
// ------------------------------------------------------------------
// Creators
// ------------------------------------------------------------------
public:
static Datalogger* Create();
static Datalogger* Create(const std::string& publicID);
static Datalogger *Create();
static Datalogger *Create(const std::string& publicID);
// ------------------------------------------------------------------
// Lookup
// ------------------------------------------------------------------
public:
static Datalogger* Find(const std::string& publicID);
static Datalogger *Find(const std::string& publicID);
// ------------------------------------------------------------------
@ -119,14 +119,14 @@ class SC_SYSTEM_CORE_API Datalogger : public PublicObject {
public:
//! Copies the metadata of other to this
//! No changes regarding child objects are made
Datalogger& operator=(const Datalogger& other);
Datalogger &operator=(const Datalogger &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const Datalogger& other) const;
bool operator!=(const Datalogger& other) const;
bool operator==(const Datalogger &other) const;
bool operator!=(const Datalogger &other) const;
//! Wrapper that calls operator==
bool equal(const Datalogger& other) const;
bool equal(const Datalogger &other) const;
// ------------------------------------------------------------------
@ -188,12 +188,12 @@ class SC_SYSTEM_CORE_API Datalogger : public PublicObject {
// ------------------------------------------------------------------
public:
//! Returns the object's index
const DataloggerIndex& index() const;
const DataloggerIndex &index() const;
//! Checks two objects for equality regarding their index
bool equalIndex(const Datalogger* lhs) const;
bool equalIndex(const Datalogger *lhs) const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
@ -206,8 +206,8 @@ class SC_SYSTEM_CORE_API Datalogger : public PublicObject {
* because it already exists in the list
* or it already has another parent
*/
bool add(DataloggerCalibration* obj);
bool add(Decimation* obj);
bool add(DataloggerCalibration *obj);
bool add(Decimation *obj);
/**
* Removes an object.
@ -216,8 +216,8 @@ class SC_SYSTEM_CORE_API Datalogger : public PublicObject {
* @return false The object has not been removed
* because it does not exist in the list
*/
bool remove(DataloggerCalibration* obj);
bool remove(Decimation* obj);
bool remove(DataloggerCalibration *obj);
bool remove(Decimation *obj);
/**
* Removes an object of a particular class.
@ -226,9 +226,9 @@ class SC_SYSTEM_CORE_API Datalogger : public PublicObject {
* @return false The index is out of bounds
*/
bool removeDataloggerCalibration(size_t i);
bool removeDataloggerCalibration(const DataloggerCalibrationIndex& i);
bool removeDataloggerCalibration(const DataloggerCalibrationIndex &i);
bool removeDecimation(size_t i);
bool removeDecimation(const DecimationIndex& i);
bool removeDecimation(const DecimationIndex &i);
//! Retrieve the number of objects of a particular class
size_t dataloggerCalibrationCount() const;
@ -236,15 +236,15 @@ class SC_SYSTEM_CORE_API Datalogger : public PublicObject {
//! Index access
//! @return The object at index i
DataloggerCalibration* dataloggerCalibration(size_t i) const;
DataloggerCalibration* dataloggerCalibration(const DataloggerCalibrationIndex& i) const;
DataloggerCalibration *dataloggerCalibration(size_t i) const;
DataloggerCalibration *dataloggerCalibration(const DataloggerCalibrationIndex &i) const;
Decimation* decimation(size_t i) const;
Decimation* decimation(const DecimationIndex& i) const;
Decimation *decimation(size_t i) const;
Decimation *decimation(const DecimationIndex &i) const;
//! Find an object by its unique attribute(s)
Inventory* inventory() const;
Inventory *inventory() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -87,25 +87,25 @@ class SC_SYSTEM_CORE_API DataloggerCalibration : public Object {
DataloggerCalibration();
//! Copy constructor
DataloggerCalibration(const DataloggerCalibration& other);
DataloggerCalibration(const DataloggerCalibration &other);
//! Destructor
~DataloggerCalibration() override;
// ------------------------------------------------------------------
// Operators
// ------------------------------------------------------------------
public:
//! Copies the metadata of other to this
DataloggerCalibration& operator=(const DataloggerCalibration& other);
DataloggerCalibration &operator=(const DataloggerCalibration &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const DataloggerCalibration& other) const;
bool operator!=(const DataloggerCalibration& other) const;
bool operator==(const DataloggerCalibration &other) const;
bool operator!=(const DataloggerCalibration &other) const;
//! Wrapper that calls operator==
bool equal(const DataloggerCalibration& other) const;
bool equal(const DataloggerCalibration &other) const;
// ------------------------------------------------------------------
@ -147,17 +147,17 @@ class SC_SYSTEM_CORE_API DataloggerCalibration : public Object {
// ------------------------------------------------------------------
public:
//! Returns the object's index
const DataloggerCalibrationIndex& index() const;
const DataloggerCalibrationIndex &index() const;
//! Checks two objects for equality regarding their index
bool equalIndex(const DataloggerCalibration* lhs) const;
bool equalIndex(const DataloggerCalibration *lhs) const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
public:
Datalogger* datalogger() const;
Datalogger *datalogger() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -79,25 +79,25 @@ class SC_SYSTEM_CORE_API DataSegment : public Object {
DataSegment();
//! Copy constructor
DataSegment(const DataSegment& other);
DataSegment(const DataSegment &other);
//! Destructor
~DataSegment() override;
// ------------------------------------------------------------------
// Operators
// ------------------------------------------------------------------
public:
//! Copies the metadata of other to this
DataSegment& operator=(const DataSegment& other);
DataSegment &operator=(const DataSegment &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const DataSegment& other) const;
bool operator!=(const DataSegment& other) const;
bool operator==(const DataSegment &other) const;
bool operator!=(const DataSegment &other) const;
//! Wrapper that calls operator==
bool equal(const DataSegment& other) const;
bool equal(const DataSegment &other) const;
// ------------------------------------------------------------------
@ -135,17 +135,17 @@ class SC_SYSTEM_CORE_API DataSegment : public Object {
// ------------------------------------------------------------------
public:
//! Returns the object's index
const DataSegmentIndex& index() const;
const DataSegmentIndex &index() const;
//! Checks two objects for equality regarding their index
bool equalIndex(const DataSegment* lhs) const;
bool equalIndex(const DataSegment *lhs) const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
public:
DataExtent* dataExtent() const;
DataExtent *dataExtent() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -54,25 +54,25 @@ class SC_SYSTEM_CORE_API DataUsed : public Object {
DataUsed();
//! Copy constructor
DataUsed(const DataUsed& other);
DataUsed(const DataUsed &other);
//! Destructor
~DataUsed() override;
// ------------------------------------------------------------------
// Operators
// ------------------------------------------------------------------
public:
//! Copies the metadata of other to this
DataUsed& operator=(const DataUsed& other);
DataUsed &operator=(const DataUsed &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const DataUsed& other) const;
bool operator!=(const DataUsed& other) const;
bool operator==(const DataUsed &other) const;
bool operator!=(const DataUsed &other) const;
//! Wrapper that calls operator==
bool equal(const DataUsed& other) const;
bool equal(const DataUsed &other) const;
// ------------------------------------------------------------------
@ -96,12 +96,12 @@ class SC_SYSTEM_CORE_API DataUsed : public Object {
void setShortestPeriod(const OPT(double)& shortestPeriod);
double shortestPeriod() const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
public:
MomentTensor* momentTensor() const;
MomentTensor *momentTensor() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -83,25 +83,25 @@ class SC_SYSTEM_CORE_API Decimation : public Object {
Decimation();
//! Copy constructor
Decimation(const Decimation& other);
Decimation(const Decimation &other);
//! Destructor
~Decimation() override;
// ------------------------------------------------------------------
// Operators
// ------------------------------------------------------------------
public:
//! Copies the metadata of other to this
Decimation& operator=(const Decimation& other);
Decimation &operator=(const Decimation &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const Decimation& other) const;
bool operator!=(const Decimation& other) const;
bool operator==(const Decimation &other) const;
bool operator!=(const Decimation &other) const;
//! Wrapper that calls operator==
bool equal(const Decimation& other) const;
bool equal(const Decimation &other) const;
// ------------------------------------------------------------------
@ -138,17 +138,17 @@ class SC_SYSTEM_CORE_API Decimation : public Object {
// ------------------------------------------------------------------
public:
//! Returns the object's index
const DecimationIndex& index() const;
const DecimationIndex &index() const;
//! Checks two objects for equality regarding their index
bool equalIndex(const Decimation* lhs) const;
bool equalIndex(const Decimation *lhs) const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
public:
Datalogger* datalogger() const;
Datalogger *datalogger() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -45,6 +45,7 @@ DEFINE_SMARTPOINTER(Comment);
DEFINE_SMARTPOINTER(OriginReference);
DEFINE_SMARTPOINTER(FocalMechanismReference);
class Catalog;
class EventParameters;
@ -79,28 +80,28 @@ class SC_SYSTEM_CORE_API Event : public PublicObject {
public:
//! Copy constructor
Event(const Event& other);
Event(const Event &other);
//! Constructor with publicID
Event(const std::string& publicID);
//! Destructor
~Event() override;
// ------------------------------------------------------------------
// Creators
// ------------------------------------------------------------------
public:
static Event* Create();
static Event* Create(const std::string& publicID);
static Event *Create();
static Event *Create(const std::string& publicID);
// ------------------------------------------------------------------
// Lookup
// ------------------------------------------------------------------
public:
static Event* Find(const std::string& publicID);
static Event *Find(const std::string& publicID);
// ------------------------------------------------------------------
@ -109,14 +110,14 @@ class SC_SYSTEM_CORE_API Event : public PublicObject {
public:
//! Copies the metadata of other to this
//! No changes regarding child objects are made
Event& operator=(const Event& other);
Event &operator=(const Event &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const Event& other) const;
bool operator!=(const Event& other) const;
bool operator==(const Event &other) const;
bool operator!=(const Event &other) const;
//! Wrapper that calls operator==
bool equal(const Event& other) const;
bool equal(const Event &other) const;
// ------------------------------------------------------------------
@ -150,7 +151,7 @@ class SC_SYSTEM_CORE_API Event : public PublicObject {
CreationInfo& creationInfo();
const CreationInfo& creationInfo() const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
@ -163,10 +164,10 @@ class SC_SYSTEM_CORE_API Event : public PublicObject {
* because it already exists in the list
* or it already has another parent
*/
bool add(EventDescription* obj);
bool add(Comment* obj);
bool add(OriginReference* obj);
bool add(FocalMechanismReference* obj);
bool add(EventDescription *obj);
bool add(Comment *obj);
bool add(OriginReference *obj);
bool add(FocalMechanismReference *obj);
/**
* Removes an object.
@ -175,10 +176,10 @@ class SC_SYSTEM_CORE_API Event : public PublicObject {
* @return false The object has not been removed
* because it does not exist in the list
*/
bool remove(EventDescription* obj);
bool remove(Comment* obj);
bool remove(OriginReference* obj);
bool remove(FocalMechanismReference* obj);
bool remove(EventDescription *obj);
bool remove(Comment *obj);
bool remove(OriginReference *obj);
bool remove(FocalMechanismReference *obj);
/**
* Removes an object of a particular class.
@ -187,13 +188,13 @@ class SC_SYSTEM_CORE_API Event : public PublicObject {
* @return false The index is out of bounds
*/
bool removeEventDescription(size_t i);
bool removeEventDescription(const EventDescriptionIndex& i);
bool removeEventDescription(const EventDescriptionIndex &i);
bool removeComment(size_t i);
bool removeComment(const CommentIndex& i);
bool removeComment(const CommentIndex &i);
bool removeOriginReference(size_t i);
bool removeOriginReference(const OriginReferenceIndex& i);
bool removeOriginReference(const OriginReferenceIndex &i);
bool removeFocalMechanismReference(size_t i);
bool removeFocalMechanismReference(const FocalMechanismReferenceIndex& i);
bool removeFocalMechanismReference(const FocalMechanismReferenceIndex &i);
//! Retrieve the number of objects of a particular class
size_t eventDescriptionCount() const;
@ -203,21 +204,27 @@ class SC_SYSTEM_CORE_API Event : public PublicObject {
//! Index access
//! @return The object at index i
EventDescription* eventDescription(size_t i) const;
EventDescription* eventDescription(const EventDescriptionIndex& i) const;
EventDescription *eventDescription(size_t i) const;
EventDescription *eventDescription(const EventDescriptionIndex &i) const;
Comment* comment(size_t i) const;
Comment* comment(const CommentIndex& i) const;
Comment *comment(size_t i) const;
Comment *comment(const CommentIndex &i) const;
OriginReference* originReference(size_t i) const;
OriginReference* originReference(const OriginReferenceIndex& i) const;
OriginReference *originReference(size_t i) const;
OriginReference *originReference(const OriginReferenceIndex &i) const;
FocalMechanismReference* focalMechanismReference(size_t i) const;
FocalMechanismReference* focalMechanismReference(const FocalMechanismReferenceIndex& i) const;
FocalMechanismReference *focalMechanismReference(size_t i) const;
FocalMechanismReference *focalMechanismReference(const FocalMechanismReferenceIndex &i) const;
//! Find an object by its unique attribute(s)
EventParameters* eventParameters() const;
/**
* The following methods return the parent object by type.
* Because different parent types are possible, just one
* of these methods will return a valid pointer at a time.
*/
Catalog *catalog() const;
EventParameters *eventParameters() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -86,7 +86,7 @@ class SC_SYSTEM_CORE_API EventDescription : public Object {
EventDescription();
//! Copy constructor
EventDescription(const EventDescription& other);
EventDescription(const EventDescription &other);
//! Custom constructor
EventDescription(const std::string& text);
@ -95,21 +95,21 @@ class SC_SYSTEM_CORE_API EventDescription : public Object {
//! Destructor
~EventDescription() override;
// ------------------------------------------------------------------
// Operators
// ------------------------------------------------------------------
public:
//! Copies the metadata of other to this
EventDescription& operator=(const EventDescription& other);
EventDescription &operator=(const EventDescription &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const EventDescription& other) const;
bool operator!=(const EventDescription& other) const;
bool operator==(const EventDescription &other) const;
bool operator!=(const EventDescription &other) const;
//! Wrapper that calls operator==
bool equal(const EventDescription& other) const;
bool equal(const EventDescription &other) const;
// ------------------------------------------------------------------
@ -130,17 +130,17 @@ class SC_SYSTEM_CORE_API EventDescription : public Object {
// ------------------------------------------------------------------
public:
//! Returns the object's index
const EventDescriptionIndex& index() const;
const EventDescriptionIndex &index() const;
//! Checks two objects for equality regarding their index
bool equalIndex(const EventDescription* lhs) const;
bool equalIndex(const EventDescription *lhs) const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
public:
Event* event() const;
Event *event() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -38,6 +38,7 @@ DEFINE_SMARTPOINTER(Amplitude);
DEFINE_SMARTPOINTER(Reading);
DEFINE_SMARTPOINTER(Origin);
DEFINE_SMARTPOINTER(FocalMechanism);
DEFINE_SMARTPOINTER(Catalog);
DEFINE_SMARTPOINTER(Event);
@ -59,11 +60,11 @@ class SC_SYSTEM_CORE_API EventParameters : public PublicObject {
EventParameters();
//! Copy constructor
EventParameters(const EventParameters& other);
EventParameters(const EventParameters &other);
//! Destructor
~EventParameters() override;
// ------------------------------------------------------------------
// Operators
@ -71,16 +72,16 @@ class SC_SYSTEM_CORE_API EventParameters : public PublicObject {
public:
//! Copies the metadata of other to this
//! No changes regarding child objects are made
EventParameters& operator=(const EventParameters& other);
EventParameters &operator=(const EventParameters &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const EventParameters& other) const;
bool operator!=(const EventParameters& other) const;
bool operator==(const EventParameters &other) const;
bool operator!=(const EventParameters &other) const;
//! Wrapper that calls operator==
bool equal(const EventParameters& other) const;
bool equal(const EventParameters &other) const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
@ -93,12 +94,13 @@ class SC_SYSTEM_CORE_API EventParameters : public PublicObject {
* because it already exists in the list
* or it already has another parent
*/
bool add(Pick* obj);
bool add(Amplitude* obj);
bool add(Reading* obj);
bool add(Origin* obj);
bool add(FocalMechanism* obj);
bool add(Event* obj);
bool add(Pick *obj);
bool add(Amplitude *obj);
bool add(Reading *obj);
bool add(Origin *obj);
bool add(FocalMechanism *obj);
bool add(Catalog *obj);
bool add(Event *obj);
/**
* Removes an object.
@ -107,12 +109,13 @@ class SC_SYSTEM_CORE_API EventParameters : public PublicObject {
* @return false The object has not been removed
* because it does not exist in the list
*/
bool remove(Pick* obj);
bool remove(Amplitude* obj);
bool remove(Reading* obj);
bool remove(Origin* obj);
bool remove(FocalMechanism* obj);
bool remove(Event* obj);
bool remove(Pick *obj);
bool remove(Amplitude *obj);
bool remove(Reading *obj);
bool remove(Origin *obj);
bool remove(FocalMechanism *obj);
bool remove(Catalog *obj);
bool remove(Event *obj);
/**
* Removes an object of a particular class.
@ -125,6 +128,7 @@ class SC_SYSTEM_CORE_API EventParameters : public PublicObject {
bool removeReading(size_t i);
bool removeOrigin(size_t i);
bool removeFocalMechanism(size_t i);
bool removeCatalog(size_t i);
bool removeEvent(size_t i);
//! Retrieve the number of objects of a particular class
@ -133,24 +137,27 @@ class SC_SYSTEM_CORE_API EventParameters : public PublicObject {
size_t readingCount() const;
size_t originCount() const;
size_t focalMechanismCount() const;
size_t catalogCount() const;
size_t eventCount() const;
//! Index access
//! @return The object at index i
Pick* pick(size_t i) const;
Amplitude* amplitude(size_t i) const;
Reading* reading(size_t i) const;
Origin* origin(size_t i) const;
FocalMechanism* focalMechanism(size_t i) const;
Event* event(size_t i) const;
Pick *pick(size_t i) const;
Amplitude *amplitude(size_t i) const;
Reading *reading(size_t i) const;
Origin *origin(size_t i) const;
FocalMechanism *focalMechanism(size_t i) const;
Catalog *catalog(size_t i) const;
Event *event(size_t i) const;
//! Find an object by its unique attribute(s)
Pick* findPick(const std::string& publicID) const;
Amplitude* findAmplitude(const std::string& publicID) const;
Reading* findReading(const std::string& publicID) const;
Origin* findOrigin(const std::string& publicID) const;
FocalMechanism* findFocalMechanism(const std::string& publicID) const;
Event* findEvent(const std::string& publicID) const;
Pick *findPick(const std::string& publicID) const;
Amplitude *findAmplitude(const std::string& publicID) const;
Reading *findReading(const std::string& publicID) const;
Origin *findOrigin(const std::string& publicID) const;
FocalMechanism *findFocalMechanism(const std::string& publicID) const;
Catalog *findCatalog(const std::string& publicID) const;
Event *findEvent(const std::string& publicID) const;
//! Implement Object interface
bool assign(Object *other) override;
@ -177,6 +184,7 @@ class SC_SYSTEM_CORE_API EventParameters : public PublicObject {
std::vector<ReadingPtr> _readings;
std::vector<OriginPtr> _origins;
std::vector<FocalMechanismPtr> _focalMechanisms;
std::vector<CatalogPtr> _catalogs;
std::vector<EventPtr> _events;
DECLARE_SC_CLASSFACTORY_FRIEND(EventParameters);

View File

@ -23,6 +23,7 @@
#include <seiscomp/datamodel/eventdescription.h>
#include <seiscomp/datamodel/comment.h>
#include <seiscomp/datamodel/dataused.h>
#include <seiscomp/datamodel/compositetime.h>
#include <seiscomp/datamodel/pickreference.h>
@ -41,6 +42,7 @@
#include <seiscomp/datamodel/originreference.h>
#include <seiscomp/datamodel/focalmechanismreference.h>
#include <seiscomp/datamodel/event.h>
#include <seiscomp/datamodel/catalog.h>
#include <seiscomp/datamodel/arrival.h>
#include <seiscomp/datamodel/origin.h>
#include <seiscomp/datamodel/eventparameters.h>

View File

@ -77,8 +77,8 @@ class ExporterBinary : public IO::XML::Exporter {
// Exporter interface
// ------------------------------------------------------------------
protected:
bool put(std::streambuf* buf, Core::BaseObject *);
bool put(std::streambuf* buf, const IO::ExportObjectList &objects);
bool put(std::streambuf* buf, Core::BaseObject *) override;
bool put(std::streambuf* buf, const IO::ExportObjectList &objects) override;
};
@ -95,8 +95,8 @@ class ExporterVBinary : public IO::XML::Exporter {
// Exporter interface
// ------------------------------------------------------------------
protected:
bool put(std::streambuf* buf, Core::BaseObject *);
bool put(std::streambuf* buf, const IO::ExportObjectList &objects);
bool put(std::streambuf* buf, Core::BaseObject *) override;
bool put(std::streambuf* buf, const IO::ExportObjectList &objects) override;
};

View File

@ -43,7 +43,7 @@ class ImporterBSON : public IO::Importer {
// Importer interface
// ------------------------------------------------------------------
protected:
Core::BaseObject *get(std::streambuf* buf);
Core::BaseObject *get(std::streambuf* buf) override;
};
@ -60,7 +60,7 @@ class ExporterBSON : public IO::Exporter {
// Exporter interface
// ------------------------------------------------------------------
protected:
bool put(std::streambuf* buf, Core::BaseObject *);
bool put(std::streambuf* buf, Core::BaseObject *) override;
};
@ -77,7 +77,7 @@ class ExporterBSONJSON : public IO::Exporter {
// Exporter interface
// ------------------------------------------------------------------
protected:
bool put(std::streambuf* buf, Core::BaseObject *);
bool put(std::streambuf* buf, Core::BaseObject *) override;
};

View File

@ -45,7 +45,7 @@ class ExporterCSV : public IO::Exporter {
// Exporter interface
// ------------------------------------------------------------------
protected:
bool put(std::streambuf* buf, Core::BaseObject *);
bool put(std::streambuf* buf, Core::BaseObject *) override;
private:
std::string _delim;

View File

@ -42,7 +42,7 @@ class ExporterHYP71SUM2K : public IO::Exporter {
// Exporter interface
// ------------------------------------------------------------------
protected:
bool put(std::streambuf* buf, Core::BaseObject *);
bool put(std::streambuf* buf, Core::BaseObject *) override;
};

View File

@ -46,7 +46,7 @@ class ExporterIMS10 : public IO::Exporter {
// Exporter interface
// ------------------------------------------------------------------
protected:
bool put(std::streambuf* buf, Core::BaseObject *);
bool put(std::streambuf* buf, Core::BaseObject *) override;
private:
// ------------------------------------------------------------------
// Members

View File

@ -43,7 +43,7 @@ class ImporterJSON : public IO::Importer {
// Importer interface
// ------------------------------------------------------------------
protected:
Core::BaseObject *get(std::streambuf* buf);
Core::BaseObject *get(std::streambuf* buf) override;
};
@ -60,7 +60,7 @@ class ExporterJSON : public IO::Exporter {
// Exporter interface
// ------------------------------------------------------------------
protected:
bool put(std::streambuf* buf, Core::BaseObject *);
bool put(std::streambuf* buf, Core::BaseObject *) override;
};

View File

@ -43,7 +43,7 @@ class ImporterTrunk : public IO::Importer {
// Importer interface
// ------------------------------------------------------------------
protected:
Core::BaseObject *get(std::streambuf* buf);
Core::BaseObject *get(std::streambuf* buf) override;
};
@ -60,8 +60,8 @@ class ExporterTrunk : public IO::Exporter {
// Exporter interface
// ------------------------------------------------------------------
protected:
bool put(std::streambuf* buf, Core::BaseObject *);
bool put(std::streambuf* buf, const IO::ExportObjectList &objects);
bool put(std::streambuf* buf, Core::BaseObject *) override;
bool put(std::streambuf* buf, const IO::ExportObjectList &objects) override;
};

View File

@ -69,28 +69,28 @@ class SC_SYSTEM_CORE_API FocalMechanism : public PublicObject {
public:
//! Copy constructor
FocalMechanism(const FocalMechanism& other);
FocalMechanism(const FocalMechanism &other);
//! Constructor with publicID
FocalMechanism(const std::string& publicID);
//! Destructor
~FocalMechanism() override;
// ------------------------------------------------------------------
// Creators
// ------------------------------------------------------------------
public:
static FocalMechanism* Create();
static FocalMechanism* Create(const std::string& publicID);
static FocalMechanism *Create();
static FocalMechanism *Create(const std::string& publicID);
// ------------------------------------------------------------------
// Lookup
// ------------------------------------------------------------------
public:
static FocalMechanism* Find(const std::string& publicID);
static FocalMechanism *Find(const std::string& publicID);
// ------------------------------------------------------------------
@ -99,14 +99,14 @@ class SC_SYSTEM_CORE_API FocalMechanism : public PublicObject {
public:
//! Copies the metadata of other to this
//! No changes regarding child objects are made
FocalMechanism& operator=(const FocalMechanism& other);
FocalMechanism &operator=(const FocalMechanism &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const FocalMechanism& other) const;
bool operator!=(const FocalMechanism& other) const;
bool operator==(const FocalMechanism &other) const;
bool operator!=(const FocalMechanism &other) const;
//! Wrapper that calls operator==
bool equal(const FocalMechanism& other) const;
bool equal(const FocalMechanism &other) const;
// ------------------------------------------------------------------
@ -169,7 +169,7 @@ class SC_SYSTEM_CORE_API FocalMechanism : public PublicObject {
CreationInfo& creationInfo();
const CreationInfo& creationInfo() const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
@ -182,8 +182,8 @@ class SC_SYSTEM_CORE_API FocalMechanism : public PublicObject {
* because it already exists in the list
* or it already has another parent
*/
bool add(Comment* obj);
bool add(MomentTensor* obj);
bool add(Comment *obj);
bool add(MomentTensor *obj);
/**
* Removes an object.
@ -192,8 +192,8 @@ class SC_SYSTEM_CORE_API FocalMechanism : public PublicObject {
* @return false The object has not been removed
* because it does not exist in the list
*/
bool remove(Comment* obj);
bool remove(MomentTensor* obj);
bool remove(Comment *obj);
bool remove(MomentTensor *obj);
/**
* Removes an object of a particular class.
@ -202,7 +202,7 @@ class SC_SYSTEM_CORE_API FocalMechanism : public PublicObject {
* @return false The index is out of bounds
*/
bool removeComment(size_t i);
bool removeComment(const CommentIndex& i);
bool removeComment(const CommentIndex &i);
bool removeMomentTensor(size_t i);
//! Retrieve the number of objects of a particular class
@ -211,14 +211,14 @@ class SC_SYSTEM_CORE_API FocalMechanism : public PublicObject {
//! Index access
//! @return The object at index i
Comment* comment(size_t i) const;
Comment* comment(const CommentIndex& i) const;
MomentTensor* momentTensor(size_t i) const;
Comment *comment(size_t i) const;
Comment *comment(const CommentIndex &i) const;
MomentTensor *momentTensor(size_t i) const;
//! Find an object by its unique attribute(s)
MomentTensor* findMomentTensor(const std::string& publicID) const;
MomentTensor *findMomentTensor(const std::string& publicID) const;
EventParameters* eventParameters() const;
EventParameters *eventParameters() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -78,28 +78,28 @@ class SC_SYSTEM_CORE_API FocalMechanismReference : public Object {
FocalMechanismReference();
//! Copy constructor
FocalMechanismReference(const FocalMechanismReference& other);
FocalMechanismReference(const FocalMechanismReference &other);
//! Custom constructor
FocalMechanismReference(const std::string& focalMechanismID);
//! Destructor
~FocalMechanismReference() override;
// ------------------------------------------------------------------
// Operators
// ------------------------------------------------------------------
public:
//! Copies the metadata of other to this
FocalMechanismReference& operator=(const FocalMechanismReference& other);
FocalMechanismReference &operator=(const FocalMechanismReference &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const FocalMechanismReference& other) const;
bool operator!=(const FocalMechanismReference& other) const;
bool operator==(const FocalMechanismReference &other) const;
bool operator!=(const FocalMechanismReference &other) const;
//! Wrapper that calls operator==
bool equal(const FocalMechanismReference& other) const;
bool equal(const FocalMechanismReference &other) const;
// ------------------------------------------------------------------
@ -115,17 +115,17 @@ class SC_SYSTEM_CORE_API FocalMechanismReference : public Object {
// ------------------------------------------------------------------
public:
//! Returns the object's index
const FocalMechanismReferenceIndex& index() const;
const FocalMechanismReferenceIndex &index() const;
//! Checks two objects for equality regarding their index
bool equalIndex(const FocalMechanismReference* lhs) const;
bool equalIndex(const FocalMechanismReference *lhs) const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
public:
Event* event() const;
Event *event() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -66,7 +66,7 @@ class SC_SYSTEM_CORE_API IntegerQuantity : public Core::BaseObject {
IntegerQuantity();
//! Copy constructor
IntegerQuantity(const IntegerQuantity& other);
IntegerQuantity(const IntegerQuantity &other);
//! Custom constructor
IntegerQuantity(int value,
@ -77,7 +77,7 @@ class SC_SYSTEM_CORE_API IntegerQuantity : public Core::BaseObject {
//! Destructor
~IntegerQuantity() override;
// ------------------------------------------------------------------
// Operators
@ -87,14 +87,14 @@ class SC_SYSTEM_CORE_API IntegerQuantity : public Core::BaseObject {
operator int() const;
//! Copies the metadata of other to this
IntegerQuantity& operator=(const IntegerQuantity& other);
IntegerQuantity &operator=(const IntegerQuantity &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const IntegerQuantity& other) const;
bool operator!=(const IntegerQuantity& other) const;
bool operator==(const IntegerQuantity &other) const;
bool operator!=(const IntegerQuantity &other) const;
//! Wrapper that calls operator==
bool equal(const IntegerQuantity& other) const;
bool equal(const IntegerQuantity &other) const;
// ------------------------------------------------------------------

View File

@ -68,11 +68,11 @@ class SC_SYSTEM_CORE_API Inventory : public PublicObject {
Inventory();
//! Copy constructor
Inventory(const Inventory& other);
Inventory(const Inventory &other);
//! Destructor
~Inventory() override;
// ------------------------------------------------------------------
// Operators
@ -80,16 +80,16 @@ class SC_SYSTEM_CORE_API Inventory : public PublicObject {
public:
//! Copies the metadata of other to this
//! No changes regarding child objects are made
Inventory& operator=(const Inventory& other);
Inventory &operator=(const Inventory &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const Inventory& other) const;
bool operator!=(const Inventory& other) const;
bool operator==(const Inventory &other) const;
bool operator!=(const Inventory &other) const;
//! Wrapper that calls operator==
bool equal(const Inventory& other) const;
bool equal(const Inventory &other) const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
@ -102,16 +102,16 @@ class SC_SYSTEM_CORE_API Inventory : public PublicObject {
* because it already exists in the list
* or it already has another parent
*/
bool add(StationGroup* obj);
bool add(AuxDevice* obj);
bool add(Sensor* obj);
bool add(Datalogger* obj);
bool add(ResponsePAZ* obj);
bool add(ResponseFIR* obj);
bool add(ResponseIIR* obj);
bool add(ResponsePolynomial* obj);
bool add(ResponseFAP* obj);
bool add(Network* obj);
bool add(StationGroup *obj);
bool add(AuxDevice *obj);
bool add(Sensor *obj);
bool add(Datalogger *obj);
bool add(ResponsePAZ *obj);
bool add(ResponseFIR *obj);
bool add(ResponseIIR *obj);
bool add(ResponsePolynomial *obj);
bool add(ResponseFAP *obj);
bool add(Network *obj);
/**
* Removes an object.
@ -120,16 +120,16 @@ class SC_SYSTEM_CORE_API Inventory : public PublicObject {
* @return false The object has not been removed
* because it does not exist in the list
*/
bool remove(StationGroup* obj);
bool remove(AuxDevice* obj);
bool remove(Sensor* obj);
bool remove(Datalogger* obj);
bool remove(ResponsePAZ* obj);
bool remove(ResponseFIR* obj);
bool remove(ResponseIIR* obj);
bool remove(ResponsePolynomial* obj);
bool remove(ResponseFAP* obj);
bool remove(Network* obj);
bool remove(StationGroup *obj);
bool remove(AuxDevice *obj);
bool remove(Sensor *obj);
bool remove(Datalogger *obj);
bool remove(ResponsePAZ *obj);
bool remove(ResponseFIR *obj);
bool remove(ResponseIIR *obj);
bool remove(ResponsePolynomial *obj);
bool remove(ResponseFAP *obj);
bool remove(Network *obj);
/**
* Removes an object of a particular class.
@ -138,25 +138,25 @@ class SC_SYSTEM_CORE_API Inventory : public PublicObject {
* @return false The index is out of bounds
*/
bool removeStationGroup(size_t i);
bool removeStationGroup(const StationGroupIndex& i);
bool removeStationGroup(const StationGroupIndex &i);
bool removeAuxDevice(size_t i);
bool removeAuxDevice(const AuxDeviceIndex& i);
bool removeAuxDevice(const AuxDeviceIndex &i);
bool removeSensor(size_t i);
bool removeSensor(const SensorIndex& i);
bool removeSensor(const SensorIndex &i);
bool removeDatalogger(size_t i);
bool removeDatalogger(const DataloggerIndex& i);
bool removeDatalogger(const DataloggerIndex &i);
bool removeResponsePAZ(size_t i);
bool removeResponsePAZ(const ResponsePAZIndex& i);
bool removeResponsePAZ(const ResponsePAZIndex &i);
bool removeResponseFIR(size_t i);
bool removeResponseFIR(const ResponseFIRIndex& i);
bool removeResponseFIR(const ResponseFIRIndex &i);
bool removeResponseIIR(size_t i);
bool removeResponseIIR(const ResponseIIRIndex& i);
bool removeResponseIIR(const ResponseIIRIndex &i);
bool removeResponsePolynomial(size_t i);
bool removeResponsePolynomial(const ResponsePolynomialIndex& i);
bool removeResponsePolynomial(const ResponsePolynomialIndex &i);
bool removeResponseFAP(size_t i);
bool removeResponseFAP(const ResponseFAPIndex& i);
bool removeResponseFAP(const ResponseFAPIndex &i);
bool removeNetwork(size_t i);
bool removeNetwork(const NetworkIndex& i);
bool removeNetwork(const NetworkIndex &i);
//! Retrieve the number of objects of a particular class
size_t stationGroupCount() const;
@ -172,47 +172,47 @@ class SC_SYSTEM_CORE_API Inventory : public PublicObject {
//! Index access
//! @return The object at index i
StationGroup* stationGroup(size_t i) const;
StationGroup* stationGroup(const StationGroupIndex& i) const;
StationGroup *stationGroup(size_t i) const;
StationGroup *stationGroup(const StationGroupIndex &i) const;
AuxDevice* auxDevice(size_t i) const;
AuxDevice* auxDevice(const AuxDeviceIndex& i) const;
AuxDevice *auxDevice(size_t i) const;
AuxDevice *auxDevice(const AuxDeviceIndex &i) const;
Sensor* sensor(size_t i) const;
Sensor* sensor(const SensorIndex& i) const;
Sensor *sensor(size_t i) const;
Sensor *sensor(const SensorIndex &i) const;
Datalogger* datalogger(size_t i) const;
Datalogger* datalogger(const DataloggerIndex& i) const;
Datalogger *datalogger(size_t i) const;
Datalogger *datalogger(const DataloggerIndex &i) const;
ResponsePAZ* responsePAZ(size_t i) const;
ResponsePAZ* responsePAZ(const ResponsePAZIndex& i) const;
ResponsePAZ *responsePAZ(size_t i) const;
ResponsePAZ *responsePAZ(const ResponsePAZIndex &i) const;
ResponseFIR* responseFIR(size_t i) const;
ResponseFIR* responseFIR(const ResponseFIRIndex& i) const;
ResponseFIR *responseFIR(size_t i) const;
ResponseFIR *responseFIR(const ResponseFIRIndex &i) const;
ResponseIIR* responseIIR(size_t i) const;
ResponseIIR* responseIIR(const ResponseIIRIndex& i) const;
ResponseIIR *responseIIR(size_t i) const;
ResponseIIR *responseIIR(const ResponseIIRIndex &i) const;
ResponsePolynomial* responsePolynomial(size_t i) const;
ResponsePolynomial* responsePolynomial(const ResponsePolynomialIndex& i) const;
ResponsePolynomial *responsePolynomial(size_t i) const;
ResponsePolynomial *responsePolynomial(const ResponsePolynomialIndex &i) const;
ResponseFAP* responseFAP(size_t i) const;
ResponseFAP* responseFAP(const ResponseFAPIndex& i) const;
ResponseFAP *responseFAP(size_t i) const;
ResponseFAP *responseFAP(const ResponseFAPIndex &i) const;
Network* network(size_t i) const;
Network* network(const NetworkIndex& i) const;
Network *network(size_t i) const;
Network *network(const NetworkIndex &i) const;
//! Find an object by its unique attribute(s)
StationGroup* findStationGroup(const std::string& publicID) const;
AuxDevice* findAuxDevice(const std::string& publicID) const;
Sensor* findSensor(const std::string& publicID) const;
Datalogger* findDatalogger(const std::string& publicID) const;
ResponsePAZ* findResponsePAZ(const std::string& publicID) const;
ResponseFIR* findResponseFIR(const std::string& publicID) const;
ResponseIIR* findResponseIIR(const std::string& publicID) const;
ResponsePolynomial* findResponsePolynomial(const std::string& publicID) const;
ResponseFAP* findResponseFAP(const std::string& publicID) const;
Network* findNetwork(const std::string& publicID) const;
StationGroup *findStationGroup(const std::string& publicID) const;
AuxDevice *findAuxDevice(const std::string& publicID) const;
Sensor *findSensor(const std::string& publicID) const;
Datalogger *findDatalogger(const std::string& publicID) const;
ResponsePAZ *findResponsePAZ(const std::string& publicID) const;
ResponseFIR *findResponseFIR(const std::string& publicID) const;
ResponseIIR *findResponseIIR(const std::string& publicID) const;
ResponsePolynomial *findResponsePolynomial(const std::string& publicID) const;
ResponseFAP *findResponseFAP(const std::string& publicID) const;
Network *findNetwork(const std::string& publicID) const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -50,25 +50,25 @@ class SC_SYSTEM_CORE_API JournalEntry : public Object {
JournalEntry();
//! Copy constructor
JournalEntry(const JournalEntry& other);
JournalEntry(const JournalEntry &other);
//! Destructor
~JournalEntry() override;
// ------------------------------------------------------------------
// Operators
// ------------------------------------------------------------------
public:
//! Copies the metadata of other to this
JournalEntry& operator=(const JournalEntry& other);
JournalEntry &operator=(const JournalEntry &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const JournalEntry& other) const;
bool operator!=(const JournalEntry& other) const;
bool operator==(const JournalEntry &other) const;
bool operator!=(const JournalEntry &other) const;
//! Wrapper that calls operator==
bool equal(const JournalEntry& other) const;
bool equal(const JournalEntry &other) const;
// ------------------------------------------------------------------
@ -90,12 +90,12 @@ class SC_SYSTEM_CORE_API JournalEntry : public Object {
void setParameters(const std::string& parameters);
const std::string& parameters() const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
public:
Journaling* journaling() const;
Journaling *journaling() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -49,11 +49,11 @@ class SC_SYSTEM_CORE_API Journaling : public PublicObject {
Journaling();
//! Copy constructor
Journaling(const Journaling& other);
Journaling(const Journaling &other);
//! Destructor
~Journaling() override;
// ------------------------------------------------------------------
// Operators
@ -61,16 +61,16 @@ class SC_SYSTEM_CORE_API Journaling : public PublicObject {
public:
//! Copies the metadata of other to this
//! No changes regarding child objects are made
Journaling& operator=(const Journaling& other);
Journaling &operator=(const Journaling &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const Journaling& other) const;
bool operator!=(const Journaling& other) const;
bool operator==(const Journaling &other) const;
bool operator!=(const Journaling &other) const;
//! Wrapper that calls operator==
bool equal(const Journaling& other) const;
bool equal(const Journaling &other) const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
@ -83,7 +83,7 @@ class SC_SYSTEM_CORE_API Journaling : public PublicObject {
* because it already exists in the list
* or it already has another parent
*/
bool add(JournalEntry* obj);
bool add(JournalEntry *obj);
/**
* Removes an object.
@ -92,7 +92,7 @@ class SC_SYSTEM_CORE_API Journaling : public PublicObject {
* @return false The object has not been removed
* because it does not exist in the list
*/
bool remove(JournalEntry* obj);
bool remove(JournalEntry *obj);
/**
* Removes an object of a particular class.
@ -107,10 +107,10 @@ class SC_SYSTEM_CORE_API Journaling : public PublicObject {
//! Index access
//! @return The object at index i
JournalEntry* journalEntry(size_t i) const;
JournalEntry *journalEntry(size_t i) const;
//! Find an object by its unique attribute(s)
JournalEntry* findJournalEntry(JournalEntry* journalEntry) const;
JournalEntry *findJournalEntry(JournalEntry *journalEntry) const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -69,28 +69,28 @@ class SC_SYSTEM_CORE_API Magnitude : public PublicObject {
public:
//! Copy constructor
Magnitude(const Magnitude& other);
Magnitude(const Magnitude &other);
//! Constructor with publicID
Magnitude(const std::string& publicID);
//! Destructor
~Magnitude() override;
// ------------------------------------------------------------------
// Creators
// ------------------------------------------------------------------
public:
static Magnitude* Create();
static Magnitude* Create(const std::string& publicID);
static Magnitude *Create();
static Magnitude *Create(const std::string& publicID);
// ------------------------------------------------------------------
// Lookup
// ------------------------------------------------------------------
public:
static Magnitude* Find(const std::string& publicID);
static Magnitude *Find(const std::string& publicID);
// ------------------------------------------------------------------
@ -99,14 +99,14 @@ class SC_SYSTEM_CORE_API Magnitude : public PublicObject {
public:
//! Copies the metadata of other to this
//! No changes regarding child objects are made
Magnitude& operator=(const Magnitude& other);
Magnitude &operator=(const Magnitude &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const Magnitude& other) const;
bool operator!=(const Magnitude& other) const;
bool operator==(const Magnitude &other) const;
bool operator!=(const Magnitude &other) const;
//! Wrapper that calls operator==
bool equal(const Magnitude& other) const;
bool equal(const Magnitude &other) const;
// ------------------------------------------------------------------
@ -162,7 +162,7 @@ class SC_SYSTEM_CORE_API Magnitude : public PublicObject {
CreationInfo& creationInfo();
const CreationInfo& creationInfo() const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
@ -175,8 +175,8 @@ class SC_SYSTEM_CORE_API Magnitude : public PublicObject {
* because it already exists in the list
* or it already has another parent
*/
bool add(Comment* obj);
bool add(StationMagnitudeContribution* obj);
bool add(Comment *obj);
bool add(StationMagnitudeContribution *obj);
/**
* Removes an object.
@ -185,8 +185,8 @@ class SC_SYSTEM_CORE_API Magnitude : public PublicObject {
* @return false The object has not been removed
* because it does not exist in the list
*/
bool remove(Comment* obj);
bool remove(StationMagnitudeContribution* obj);
bool remove(Comment *obj);
bool remove(StationMagnitudeContribution *obj);
/**
* Removes an object of a particular class.
@ -195,9 +195,9 @@ class SC_SYSTEM_CORE_API Magnitude : public PublicObject {
* @return false The index is out of bounds
*/
bool removeComment(size_t i);
bool removeComment(const CommentIndex& i);
bool removeComment(const CommentIndex &i);
bool removeStationMagnitudeContribution(size_t i);
bool removeStationMagnitudeContribution(const StationMagnitudeContributionIndex& i);
bool removeStationMagnitudeContribution(const StationMagnitudeContributionIndex &i);
//! Retrieve the number of objects of a particular class
size_t commentCount() const;
@ -205,15 +205,15 @@ class SC_SYSTEM_CORE_API Magnitude : public PublicObject {
//! Index access
//! @return The object at index i
Comment* comment(size_t i) const;
Comment* comment(const CommentIndex& i) const;
Comment *comment(size_t i) const;
Comment *comment(const CommentIndex &i) const;
StationMagnitudeContribution* stationMagnitudeContribution(size_t i) const;
StationMagnitudeContribution* stationMagnitudeContribution(const StationMagnitudeContributionIndex& i) const;
StationMagnitudeContribution *stationMagnitudeContribution(size_t i) const;
StationMagnitudeContribution *stationMagnitudeContribution(const StationMagnitudeContributionIndex &i) const;
//! Find an object by its unique attribute(s)
Origin* origin() const;
Origin *origin() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -51,7 +51,7 @@ class SC_SYSTEM_CORE_API ConfigSyncMessage : public Seiscomp::Core::Message {
// Message interface
// ------------------------------------------------------------------
public:
bool empty() const;
bool empty() const override;
// ------------------------------------------------------------------
@ -101,7 +101,7 @@ class SC_SYSTEM_CORE_API InventorySyncMessage : public Seiscomp::Core::Message {
// Message interface
// ------------------------------------------------------------------
public:
bool empty() const;
bool empty() const override;
// ------------------------------------------------------------------
@ -130,22 +130,22 @@ class SC_SYSTEM_CORE_API ArtificialOriginMessage : public Seiscomp::Core::Messag
public:
ArtificialOriginMessage(DataModel::Origin *origin);
// ------------------------------------------------------------------
// Message interface
// ------------------------------------------------------------------
public:
DataModel::Origin *origin() const;
void setOrigin(DataModel::Origin *origin);
virtual bool empty() const;
virtual bool empty() const override;
// ------------------------------------------------------------------
// Implementation
// ------------------------------------------------------------------
private:
DataModel::OriginPtr _origin;
DECLARE_SC_CLASSFACTORY_FRIEND(ArtificialOriginMessage);
};
@ -173,7 +173,7 @@ class SC_SYSTEM_CORE_API ArtificialEventParametersMessage : public Seiscomp::Cor
DataModel::EventParameters *eventParameters() const;
void setEventParameters(DataModel::EventParameters *eventParameters);
virtual bool empty() const;
virtual bool empty() const override;
// ------------------------------------------------------------------
// Implementation

View File

@ -42,7 +42,7 @@ class EnumPropertyBase<T, U, F1, F2, 0> : public Core::MetaProperty {
EnumPropertyBase(F1 setter, F2 getter)
: _setter(setter), _getter(getter) {}
bool write(Core::BaseObject *object, Core::MetaValue value) const {
bool write(Core::BaseObject *object, Core::MetaValue value) const override {
T *target = T::Cast(object);
if ( !target ) return false;
U tmp;
@ -53,7 +53,7 @@ class EnumPropertyBase<T, U, F1, F2, 0> : public Core::MetaProperty {
return true;
}
bool writeString(Core::BaseObject *object, const std::string &value) const {
bool writeString(Core::BaseObject *object, const std::string &value) const override {
T *target = T::Cast(object);
if ( !target ) return false;
typename Core::Generic::remove_optional<U>::type tmp;
@ -64,13 +64,13 @@ class EnumPropertyBase<T, U, F1, F2, 0> : public Core::MetaProperty {
return true;
}
Core::MetaValue read(const Core::BaseObject *object) const {
Core::MetaValue read(const Core::BaseObject *object) const override {
const T *target = T::ConstCast(object);
if ( !target ) throw Core::GeneralException("invalid object");
return (target->*_getter)().toInt();
}
std::string readString(const Core::BaseObject *object) const {
std::string readString(const Core::BaseObject *object) const override {
const T *target = T::ConstCast(object);
if ( !target ) throw Core::GeneralException("invalid object");
return (target->*_getter)().toString();
@ -89,7 +89,7 @@ class EnumPropertyBase<T, U, F1, F2, 1> : public Core::MetaProperty {
EnumPropertyBase(F1 setter, F2 getter)
: _setter(setter), _getter(getter) {}
bool write(Core::BaseObject *object, Core::MetaValue value) const {
bool write(Core::BaseObject *object, Core::MetaValue value) const override {
T *target = T::Cast(object);
if ( !target ) return false;
@ -106,7 +106,7 @@ class EnumPropertyBase<T, U, F1, F2, 1> : public Core::MetaProperty {
return true;
}
bool writeString(Core::BaseObject *object, const std::string &value) const {
bool writeString(Core::BaseObject *object, const std::string &value) const override {
T *target = T::Cast(object);
if ( !target ) return false;
@ -123,13 +123,13 @@ class EnumPropertyBase<T, U, F1, F2, 1> : public Core::MetaProperty {
return true;
}
Core::MetaValue read(const Core::BaseObject *object) const {
Core::MetaValue read(const Core::BaseObject *object) const override {
const T *target = T::ConstCast(object);
if ( !target ) throw Core::GeneralException("invalid object");
return (target->*_getter)().toInt();
}
std::string readString(const Core::BaseObject *object) const {
std::string readString(const Core::BaseObject *object) const override {
const T *target = T::ConstCast(object);
if ( !target ) throw Core::GeneralException("invalid object");
return (target->*_getter)().toString();
@ -153,7 +153,7 @@ class BaseObjectPropertyBase<A, T, U, F1, F2, 0> : public Core::MetaClassPropert
BaseObjectPropertyBase(F1 setter, F2 getter)
: _setter(setter), _getter(getter) {}
bool write(Core::BaseObject *object, Core::MetaValue value) const {
bool write(Core::BaseObject *object, Core::MetaValue value) const override {
T *target = T::Cast(object);
if ( !target ) return false;
@ -186,7 +186,7 @@ class BaseObjectPropertyBase<A, T, U, F1, F2, 0> : public Core::MetaClassPropert
return true;
}
Core::MetaValue read(const Core::BaseObject *object) const {
Core::MetaValue read(const Core::BaseObject *object) const override {
const T *target = T::ConstCast(object);
if ( !target ) throw Core::GeneralException("invalid object");
return static_cast<Core::BaseObject*>(&(const_cast<T*>(target)->*_getter)());
@ -205,7 +205,7 @@ class BaseObjectPropertyBase<A, T, U, F1, F2, 1> : public Core::MetaClassPropert
BaseObjectPropertyBase(F1 setter, F2 getter)
: _setter(setter), _getter(getter) {}
bool write(Core::BaseObject *object, Core::MetaValue value) const {
bool write(Core::BaseObject *object, Core::MetaValue value) const override {
T *target = T::Cast(object);
if ( !target ) return false;
@ -244,7 +244,7 @@ class BaseObjectPropertyBase<A, T, U, F1, F2, 1> : public Core::MetaClassPropert
return true;
}
Core::MetaValue read(const Core::BaseObject *object) const {
Core::MetaValue read(const Core::BaseObject *object) const override {
const T *target = T::ConstCast(object);
if ( !target ) throw Core::GeneralException("invalid object");
return static_cast<Core::BaseObject*>(&(const_cast<T*>(target)->*_getter)());
@ -267,21 +267,21 @@ class ArrayProperty : public Core::MetaProperty {
_eraseObjIndex(eraseObjIndex),
_eraseObjPointer(eraseObjPointer) {}
size_t arrayElementCount(const Core::BaseObject *object) const {
size_t arrayElementCount(const Core::BaseObject *object) const override {
const T *target = T::ConstCast(object);
if ( !target ) throw Core::GeneralException("invalid object");
return static_cast<size_t>((target->*_countObjects)());
}
Core::BaseObject *arrayObject(Core::BaseObject *object, int i) const {
Core::BaseObject *arrayObject(Core::BaseObject *object, int i) const override {
T *target = T::Cast(object);
if ( !target ) throw Core::GeneralException("invalid object");
return (target->*_getObj)(i);
}
bool arrayAddObject(Core::BaseObject *object, Core::BaseObject *ch) const {
bool arrayAddObject(Core::BaseObject *object, Core::BaseObject *ch) const override {
T *target = T::Cast(object);
if ( !target ) throw Core::GeneralException("invalid object");
@ -291,14 +291,14 @@ class ArrayProperty : public Core::MetaProperty {
return (target->*_addObj)(child);
}
bool arrayRemoveObject(Core::BaseObject *object, int i) const {
bool arrayRemoveObject(Core::BaseObject *object, int i) const override {
T *target = T::Cast(object);
if ( !target ) throw Core::GeneralException("invalid object");
return (target->*_eraseObjIndex)(i);
}
bool arrayRemoveObject(Core::BaseObject *object, Core::BaseObject *ch) const {
bool arrayRemoveObject(Core::BaseObject *object, Core::BaseObject *ch) const override {
T *target = T::Cast(object);
if ( !target ) throw Core::GeneralException("invalid object");
@ -308,7 +308,7 @@ class ArrayProperty : public Core::MetaProperty {
return (target->*_eraseObjPointer)(child);
}
Core::BaseObject *createClass() const {
Core::BaseObject *createClass() const override {
return U::Create();
}
@ -331,21 +331,21 @@ class ArrayClassProperty : public Core::MetaClassProperty<A> {
_eraseObjIndex(eraseObjIndex),
_eraseObjPointer(eraseObjPointer) {}
size_t arrayElementCount(const Core::BaseObject *object) const {
size_t arrayElementCount(const Core::BaseObject *object) const override {
const T *target = T::ConstCast(object);
if ( !target ) throw Core::GeneralException("invalid object");
return static_cast<size_t>((target->*_countObjects)());
}
Core::BaseObject *arrayObject(Core::BaseObject *object, int i) const {
Core::BaseObject *arrayObject(Core::BaseObject *object, int i) const override {
T *target = T::Cast(object);
if ( !target ) throw Core::GeneralException("invalid object");
return (target->*_getObj)(i);
}
bool arrayAddObject(Core::BaseObject *object, Core::BaseObject *ch) const {
bool arrayAddObject(Core::BaseObject *object, Core::BaseObject *ch) const override {
T *target = T::Cast(object);
if ( !target ) throw Core::GeneralException("invalid object");
@ -355,14 +355,14 @@ class ArrayClassProperty : public Core::MetaClassProperty<A> {
return (target->*_addObj)(child);
}
bool arrayRemoveObject(Core::BaseObject *object, int i) const {
bool arrayRemoveObject(Core::BaseObject *object, int i) const override {
T *target = T::Cast(object);
if ( !target ) throw Core::GeneralException("invalid object");
return (target->*_eraseObjIndex)(i);
}
bool arrayRemoveObject(Core::BaseObject *object, Core::BaseObject *ch) const {
bool arrayRemoveObject(Core::BaseObject *object, Core::BaseObject *ch) const override {
T *target = T::Cast(object);
if ( !target ) throw Core::GeneralException("invalid object");

View File

@ -68,28 +68,28 @@ class SC_SYSTEM_CORE_API MomentTensor : public PublicObject {
public:
//! Copy constructor
MomentTensor(const MomentTensor& other);
MomentTensor(const MomentTensor &other);
//! Constructor with publicID
MomentTensor(const std::string& publicID);
//! Destructor
~MomentTensor() override;
// ------------------------------------------------------------------
// Creators
// ------------------------------------------------------------------
public:
static MomentTensor* Create();
static MomentTensor* Create(const std::string& publicID);
static MomentTensor *Create();
static MomentTensor *Create(const std::string& publicID);
// ------------------------------------------------------------------
// Lookup
// ------------------------------------------------------------------
public:
static MomentTensor* Find(const std::string& publicID);
static MomentTensor *Find(const std::string& publicID);
// ------------------------------------------------------------------
@ -98,14 +98,14 @@ class SC_SYSTEM_CORE_API MomentTensor : public PublicObject {
public:
//! Copies the metadata of other to this
//! No changes regarding child objects are made
MomentTensor& operator=(const MomentTensor& other);
MomentTensor &operator=(const MomentTensor &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const MomentTensor& other) const;
bool operator!=(const MomentTensor& other) const;
bool operator==(const MomentTensor &other) const;
bool operator!=(const MomentTensor &other) const;
//! Wrapper that calls operator==
bool equal(const MomentTensor& other) const;
bool equal(const MomentTensor &other) const;
// ------------------------------------------------------------------
@ -199,7 +199,7 @@ class SC_SYSTEM_CORE_API MomentTensor : public PublicObject {
CreationInfo& creationInfo();
const CreationInfo& creationInfo() const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
@ -212,10 +212,10 @@ class SC_SYSTEM_CORE_API MomentTensor : public PublicObject {
* because it already exists in the list
* or it already has another parent
*/
bool add(Comment* obj);
bool add(DataUsed* obj);
bool add(MomentTensorPhaseSetting* obj);
bool add(MomentTensorStationContribution* obj);
bool add(Comment *obj);
bool add(DataUsed *obj);
bool add(MomentTensorPhaseSetting *obj);
bool add(MomentTensorStationContribution *obj);
/**
* Removes an object.
@ -224,10 +224,10 @@ class SC_SYSTEM_CORE_API MomentTensor : public PublicObject {
* @return false The object has not been removed
* because it does not exist in the list
*/
bool remove(Comment* obj);
bool remove(DataUsed* obj);
bool remove(MomentTensorPhaseSetting* obj);
bool remove(MomentTensorStationContribution* obj);
bool remove(Comment *obj);
bool remove(DataUsed *obj);
bool remove(MomentTensorPhaseSetting *obj);
bool remove(MomentTensorStationContribution *obj);
/**
* Removes an object of a particular class.
@ -236,10 +236,10 @@ class SC_SYSTEM_CORE_API MomentTensor : public PublicObject {
* @return false The index is out of bounds
*/
bool removeComment(size_t i);
bool removeComment(const CommentIndex& i);
bool removeComment(const CommentIndex &i);
bool removeDataUsed(size_t i);
bool removeMomentTensorPhaseSetting(size_t i);
bool removeMomentTensorPhaseSetting(const MomentTensorPhaseSettingIndex& i);
bool removeMomentTensorPhaseSetting(const MomentTensorPhaseSettingIndex &i);
bool removeMomentTensorStationContribution(size_t i);
//! Retrieve the number of objects of a particular class
@ -250,19 +250,19 @@ class SC_SYSTEM_CORE_API MomentTensor : public PublicObject {
//! Index access
//! @return The object at index i
Comment* comment(size_t i) const;
Comment* comment(const CommentIndex& i) const;
DataUsed* dataUsed(size_t i) const;
Comment *comment(size_t i) const;
Comment *comment(const CommentIndex &i) const;
DataUsed *dataUsed(size_t i) const;
MomentTensorPhaseSetting* momentTensorPhaseSetting(size_t i) const;
MomentTensorPhaseSetting* momentTensorPhaseSetting(const MomentTensorPhaseSettingIndex& i) const;
MomentTensorStationContribution* momentTensorStationContribution(size_t i) const;
MomentTensorPhaseSetting *momentTensorPhaseSetting(size_t i) const;
MomentTensorPhaseSetting *momentTensorPhaseSetting(const MomentTensorPhaseSettingIndex &i) const;
MomentTensorStationContribution *momentTensorStationContribution(size_t i) const;
//! Find an object by its unique attribute(s)
DataUsed* findDataUsed(DataUsed* dataUsed) const;
MomentTensorStationContribution* findMomentTensorStationContribution(const std::string& publicID) const;
DataUsed *findDataUsed(DataUsed *dataUsed) const;
MomentTensorStationContribution *findMomentTensorStationContribution(const std::string& publicID) const;
FocalMechanism* focalMechanism() const;
FocalMechanism *focalMechanism() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -81,7 +81,7 @@ class SC_SYSTEM_CORE_API MomentTensorComponentContribution : public Object {
MomentTensorComponentContribution();
//! Copy constructor
MomentTensorComponentContribution(const MomentTensorComponentContribution& other);
MomentTensorComponentContribution(const MomentTensorComponentContribution &other);
//! Custom constructor
MomentTensorComponentContribution(const std::string& phaseCode);
@ -96,21 +96,21 @@ class SC_SYSTEM_CORE_API MomentTensorComponentContribution : public Object {
//! Destructor
~MomentTensorComponentContribution() override;
// ------------------------------------------------------------------
// Operators
// ------------------------------------------------------------------
public:
//! Copies the metadata of other to this
MomentTensorComponentContribution& operator=(const MomentTensorComponentContribution& other);
MomentTensorComponentContribution &operator=(const MomentTensorComponentContribution &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const MomentTensorComponentContribution& other) const;
bool operator!=(const MomentTensorComponentContribution& other) const;
bool operator==(const MomentTensorComponentContribution &other) const;
bool operator!=(const MomentTensorComponentContribution &other) const;
//! Wrapper that calls operator==
bool equal(const MomentTensorComponentContribution& other) const;
bool equal(const MomentTensorComponentContribution &other) const;
// ------------------------------------------------------------------
@ -133,8 +133,8 @@ class SC_SYSTEM_CORE_API MomentTensorComponentContribution : public Object {
double timeShift() const;
void setDataTimeWindow(const std::vector< double >&);
const std::vector< double >& dataTimeWindow() const;
std::vector< double >& dataTimeWindow();
const std::vector< double > &dataTimeWindow() const;
std::vector< double > &dataTimeWindow();
void setMisfit(const OPT(double)& misfit);
double misfit() const;
@ -148,17 +148,17 @@ class SC_SYSTEM_CORE_API MomentTensorComponentContribution : public Object {
// ------------------------------------------------------------------
public:
//! Returns the object's index
const MomentTensorComponentContributionIndex& index() const;
const MomentTensorComponentContributionIndex &index() const;
//! Checks two objects for equality regarding their index
bool equalIndex(const MomentTensorComponentContribution* lhs) const;
bool equalIndex(const MomentTensorComponentContribution *lhs) const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
public:
MomentTensorStationContribution* momentTensorStationContribution() const;
MomentTensorStationContribution *momentTensorStationContribution() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -78,7 +78,7 @@ class SC_SYSTEM_CORE_API MomentTensorPhaseSetting : public Object {
MomentTensorPhaseSetting();
//! Copy constructor
MomentTensorPhaseSetting(const MomentTensorPhaseSetting& other);
MomentTensorPhaseSetting(const MomentTensorPhaseSetting &other);
//! Custom constructor
MomentTensorPhaseSetting(const std::string& code);
@ -90,21 +90,21 @@ class SC_SYSTEM_CORE_API MomentTensorPhaseSetting : public Object {
//! Destructor
~MomentTensorPhaseSetting() override;
// ------------------------------------------------------------------
// Operators
// ------------------------------------------------------------------
public:
//! Copies the metadata of other to this
MomentTensorPhaseSetting& operator=(const MomentTensorPhaseSetting& other);
MomentTensorPhaseSetting &operator=(const MomentTensorPhaseSetting &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const MomentTensorPhaseSetting& other) const;
bool operator!=(const MomentTensorPhaseSetting& other) const;
bool operator==(const MomentTensorPhaseSetting &other) const;
bool operator!=(const MomentTensorPhaseSetting &other) const;
//! Wrapper that calls operator==
bool equal(const MomentTensorPhaseSetting& other) const;
bool equal(const MomentTensorPhaseSetting &other) const;
// ------------------------------------------------------------------
@ -132,17 +132,17 @@ class SC_SYSTEM_CORE_API MomentTensorPhaseSetting : public Object {
// ------------------------------------------------------------------
public:
//! Returns the object's index
const MomentTensorPhaseSettingIndex& index() const;
const MomentTensorPhaseSettingIndex &index() const;
//! Checks two objects for equality regarding their index
bool equalIndex(const MomentTensorPhaseSetting* lhs) const;
bool equalIndex(const MomentTensorPhaseSetting *lhs) const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
public:
MomentTensor* momentTensor() const;
MomentTensor *momentTensor() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -54,28 +54,28 @@ class SC_SYSTEM_CORE_API MomentTensorStationContribution : public PublicObject {
public:
//! Copy constructor
MomentTensorStationContribution(const MomentTensorStationContribution& other);
MomentTensorStationContribution(const MomentTensorStationContribution &other);
//! Constructor with publicID
MomentTensorStationContribution(const std::string& publicID);
//! Destructor
~MomentTensorStationContribution() override;
// ------------------------------------------------------------------
// Creators
// ------------------------------------------------------------------
public:
static MomentTensorStationContribution* Create();
static MomentTensorStationContribution* Create(const std::string& publicID);
static MomentTensorStationContribution *Create();
static MomentTensorStationContribution *Create(const std::string& publicID);
// ------------------------------------------------------------------
// Lookup
// ------------------------------------------------------------------
public:
static MomentTensorStationContribution* Find(const std::string& publicID);
static MomentTensorStationContribution *Find(const std::string& publicID);
// ------------------------------------------------------------------
@ -84,14 +84,14 @@ class SC_SYSTEM_CORE_API MomentTensorStationContribution : public PublicObject {
public:
//! Copies the metadata of other to this
//! No changes regarding child objects are made
MomentTensorStationContribution& operator=(const MomentTensorStationContribution& other);
MomentTensorStationContribution &operator=(const MomentTensorStationContribution &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const MomentTensorStationContribution& other) const;
bool operator!=(const MomentTensorStationContribution& other) const;
bool operator==(const MomentTensorStationContribution &other) const;
bool operator!=(const MomentTensorStationContribution &other) const;
//! Wrapper that calls operator==
bool equal(const MomentTensorStationContribution& other) const;
bool equal(const MomentTensorStationContribution &other) const;
// ------------------------------------------------------------------
@ -111,7 +111,7 @@ class SC_SYSTEM_CORE_API MomentTensorStationContribution : public PublicObject {
void setTimeShift(const OPT(double)& timeShift);
double timeShift() const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
@ -124,7 +124,7 @@ class SC_SYSTEM_CORE_API MomentTensorStationContribution : public PublicObject {
* because it already exists in the list
* or it already has another parent
*/
bool add(MomentTensorComponentContribution* obj);
bool add(MomentTensorComponentContribution *obj);
/**
* Removes an object.
@ -133,7 +133,7 @@ class SC_SYSTEM_CORE_API MomentTensorStationContribution : public PublicObject {
* @return false The object has not been removed
* because it does not exist in the list
*/
bool remove(MomentTensorComponentContribution* obj);
bool remove(MomentTensorComponentContribution *obj);
/**
* Removes an object of a particular class.
@ -142,19 +142,19 @@ class SC_SYSTEM_CORE_API MomentTensorStationContribution : public PublicObject {
* @return false The index is out of bounds
*/
bool removeMomentTensorComponentContribution(size_t i);
bool removeMomentTensorComponentContribution(const MomentTensorComponentContributionIndex& i);
bool removeMomentTensorComponentContribution(const MomentTensorComponentContributionIndex &i);
//! Retrieve the number of objects of a particular class
size_t momentTensorComponentContributionCount() const;
//! Index access
//! @return The object at index i
MomentTensorComponentContribution* momentTensorComponentContribution(size_t i) const;
MomentTensorComponentContribution* momentTensorComponentContribution(const MomentTensorComponentContributionIndex& i) const;
MomentTensorComponentContribution *momentTensorComponentContribution(size_t i) const;
MomentTensorComponentContribution *momentTensorComponentContribution(const MomentTensorComponentContributionIndex &i) const;
//! Find an object by its unique attribute(s)
MomentTensor* momentTensor() const;
MomentTensor *momentTensor() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -92,28 +92,28 @@ class SC_SYSTEM_CORE_API Network : public PublicObject {
public:
//! Copy constructor
Network(const Network& other);
Network(const Network &other);
//! Constructor with publicID
Network(const std::string& publicID);
//! Destructor
~Network() override;
// ------------------------------------------------------------------
// Creators
// ------------------------------------------------------------------
public:
static Network* Create();
static Network* Create(const std::string& publicID);
static Network *Create();
static Network *Create(const std::string& publicID);
// ------------------------------------------------------------------
// Lookup
// ------------------------------------------------------------------
public:
static Network* Find(const std::string& publicID);
static Network *Find(const std::string& publicID);
// ------------------------------------------------------------------
@ -122,14 +122,14 @@ class SC_SYSTEM_CORE_API Network : public PublicObject {
public:
//! Copies the metadata of other to this
//! No changes regarding child objects are made
Network& operator=(const Network& other);
Network &operator=(const Network &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const Network& other) const;
bool operator!=(const Network& other) const;
bool operator==(const Network &other) const;
bool operator!=(const Network &other) const;
//! Wrapper that calls operator==
bool equal(const Network& other) const;
bool equal(const Network &other) const;
// ------------------------------------------------------------------
@ -193,12 +193,12 @@ class SC_SYSTEM_CORE_API Network : public PublicObject {
// ------------------------------------------------------------------
public:
//! Returns the object's index
const NetworkIndex& index() const;
const NetworkIndex &index() const;
//! Checks two objects for equality regarding their index
bool equalIndex(const Network* lhs) const;
bool equalIndex(const Network *lhs) const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
@ -211,8 +211,8 @@ class SC_SYSTEM_CORE_API Network : public PublicObject {
* because it already exists in the list
* or it already has another parent
*/
bool add(Comment* obj);
bool add(Station* obj);
bool add(Comment *obj);
bool add(Station *obj);
/**
* Removes an object.
@ -221,8 +221,8 @@ class SC_SYSTEM_CORE_API Network : public PublicObject {
* @return false The object has not been removed
* because it does not exist in the list
*/
bool remove(Comment* obj);
bool remove(Station* obj);
bool remove(Comment *obj);
bool remove(Station *obj);
/**
* Removes an object of a particular class.
@ -231,9 +231,9 @@ class SC_SYSTEM_CORE_API Network : public PublicObject {
* @return false The index is out of bounds
*/
bool removeComment(size_t i);
bool removeComment(const CommentIndex& i);
bool removeComment(const CommentIndex &i);
bool removeStation(size_t i);
bool removeStation(const StationIndex& i);
bool removeStation(const StationIndex &i);
//! Retrieve the number of objects of a particular class
size_t commentCount() const;
@ -241,16 +241,16 @@ class SC_SYSTEM_CORE_API Network : public PublicObject {
//! Index access
//! @return The object at index i
Comment* comment(size_t i) const;
Comment* comment(const CommentIndex& i) const;
Comment *comment(size_t i) const;
Comment *comment(const CommentIndex &i) const;
Station* station(size_t i) const;
Station* station(const StationIndex& i) const;
Station *station(size_t i) const;
Station *station(const StationIndex &i) const;
//! Find an object by its unique attribute(s)
Station* findStation(const std::string& publicID) const;
Station *findStation(const std::string& publicID) const;
Inventory* inventory() const;
Inventory *inventory() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -54,25 +54,25 @@ class SC_SYSTEM_CORE_API NodalPlane : public Core::BaseObject {
NodalPlane();
//! Copy constructor
NodalPlane(const NodalPlane& other);
NodalPlane(const NodalPlane &other);
//! Destructor
~NodalPlane() override;
// ------------------------------------------------------------------
// Operators
// ------------------------------------------------------------------
public:
//! Copies the metadata of other to this
NodalPlane& operator=(const NodalPlane& other);
NodalPlane &operator=(const NodalPlane &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const NodalPlane& other) const;
bool operator!=(const NodalPlane& other) const;
bool operator==(const NodalPlane &other) const;
bool operator!=(const NodalPlane &other) const;
//! Wrapper that calls operator==
bool equal(const NodalPlane& other) const;
bool equal(const NodalPlane &other) const;
// ------------------------------------------------------------------

View File

@ -53,25 +53,25 @@ class SC_SYSTEM_CORE_API NodalPlanes : public Core::BaseObject {
NodalPlanes();
//! Copy constructor
NodalPlanes(const NodalPlanes& other);
NodalPlanes(const NodalPlanes &other);
//! Destructor
~NodalPlanes() override;
// ------------------------------------------------------------------
// Operators
// ------------------------------------------------------------------
public:
//! Copies the metadata of other to this
NodalPlanes& operator=(const NodalPlanes& other);
NodalPlanes &operator=(const NodalPlanes &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const NodalPlanes& other) const;
bool operator!=(const NodalPlanes& other) const;
bool operator==(const NodalPlanes &other) const;
bool operator!=(const NodalPlanes &other) const;
//! Wrapper that calls operator==
bool equal(const NodalPlanes& other) const;
bool equal(const NodalPlanes &other) const;
// ------------------------------------------------------------------

View File

@ -234,8 +234,8 @@ class NotifierCreator : public Visitor {
// Interface
// ----------------------------------------------------------------------
public:
bool visit(PublicObject*);
void visit(Object*);
bool visit(PublicObject*) override;
void visit(Object*) override;
private:
Operation _operation;
@ -262,7 +262,7 @@ class NotifierStoreAppender : public Visitor {
// Interface
// ----------------------------------------------------------------------
public:
bool visit(PublicObject *po) {
bool visit(PublicObject *po) override {
if ( po->parent() == nullptr ) {
if ( _parentID.empty() )
return false;
@ -273,7 +273,7 @@ class NotifierStoreAppender : public Visitor {
return true;
}
void visit(Object *o) {
void visit(Object *o) override {
if ( o->parent() == nullptr ) {
if ( _parentID.empty() )
return;
@ -294,11 +294,11 @@ template <class T>
void AppendNotifier(T &store, Operation op, Object *o, const std::string parentID = "") {
// Remember the size of the store before any modifications
size_t endPos = store.size();
// Create a store appender and visit all child objects
NotifierStoreAppender<T> nsa(store, op, parentID);
o->accept(&nsa);
// If a parent id was specified and elements have been added to the
// store, override the parent id of the first object (o). Note: The
// position of the Notifier of o depends on the operation

View File

@ -88,7 +88,7 @@ class SC_SYSTEM_CORE_API Visitor {
TM_BOTTOMUP,
TM_QUANTITY
};
// ------------------------------------------------------------------
// Xstruction
// ------------------------------------------------------------------
@ -185,7 +185,7 @@ class SC_SYSTEM_CORE_API Object : public Core::BaseObject {
//! Sets the parent element
bool setParent(PublicObject* parent);
static bool RegisterObserver(Observer*);
static bool UnregisterObserver(Observer*);
@ -211,7 +211,7 @@ class SC_SYSTEM_CORE_API Object : public Core::BaseObject {
//! it does not become registered in the global instance
//! pool but receives exactly the same publicID like
//! 'this'.
virtual Object* clone() const = 0;
virtual Object* clone() const override = 0;
//! Adds the object to a parent. If it has already
//! a parent, the method returns false.
@ -244,7 +244,7 @@ class SC_SYSTEM_CORE_API Object : public Core::BaseObject {
private:
PublicObject *_parent{nullptr};
Core::Time _lastModifiedInArchive;
typedef std::vector<Observer*> ObserverList;
static ObserverList _observers;
};

View File

@ -73,28 +73,28 @@ class SC_SYSTEM_CORE_API Origin : public PublicObject {
public:
//! Copy constructor
Origin(const Origin& other);
Origin(const Origin &other);
//! Constructor with publicID
Origin(const std::string& publicID);
//! Destructor
~Origin() override;
// ------------------------------------------------------------------
// Creators
// ------------------------------------------------------------------
public:
static Origin* Create();
static Origin* Create(const std::string& publicID);
static Origin *Create();
static Origin *Create(const std::string& publicID);
// ------------------------------------------------------------------
// Lookup
// ------------------------------------------------------------------
public:
static Origin* Find(const std::string& publicID);
static Origin *Find(const std::string& publicID);
// ------------------------------------------------------------------
@ -103,14 +103,14 @@ class SC_SYSTEM_CORE_API Origin : public PublicObject {
public:
//! Copies the metadata of other to this
//! No changes regarding child objects are made
Origin& operator=(const Origin& other);
Origin &operator=(const Origin &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const Origin& other) const;
bool operator!=(const Origin& other) const;
bool operator==(const Origin &other) const;
bool operator!=(const Origin &other) const;
//! Wrapper that calls operator==
bool equal(const Origin& other) const;
bool equal(const Origin &other) const;
// ------------------------------------------------------------------
@ -212,7 +212,7 @@ class SC_SYSTEM_CORE_API Origin : public PublicObject {
CreationInfo& creationInfo();
const CreationInfo& creationInfo() const;
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
@ -225,11 +225,11 @@ class SC_SYSTEM_CORE_API Origin : public PublicObject {
* because it already exists in the list
* or it already has another parent
*/
bool add(Comment* obj);
bool add(CompositeTime* obj);
bool add(Arrival* obj);
bool add(StationMagnitude* obj);
bool add(Magnitude* obj);
bool add(Comment *obj);
bool add(CompositeTime *obj);
bool add(Arrival *obj);
bool add(StationMagnitude *obj);
bool add(Magnitude *obj);
/**
* Removes an object.
@ -238,11 +238,11 @@ class SC_SYSTEM_CORE_API Origin : public PublicObject {
* @return false The object has not been removed
* because it does not exist in the list
*/
bool remove(Comment* obj);
bool remove(CompositeTime* obj);
bool remove(Arrival* obj);
bool remove(StationMagnitude* obj);
bool remove(Magnitude* obj);
bool remove(Comment *obj);
bool remove(CompositeTime *obj);
bool remove(Arrival *obj);
bool remove(StationMagnitude *obj);
bool remove(Magnitude *obj);
/**
* Removes an object of a particular class.
@ -251,10 +251,10 @@ class SC_SYSTEM_CORE_API Origin : public PublicObject {
* @return false The index is out of bounds
*/
bool removeComment(size_t i);
bool removeComment(const CommentIndex& i);
bool removeComment(const CommentIndex &i);
bool removeCompositeTime(size_t i);
bool removeArrival(size_t i);
bool removeArrival(const ArrivalIndex& i);
bool removeArrival(const ArrivalIndex &i);
bool removeStationMagnitude(size_t i);
bool removeMagnitude(size_t i);
@ -267,21 +267,21 @@ class SC_SYSTEM_CORE_API Origin : public PublicObject {
//! Index access
//! @return The object at index i
Comment* comment(size_t i) const;
Comment* comment(const CommentIndex& i) const;
CompositeTime* compositeTime(size_t i) const;
Comment *comment(size_t i) const;
Comment *comment(const CommentIndex &i) const;
CompositeTime *compositeTime(size_t i) const;
Arrival* arrival(size_t i) const;
Arrival* arrival(const ArrivalIndex& i) const;
StationMagnitude* stationMagnitude(size_t i) const;
Magnitude* magnitude(size_t i) const;
Arrival *arrival(size_t i) const;
Arrival *arrival(const ArrivalIndex &i) const;
StationMagnitude *stationMagnitude(size_t i) const;
Magnitude *magnitude(size_t i) const;
//! Find an object by its unique attribute(s)
CompositeTime* findCompositeTime(CompositeTime* compositeTime) const;
StationMagnitude* findStationMagnitude(const std::string& publicID) const;
Magnitude* findMagnitude(const std::string& publicID) const;
CompositeTime *findCompositeTime(CompositeTime *compositeTime) const;
StationMagnitude *findStationMagnitude(const std::string& publicID) const;
Magnitude *findMagnitude(const std::string& publicID) const;
EventParameters* eventParameters() const;
EventParameters *eventParameters() const;
//! Implement Object interface
bool assign(Object *other) override;

View File

@ -54,25 +54,25 @@ class SC_SYSTEM_CORE_API OriginQuality : public Core::BaseObject {
OriginQuality();
//! Copy constructor
OriginQuality(const OriginQuality& other);
OriginQuality(const OriginQuality &other);
//! Destructor
~OriginQuality() override;
// ------------------------------------------------------------------
// Operators
// ------------------------------------------------------------------
public:
//! Copies the metadata of other to this
OriginQuality& operator=(const OriginQuality& other);
OriginQuality &operator=(const OriginQuality &other);
//! Checks for equality of two objects. Child objects
//! are not part of the check.
bool operator==(const OriginQuality& other) const;
bool operator!=(const OriginQuality& other) const;
bool operator==(const OriginQuality &other) const;
bool operator!=(const OriginQuality &other) const;
//! Wrapper that calls operator==
bool equal(const OriginQuality& other) const;
bool equal(const OriginQuality &other) const;
// ------------------------------------------------------------------

Some files were not shown because too many files have changed in this diff Show More