OpenMS
Loading...
Searching...
No Matches
include/OpenMS/METADATA/ID/InputFile.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Hendrik Weisser $
6// $Authors: Hendrik Weisser $
7// --------------------------------------------------------------------------
8
9#pragma once
10
12
13#include <boost/multi_index_container.hpp>
14#include <boost/multi_index/ordered_index.hpp>
15#include <boost/multi_index/member.hpp>
16
17#include <set>
18
19namespace OpenMS
20{
21 namespace IdentificationDataInternal
22 {
24 struct InputFile
25 {
27
29
30 std::set<String> primary_files;
31
32 explicit InputFile(const String& name,
34 const std::set<String>& primary_files =
35 std::set<String>()):
38 {
39 }
40
41 InputFile(const InputFile& other) = default;
42
44 InputFile& merge(const InputFile& other)
45 {
46 if (experimental_design_id.empty())
47 {
49 }
51 {
52 throw Exception::InvalidValue(__FILE__, __LINE__,
53 OPENMS_PRETTY_FUNCTION,
54 "Trying to overwrite InputFile experimental design id with conflicting value.",
56 }
57 primary_files.insert(other.primary_files.begin(),
58 other.primary_files.end());
59 return *this;
60 }
61 };
62
63 typedef boost::multi_index_container<
65 boost::multi_index::indexed_by<
66 boost::multi_index::ordered_unique<boost::multi_index::member<
67 InputFile, String, &InputFile::name>>>
70
71 }
72}
Invalid value exception.
Definition Exception.h:306
A simple widget with a line-edit and a browse button to choose filenames.
Definition gui/include/OpenMS/VISUAL/InputFile.h:31
A more convenient string class.
Definition String.h:34
IteratorWrapper< InputFiles::iterator > InputFileRef
Definition include/OpenMS/METADATA/ID/InputFile.h:69
boost::multi_index_container< InputFile, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::member< InputFile, String, &InputFile::name > > > > InputFiles
Definition include/OpenMS/METADATA/ID/InputFile.h:68
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Information about input files that were processed.
Definition include/OpenMS/METADATA/ID/InputFile.h:25
std::set< String > primary_files
Definition include/OpenMS/METADATA/ID/InputFile.h:30
InputFile(const InputFile &other)=default
String name
Definition include/OpenMS/METADATA/ID/InputFile.h:26
InputFile(const String &name, const String &experimental_design_id="", const std::set< String > &primary_files=std::set< String >())
Definition include/OpenMS/METADATA/ID/InputFile.h:32
String experimental_design_id
Definition include/OpenMS/METADATA/ID/InputFile.h:28
InputFile & merge(const InputFile &other)
Merge in data from another object.
Definition include/OpenMS/METADATA/ID/InputFile.h:44
Wrapper that adds operator< to iterators, so they can be used as (part of) keys in maps/sets or multi...
Definition MetaData.h:20