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
13
14#include <boost/multi_index_container.hpp>
15#include <boost/multi_index/ordered_index.hpp>
16#include <boost/multi_index/member.hpp>
17
18#include <set>
19
20namespace OpenMS
21{
22 namespace IdentificationDataInternal
23 {
25 struct InputFile
26 {
27 std::string name;
28
30
31 std::set<std::string> primary_files;
32
33 explicit InputFile(const std::string& name,
34 const std::string& experimental_design_id = "",
35 const std::set<std::string>& primary_files =
36 std::set<std::string>()):
39 {
40 }
41
42 InputFile(const InputFile& other) = default;
43
45 InputFile& merge(const InputFile& other)
46 {
47 if (experimental_design_id.empty())
48 {
50 }
52 {
53 throw Exception::InvalidValue(__FILE__, __LINE__,
54 OPENMS_PRETTY_FUNCTION,
55 "Trying to overwrite InputFile experimental design id with conflicting value.",
57 }
58 primary_files.insert(other.primary_files.begin(),
59 other.primary_files.end());
60 return *this;
61 }
62 };
63
64 typedef boost::multi_index_container<
66 boost::multi_index::indexed_by<
67 boost::multi_index::ordered_unique<boost::multi_index::member<
68 InputFile, std::string, &InputFile::name>>>
71
72 }
73}
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
IteratorWrapper< InputFiles::iterator > InputFileRef
Definition include/OpenMS/METADATA/ID/InputFile.h:70
boost::multi_index_container< InputFile, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::member< InputFile, std::string, &InputFile::name > > > > InputFiles
Definition include/OpenMS/METADATA/ID/InputFile.h:69
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:26
InputFile(const InputFile &other)=default
std::string name
Definition include/OpenMS/METADATA/ID/InputFile.h:27
std::string experimental_design_id
Definition include/OpenMS/METADATA/ID/InputFile.h:29
InputFile(const std::string &name, const std::string &experimental_design_id="", const std::set< std::string > &primary_files=std::set< std::string >())
Definition include/OpenMS/METADATA/ID/InputFile.h:33
std::set< std::string > primary_files
Definition include/OpenMS/METADATA/ID/InputFile.h:31
InputFile & merge(const InputFile &other)
Merge in data from another object.
Definition include/OpenMS/METADATA/ID/InputFile.h:45
Wrapper that adds operator< to iterators, so they can be used as (part of) keys in maps/sets or multi...
Definition MetaData.h:20