libpappsomspp
Library for mass spectrometry
Toggle main menu visibility
Loading...
Searching...
No Matches
cborstreamwriter.h
Go to the documentation of this file.
1
/**
2
* \file pappsomspp/processing/cbor/cborstreamwriter.h
3
* \date 05/07/2025
4
* \author Olivier Langella
5
* \brief PAPPSO CBOR stream writer
6
*/
7
8
/*******************************************************************************
9
* Copyright (c) 2025 Olivier Langella <Olivier.Langella@universite-paris-saclay.fr>.
10
*
11
* This file is part of PAPPSOms-tools.
12
*
13
* PAPPSOms-tools is free software: you can redistribute it and/or modify
14
* it under the terms of the GNU General Public License as published by
15
* the Free Software Foundation, either version 3 of the License, or
16
* (at your option) any later version.
17
*
18
* PAPPSOms-tools is distributed in the hope that it will be useful,
19
* but WITHOUT ANY WARRANTY; without even the implied warranty of
20
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
* GNU General Public License for more details.
22
*
23
* You should have received a copy of the GNU General Public License
24
* along with PAPPSOms-tools. If not, see <http://www.gnu.org/licenses/>.
25
*
26
******************************************************************************/
27
#pragma once
28
29
#include <QCborStreamWriter>
30
#include <QCborMap>
31
#include <qcborvalue.h>
32
33
34
#include "
pappsomspp/core/msrun/xiccoord/xiccoord.h
"
35
#include "
pappsomspp/export-import-config.h
"
36
#include "
pappsomspp/core/trace/trace.h
"
37
38
39
namespace
pappso
40
{
41
namespace
cbor
42
{
43
/** @brief overrides QCborStreamWriter base class to provide convenient functions
44
*/
45
class
PMSPP_LIB_DECL
CborStreamWriter
:
public
QCborStreamWriter
46
{
47
public
:
48
/**
49
* Default constructor
50
*/
51
CborStreamWriter
(QByteArray *data);
52
CborStreamWriter
(QIODevice *device);
53
54
/**
55
* Destructor
56
*/
57
virtual
~CborStreamWriter
();
58
59
60
/** @brief get UUID intialized when using @ref writeInformations
61
* @return QString for the UUID
62
*/
63
const
QString &
getUuid
()
const
;
64
65
/** @brief automatically produces an informations CBOR map
66
* the "informations" map contains default parameters : software, versions, UUID
67
*/
68
void
writeInformations
(
const
QString &software_name,
69
const
QString &software_version,
70
const
QString &type,
71
const
QString &operation);
72
73
74
void
writeCborValue
(
const
QCborValue &cbor_value);
75
void
writeCborMap
(
const
QCborMap &cbor_map);
76
void
writeCborArray
(
const
QCborArray &cbor_array);
77
void
writeArray
(
const
std::vector<std::size_t> &int_list);
78
void
writeArray
(
const
std::vector<qint64> &int_list);
79
void
writeArray
(
const
std::vector<double> &double_list);
80
void
writeArray
(
const
std::vector<int> &positions);
81
void
writeArray
(
const
std::vector<std::uint8_t> &small_uint_list);
82
void
writeArray
(
const
QStringList &str_list);
83
void
writeArray
(
const
std::vector<QString> &str_list);
84
85
/** @brief serialize a PAPPSO trace object to CBOR
86
* @param trace PAPPSO trace object reference
87
* @param x_label label for first dimension (x by default)
88
* @param y_label label for second dimension (y by default)
89
*/
90
void
writeTrace
(
const
pappso::Trace
&trace,
91
const
QString &x_label =
"x"
,
92
const
QString &y_label =
"y"
);
93
94
95
/** @brief serialize a PAPPSO xic coordinate object to CBOR
96
* @param xic PAPPSO object reference
97
*/
98
void
writeXicCoord
(
const
pappso::XicCoord
&xic_coord);
99
100
/** @brief serialize a PAPPSO xic coordinate object list to CBOR
101
* @param xic_coord_list PAPPSO object reference
102
*/
103
void
writeXicCoordList
(
const
std::vector<pappso::XicCoordSPtr> &xic_coord_list);
104
105
private
:
106
QString
m_uuid
;
107
};
108
}
// namespace cbor
109
}
// namespace pappso
pappso::Trace
A simple container of DataPoint instances.
Definition
trace.h:152
pappso::cbor::CborStreamWriter::CborStreamWriter
CborStreamWriter(QByteArray *data)
Definition
cborstreamwriter.cpp:39
pappso::cbor::CborStreamWriter::writeInformations
void writeInformations(const QString &software_name, const QString &software_version, const QString &type, const QString &operation)
automatically produces an informations CBOR map the "informations" map contains default parameters : ...
Definition
cborstreamwriter.cpp:60
pappso::cbor::CborStreamWriter::writeXicCoord
void writeXicCoord(const pappso::XicCoord &xic_coord)
serialize a PAPPSO xic coordinate object to CBOR
Definition
cborstreamwriter.cpp:205
pappso::cbor::CborStreamWriter::writeCborValue
void writeCborValue(const QCborValue &cbor_value)
Definition
cborstreamwriter.cpp:173
pappso::cbor::CborStreamWriter::writeArray
void writeArray(const std::vector< std::size_t > &int_list)
Definition
cborstreamwriter.cpp:94
pappso::cbor::CborStreamWriter::writeXicCoordList
void writeXicCoordList(const std::vector< pappso::XicCoordSPtr > &xic_coord_list)
serialize a PAPPSO xic coordinate object list to CBOR
Definition
cborstreamwriter.cpp:220
pappso::cbor::CborStreamWriter::writeTrace
void writeTrace(const pappso::Trace &trace, const QString &x_label="x", const QString &y_label="y")
serialize a PAPPSO trace object to CBOR
Definition
cborstreamwriter.cpp:191
pappso::cbor::CborStreamWriter::getUuid
const QString & getUuid() const
get UUID intialized when using writeInformations
Definition
cborstreamwriter.cpp:54
pappso::cbor::CborStreamWriter::writeCborMap
void writeCborMap(const QCborMap &cbor_map)
Definition
cborstreamwriter.cpp:179
pappso::cbor::CborStreamWriter::writeCborArray
void writeCborArray(const QCborArray &cbor_array)
Definition
cborstreamwriter.cpp:185
pappso::cbor::CborStreamWriter::m_uuid
QString m_uuid
Definition
cborstreamwriter.h:106
export-import-config.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition
export-import-config.h:14
pappso::cbor
Definition
cborstreamreader.cpp:35
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition
aa.cpp:39
pappso::XicCoord
coordinates of the XIC to extract and the resulting XIC after extraction
Definition
xiccoord.h:68
trace.h
xiccoord.h
pappsomspp
core
processing
cbor
cborstreamwriter.h
Generated on
for libpappsomspp by
1.17.0