libpqxx
pqxx::internal::namedclass Class Reference

Helper base class: object descriptions for error messages and such. More...

#include <util.hxx>

Inheritance diagram for pqxx::internal::namedclass:

Public Member Functions

 namedclass (const std::string &Classname)
 
 namedclass (const std::string &Classname, const std::string &Name)
 
const std::string & name () const noexcept
 Object name, or the empty string if no name was given. More...
 
const std::string & classname () const noexcept
 Class name. More...
 
std::string description () const
 Combination of class name and object name; or just class name. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ namedclass() [1/2]

pqxx::internal::namedclass::namedclass ( const std::string &  Classname)
explicit

◆ namedclass() [2/2]

pqxx::internal::namedclass::namedclass ( const std::string &  Classname,
const std::string &  Name 
)

Member Function Documentation

◆ classname()

const std::string& pqxx::internal::namedclass::classname ( ) const
noexcept

◆ description()

◆ name()

const std::string& pqxx::internal::namedclass::name ( ) const
noexcept

The documentation for this class was generated from the following files: