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
ClientMessage & setDetail (const char *fmt, Argtypes &&...args)
template
ClientMessage & setHint (const char *fmt, Argtypes &&...args)
void truncateLengths (size_t maxLen)
Static Public Member Functions
template
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

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

inline Constructor

Vertica::ClientMessage::ClientMessage()

inline Nullary constructor

Referenced by makeMessage().

Member Function Documentation

bool Vertica::ClientMessage::hasDetail() const

inline Does this message have a non-empty detail?

Returns true if this message has a detail field set

bool Vertica::ClientMessage::hasHint() const

inline Does this message have a non-empty hint?

Returns true if this message has a hint field set

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

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

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

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

std::string Vertica::ClientMessage::msg_detail

Message detail (optional)

Referenced by

int Vertica::ClientMessage::msg_errorcode

ID code for this message

std::string Vertica::ClientMessage::msg_hint

Message hint (optional)

Referenced by

std::string Vertica::ClientMessage::msg_main

Main message body (required)

Referenced by truncateLengths().