OpenMS
Loading...
Searching...
No Matches
TOPPBase_defs.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, Clemens Groepl $
7// --------------------------------------------------------------------------
8
9#pragma once
10
11// Small, dependency-light definitions shared by TOPPBase: the Citation struct and
12// the TOPPBase-specific parameter exceptions. Split out of TOPPBase.h so they can
13// be used without pulling in the full TOPPBase interface.
14
17
18#include <string>
19
20namespace OpenMS
21{
34 struct Citation
35 {
36 std::string authors;
37 std::string title;
38 std::string when_where;
39 std::string doi;
40
42 std::string toString() const
43 {
44 return authors + ". " + title + ". " + when_where + ". doi:" + doi + ".";
45 }
46 };
47
48 namespace Exception
49 {
51 class OPENMS_DLLAPI UnregisteredParameter :
53 {
54public:
55 UnregisteredParameter(const char* file, int line, const char* function, const std::string& parameter) :
56 BaseException(file, line, function, "UnregisteredParameter", parameter)
57 {
58 GlobalExceptionHandler::getInstance().setMessage(what());
59 }
60
61 };
63 class OPENMS_DLLAPI WrongParameterType :
65 {
66public:
67 WrongParameterType(const char* file, int line, const char* function, const std::string& parameter) :
68 BaseException(file, line, function, "WrongParameterType", parameter)
69 {
70 GlobalExceptionHandler::getInstance().setMessage(what());
71 }
72
73 };
75 class OPENMS_DLLAPI RequiredParameterNotGiven :
77 {
78public:
79 RequiredParameterNotGiven(const char* file, int line, const char* function, const std::string& parameter) :
80 BaseException(file, line, function, "RequiredParameterNotGiven", parameter)
81 {
82 GlobalExceptionHandler::getInstance().setMessage(what());
83 }
84
85 };
86 }
87
88} // namespace OpenMS
Exception base class.
Definition Exception.h:63
A required parameter was not given.
Definition TOPPBase_defs.h:77
RequiredParameterNotGiven(const char *file, int line, const char *function, const std::string &parameter)
Definition TOPPBase_defs.h:79
An unregistered parameter was accessed.
Definition TOPPBase_defs.h:53
UnregisteredParameter(const char *file, int line, const char *function, const std::string &parameter)
Definition TOPPBase_defs.h:55
A parameter was accessed with the wrong type.
Definition TOPPBase_defs.h:65
WrongParameterType(const char *file, int line, const char *function, const std::string &parameter)
Definition TOPPBase_defs.h:67
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Stores Citations for individual TOPP tools.
Definition TOPPBase_defs.h:35
std::string toString() const
mangle members to string
Definition TOPPBase_defs.h:42
std::string when_where
suggested format: journal. year; volume, issue: pages
Definition TOPPBase_defs.h:38
std::string authors
list of authors in AMA style, i.e. "surname initials", ...
Definition TOPPBase_defs.h:36
std::string title
title of article
Definition TOPPBase_defs.h:37
std::string doi
plain DOI (no urls), e.g. 10.1021/pr100177k
Definition TOPPBase_defs.h:39