libpqxx
7.0.5
|
Helper base class: object descriptions for error messages and such. More...
#include <util.hxx>
Public Member Functions | |
namedclass (std::string_view classname) | |
namedclass (std::string_view classname, std::string_view name) | |
namedclass (std::string_view classname, char const name[]) | |
namedclass (std::string_view classname, std::string &&name) | |
std::string const & | name () const noexcept |
Object name, or the empty string if no name was given. More... | |
std::string const & | classname () const noexcept |
Class name. More... | |
std::string | description () const |
Combination of class name and object name; or just class name. More... | |
Helper base class: object descriptions for error messages and such.
Classes derived from namedclass have a class name (such as "transaction"), an optional object name (such as "delete-old-logs"), and a description generated from the two names (such as "transaction delete-old-logs").
The class name is dynamic here, in order to support inheritance hierarchies where the exact class name may not be known statically.
In inheritance hierarchies, make namedclass a virtual base class so that each class in the hierarchy can specify its own class name in its constructors.
|
explicit |
pqxx::internal::namedclass::namedclass | ( | std::string_view | classname, |
std::string_view | name | ||
) |
pqxx::internal::namedclass::namedclass | ( | std::string_view | classname, |
char const | name[] | ||
) |
pqxx::internal::namedclass::namedclass | ( | std::string_view | classname, |
std::string && | name | ||
) |
|
noexcept |
Class name.
References pqxx::internal::check_unique_registration(), and pqxx::internal::check_unique_unregistration().
Referenced by description().
std::string pqxx::internal::namedclass::description | ( | ) | const |
Combination of class name and object name; or just class name.
References classname(), and name().
Referenced by pqxx::transaction_base::abort(), pqxx::internal::check_unique_registration(), pqxx::internal::check_unique_unregistration(), pqxx::transaction_base::close(), pqxx::transaction_base::commit(), pqxx::transaction_base::exec(), and pqxx::transaction_base::~transaction_base().
|
noexcept |
Object name, or the empty string if no name was given.
Referenced by pqxx::internal::basic_robusttransaction::basic_robusttransaction(), pqxx::internal::basic_transaction::basic_transaction(), and description().