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