Vertica documentation is moving! Use our new documentation site at https://docs.rocketsoftware.com/bundle/vertica_24.2/page/index.html

Vertica::ClientMessage Class Reference

Holds the contents of a user-defined message to be reported by a UDx.

Collaboration diagram for Vertica::ClientMessage:

Public Member Functions
ClientMessage (int errorcode, std::string main, std::string hint="", std::string detail="")
ClientMessage ()
bool hasDetail () const
bool hasHint () const
template<typename... Argtypes>
ClientMessage & setDetail (const char *fmt, Argtypes &&... args)
template<typename... Argtypes>
ClientMessage & setHint (const char *fmt, Argtypes &&... args)
void truncateLengths (size_t maxLen)
Static Public Member Functions
template<typename... Argtypes>
static ClientMessage makeMessage (int errorcode, const char *fmt, Argtypes &&... args)
Public Attributes
std::string msg_detail
int msg_errorcode
std::string msg_hint
std::string msg_main

Detailed Description

Holds the contents of a user-defined message to be reported by a UDx.

Made using ClientMessage::makeMessage(...). Must have an error code and main message, but the hint and detail strings are optional. Reported to the client using one of the ServerInterface methods (reportInfo, reportNotice, reportWarning, or reportError).

Constructor & Destructor Documentation

◆ClientMessage() [1/2]

Vertica::ClientMessage::ClientMessage(int errorcode, std::string main, std::string hint = "", std::string detail = "")

inline Constructor

◆ClientMessage() [2/2]

Vertica::ClientMessage::ClientMessage()

inline Nullary constructor

Referenced by makeMessage().

Member Function Documentation

◆hasDetail()

bool Vertica::ClientMessage::hasDetail() const

inline Does this message have a non-empty detail?

Returns true if this message has a detail field set

◆hasHint()

bool Vertica::ClientMessage::hasHint() const

inline Does this message have a non-empty hint?

Returns true if this message has a hint field set

◆makeMessage()

template<typename... Argtypes>
static ClientMessage Vertica::ClientMessage::makeMessage(int errorcode, const char * fmt, Argtypes &&... args)

inlinestatic

Builds a message using printf-style arguments to format the main text.

Parameters

  • errorcode: This message's id number
  • fmt: A printf-style format string for the main body
  • args: Any arguments to be substituted into fmt

Returns a ClientMessage with the provided error code & formatted main body

◆setDetail()

template<typename... Argtypes>
ClientMessage& Vertica::ClientMessage::setDetail(const char * fmt, Argtypes &&... args)

inline Sets this message's detail field.

Parameters

  • fmt: A printf-style format string for the detail
  • args: Any argumetns to be substituted into fmt

Returns a reference to this message, to allow for chaining

◆setHint()

template<typename... Argtypes>
ClientMessage& Vertica::ClientMessage::setHint(const char * fmt, Argtypes &&... args)

inline Sets this message's hint field.

Parameters

  • fmt: A printf-style format string for the hint
  • args: Any argumetns to be substituted into fmt

Returns a reference to this message, to allow for chaining

◆truncateLengths()

void Vertica::ClientMessage::truncateLengths(size_t maxLen)

inline Truncate the lengths of the string fields, keeping them at most maxLen

Parameters

  • maxLen: The largest length allowed for this message's fields

Member Data Documentation

◆msg_detail

std::string Vertica::ClientMessage::msg_detail

Message detail (optional)

Referenced by

◆msg_errorcode

int Vertica::ClientMessage::msg_errorcode

ID code for this message

◆msg_hint

std::string Vertica::ClientMessage::msg_hint

Message hint (optional)

Referenced by

◆msg_main

std::string Vertica::ClientMessage::msg_main

Main message body (required)

Referenced by truncateLengths().