OpenMS
Loading...
Searching...
No Matches
Software.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: Timo Sachsenberg $
6// $Authors: Marc Sturm $
7// --------------------------------------------------------------------------
8
9#pragma once
10
15#include <functional>
16
17namespace OpenMS
18{
24 class OPENMS_DLLAPI Software :
25 public CVTermList
26 {
27public:
29 explicit Software(const String& name = "", const String& version = "");
31 Software(const Software&) = default;
33 Software(Software&&) = default;
35 ~Software() override;
36
38 Software& operator=(const Software&) = default;
40 Software& operator=(Software&&)& = default;
41
43 bool operator==(const Software& rhs) const;
45 bool operator!=(const Software& rhs) const;
47 bool operator<(const Software& rhs) const;
48
50 const String& getName() const;
52 void setName(const String& name);
53
55 const String& getVersion() const;
57 void setVersion(const String& version);
58
59protected:
62 };
63} // namespace OpenMS
64
65// Hash function specialization for Software
66namespace std
67{
76 template<>
77 struct hash<OpenMS::Software>
78 {
79 std::size_t operator()(const OpenMS::Software& s) const noexcept
80 {
81 std::size_t seed = OpenMS::fnv1a_hash_string(s.getName());
83 return seed;
84 }
85 };
86} // namespace std
87
Representation of controlled vocabulary term list.
Definition CVTermList.h:29
Description of the software used for processing.
Definition Software.h:26
bool operator==(const Software &rhs) const
Equality operator.
Software(Software &&)=default
Move constructor.
Software(const String &name="", const String &version="")
Constructor.
Software & operator=(Software &&) &=default
Move assignment operator.
String name_
Definition Software.h:60
String version_
Definition Software.h:61
void setName(const String &name)
Sets the name of the software.
bool operator<(const Software &rhs) const
Less-than operator (for sorting)
const String & getVersion() const
Returns the software version.
const String & getName() const
Returns the name of the software.
bool operator!=(const Software &rhs) const
Inequality operator.
~Software() override
Destructor.
Software & operator=(const Software &)=default
Assignment operator.
Software(const Software &)=default
Copy constructor.
void setVersion(const String &version)
Sets the software version.
A more convenient string class.
Definition String.h:34
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
void hash_combine(std::size_t &seed, std::size_t value) noexcept
Combine a hash value with additional data using golden ratio mixing.
Definition HashUtils.h:87
std::size_t fnv1a_hash_string(const std::string &s) noexcept
FNV-1a hash for a string.
Definition HashUtils.h:70
STL namespace.
std::size_t operator()(const OpenMS::Software &s) const noexcept
Definition Software.h:79