9 #ifndef PQXX_TRANSACTION_FOCUS_HXX
10 #define PQXX_TRANSACTION_FOCUS_HXX
12 #if !defined(PQXX_HEADER_PRE)
13 # error "Include libpqxx headers as <pqxx/header>, not <pqxx/header.hxx>."
35 m_trans{&t}, m_classname{cname}, m_name{oname}
40 m_trans{&t}, m_classname{cname}, m_name{std::move(oname)}
44 m_trans{&t}, m_classname{cname}
55 [[nodiscard]] constexpr std::string_view
classname() const noexcept
61 [[nodiscard]] std::string_view
name() const & noexcept {
return m_name; }
70 m_trans{other.m_trans},
71 m_classname{other.m_classname},
72 m_registered{other.m_registered}
77 move_name_and_registration(other);
86 m_trans = other.m_trans;
87 m_classname = other.m_classname;
88 move_name_and_registration(other);
96 void unregister_me() noexcept;
97 void reg_pending_error(std::
string const &,
sl) noexcept;
98 [[nodiscard]]
bool registered() const noexcept {
return m_registered; }
126 bool const reg{other.m_registered};
131 m_name = std::move(other.m_name);
137 std::string_view m_classname;
139 bool m_registered =
false;
Base class for things that monopolise a transaction's attention.
Definition: transaction_focus.hxx:29
std::string description() const
Definition: transaction_focus.hxx:63
transaction_focus()=delete
transaction_focus(transaction_base &t, std::string_view cname)
Definition: transaction_focus.hxx:43
void unregister_me() noexcept
Definition: transaction_base.cxx:568
std::string_view name() const &noexcept
Name for this object, if the caller passed one; empty string otherwise.
Definition: transaction_focus.hxx:61
constexpr std::string_view classname() const noexcept
Class name, for human consumption.
Definition: transaction_focus.hxx:55
transaction_focus(transaction_base &t, std::string_view cname, std::string &&oname)
Definition: transaction_focus.hxx:38
transaction_focus(transaction_focus const &)=delete
transaction_focus(transaction_focus &&other)
Definition: transaction_focus.hxx:69
transaction_focus & operator=(transaction_focus &&other)
Definition: transaction_focus.hxx:80
transaction_base & trans() noexcept
The transaction focused on this transaction_focus.
Definition: transaction_focus.hxx:102
~transaction_focus()=default
transaction_focus(transaction_base &t, std::string_view cname, std::string_view oname)
Definition: transaction_focus.hxx:33
transaction_base * m_trans
Definition: transaction_focus.hxx:116
transaction_base const & trans() const noexcept
The transaction focused on this transaction_focus.
Definition: transaction_focus.hxx:104
transaction_focus & operator=(transaction_focus const &)=delete
Interface definition (and common code) for "transaction" classes.
Definition: transaction_base.hxx:151
std::string describe_object(std::string_view class_name, std::string_view name)
Describe an object for humans, based on class name and optional name.
Definition: util.cxx:53
The home of all libpqxx classes, functions, templates, etc.
Definition: array.cxx:26
std::source_location sl
Convenience alias for std::source_location. It's just too long.
Definition: types.hxx:38