lintel 0.2.0
Loading...
Searching...
No Matches
PropertyNotFoundException.h
Go to the documentation of this file.
1#ifndef LOGGING_PROPERTYNOTFOUNDEXCEPTION_H
2#define LOGGING_PROPERTYNOTFOUNDEXCEPTION_H
3
4#include <exception>
5#include <format>
6#include <string>
7
8namespace lintel {
10class PropertyNotFoundException : public std::exception
11{
12private:
13 std::string m_name;
14 std::string m_instanceName;
15 std::string m_className;
16 std::string m_processName;
17 std::string m_message;
18
19public:
24 PropertyNotFoundException(const std::string &name,
25 const std::string &instanceName,
26 const std::string &className,
27 const std::string &processName)
28 : m_name(name), m_instanceName(instanceName), m_className(className), m_processName(processName),
29 m_message(std::format("Property<> with name: {} instanceName: {} "
30 "className: {} processName: {} not found",
31 name,
32 instanceName,
33 className,
34 processName))
35 {}
36
37 [[nodiscard]] const char *what() const noexcept override { return m_message.c_str(); }
38
40 [[nodiscard]] const std::string &getName() const { return m_name; }
41
43 [[nodiscard]] const std::string &getInstanceName() const { return m_instanceName; }
44
46 [[nodiscard]] const std::string &getClassName() const { return m_className; }
47
49 [[nodiscard]] const std::string &getProcessName() const { return m_processName; }
50};
51
52}// namespace lintel
53#endif// LOGGING_PROPERTYNOTFOUNDEXCEPTION_H
Definition PropertyNotFoundException.h:11
const std::string & getInstanceName() const
Definition PropertyNotFoundException.h:43
const std::string & getClassName() const
Definition PropertyNotFoundException.h:46
const char * what() const noexcept override
Definition PropertyNotFoundException.h:37
const std::string & getProcessName() const
Definition PropertyNotFoundException.h:49
const std::string & getName() const
Definition PropertyNotFoundException.h:40
PropertyNotFoundException(const std::string &name, const std::string &instanceName, const std::string &className, const std::string &processName)
Definition PropertyNotFoundException.h:24
Definition BaseFeature.h:6
constexpr std::string_view type_name()
Definition TypeName.h:9