Files
libcapsclient/libs/gempa/caps/mseedpacket.h
2026-03-18 15:18:05 +01:00

89 lines
2.5 KiB
C++

/***************************************************************************
* Copyright (C) 2009 by gempa GmbH *
* *
* All Rights Reserved. *
* *
* NOTICE: All information contained herein is, and remains *
* the property of gempa GmbH and its suppliers, if any. The intellectual *
* and technical concepts contained herein are proprietary to gempa GmbH *
* and its suppliers. *
* Dissemination of this information or reproduction of this material *
* is strictly forbidden unless prior written permission is obtained *
* from gempa GmbH. *
***************************************************************************/
#ifndef GEMPA_CAPS_MSEEDPACKET_H
#define GEMPA_CAPS_MSEEDPACKET_H
#include <gempa/caps/packet.h>
namespace Gempa {
namespace CAPS {
class MSEEDDataRecord : public DataRecord {
public:
MSEEDDataRecord();
DataRecord *clone() const override;
const char *formatName() const override;
bool readMetaData(std::streambuf &buf, int size,
Header &header,
Time &startTime,
Time &endTime) override;
const Header *header() const override;
Time startTime() const override;
Time endTime() const override;
bool canTrim() const override;
bool canMerge() const override;
bool trim(const Time &start,
const Time &end) const override;
size_t dataSize(bool withHeader) const override;
ReadStatus get(std::streambuf &buf, int size,
const Time &start = Time(),
const Time &end = Time(),
int maxSize = -1) override;
bool put(std::streambuf &buf, bool withHeader) const override;
/**
* @brief Returns the packet type
* @return The packet type
*/
PacketType packetType() const override { return MSEEDPacket; }
/**
* @brief Initializes the internal data vector from the given buffer
* @param The buffer to read the data from
* @param The buffer size
*/
void setData(const void *data, size_t size);
void unpackHeader();
protected:
Header _header;
Time _startTime;
Time _endTime;
int _dataType;
};
}
}
#endif