Mobile API Reference  MicroStrategy 2019
MBase::Message Class Reference

#include <Message.h>

Inheritance diagram for MBase::Message:
MBase::BufferException MBase::ContractManagerAllocException MBase::StringConversionException MDataType::BigDecimalException MDataType::VariantException MEncryptor::BadDataException MEncryptor::BadDecryptionException MEncryptor::BadEncryptionException MEncryptor::BadHashException MMultiProcess::SharedMemoryException MSerialization::SerializationException MSynch::LockOrderViolationException MSynch::RWLockException

Classes

class  Localizer
 
class  PlacementArrayPtr
 
class  PlacementPtr
 

Public Types

typedef unsigned Int32 SizeType
 
typedef void(* Manipulator) (Message &irMessage)
 

Public Member Functions

 Message ()
 
 Message (const Message &irOther)
 
 Message (MessageDomain iDomain, MessageID iID, const char *ipTemplate=NULL)
 
Messageoperator= (const Message &irOther)
 
bool Swap (Message &irOther) throw ()
 
 ~Message () throw ()
 
MessageWrapBy (MessageDomain iDomain, MessageID iID, const char *ipTemplate=NULL)
 
const MessageGetLowerLevelMessageOrNULL () const
 
MessagePrependBy (MessageDomain iDomain, MessageID iID, const char *ipTemplate=NULL)
 
MessagePrependBy (const Message &irMessage)
 
const MessageGetSameLevelMessageOrNULL () const
 
bool IsEmpty () const
 
void Clear ()
 
MBase::MessageDomain GetDomain () const
 
MBase::MessageID GetID () const
 
void SetDomainAndID (MBase::MessageDomain iDomain, MessageID iID)
 
const char * GetTemplate () const
 
void SetTemplate (const char *ipTemplate)
 
const char * GetParameter (unsigned int iIndex) const
 
Messageoperator<< (bool iParameter)
 
Messageoperator<< (int iParameter)
 
Messageoperator<< (unsigned int iParameter)
 
Messageoperator<< (long iParameter)
 
Messageoperator<< (unsigned long iParameter)
 
Messageoperator<< (const char *ipParameter)
 
Messageoperator<< (const WCHAR *ipParameter)
 
Messageoperator<< (Manipulator ipManipulator)
 
const char * GetLocalizedText (MBase::LanguageID iLanguageID) const
 
void SetLocalizedText (MBase::LanguageID iLanguageID, const char *ipText)
 
MBase::ReturnString Localize (Localizer &irLocalizer, MBase::LanguageID iLanguageID) const
 
const WCHARGetMessage () const throw ()
 
void SetMessage (const WCHAR *ipMessage) throw ()
 
unsigned Int32 GetErrorCode () const throw ()
 

Static Public Member Functions

static void Dec (Message &irMessage)
 
static void Hex (Message &irMessage)
 
static void WideHex (Message &irMessage)
 
static void WideWideHex (Message &irMessage)
 

Static Public Attributes

static const SizeType MIN_SIZE
 

Friends

class PlacementPtr
 
class PlacementArrayPtr
 

Detailed Description

MBase::Message can be used as a regular variable, return value, or a C++ exception object.

The major features are:

  • chaining (along two axes)
  • inplace construction (as a single object or an array)
  • localization support
  • conservative memory usage

Member Typedef Documentation

◆ Manipulator

typedef void(* MBase::Message::Manipulator) (Message &irMessage)

◆ SizeType

typedef unsigned Int32 MBase::Message::SizeType

Constructor & Destructor Documentation

◆ Message() [1/3]

MBase::Message::Message ( )

◆ Message() [2/3]

MBase::Message::Message ( const Message irOther)

◆ Message() [3/3]

MBase::Message::Message ( MessageDomain  iDomain,
MessageID  iID,
const char *  ipTemplate = NULL 
)

◆ ~Message()

MBase::Message::~Message ( )
throw (
)

Member Function Documentation

◆ Clear()

void MBase::Message::Clear ( )

Erases all information, makes the message empty.

◆ Dec()

static void MBase::Message::Dec ( Message irMessage)
static

Format manipulators. Example:

lMessage << MBase::Message::Hex << hr;

◆ GetDomain()

MBase::MessageDomain MBase::Message::GetDomain ( ) const

Returns the resource bundle name that corresponds to the message domain.

◆ GetErrorCode()

unsigned Int32 MBase::Message::GetErrorCode ( ) const
throw (
)
inline

◆ GetID()

MBase::MessageID MBase::Message::GetID ( ) const

Returns the message ID.

◆ GetLocalizedText()

const char* MBase::Message::GetLocalizedText ( MBase::LanguageID  iLanguageID) const

Returns the message text for a particular language, or NULL if the text is not available.

◆ GetLowerLevelMessageOrNULL()

const Message* MBase::Message::GetLowerLevelMessageOrNULL ( ) const

Returns a pointer to a Message instance that represents a previous exception of a lower level or NULL.

◆ GetMessage()

const WCHAR* MBase::Message::GetMessage ( ) const
throw (
)

◆ GetParameter()

const char* MBase::Message::GetParameter ( unsigned int  iIndex) const

Used to iterate over a list of parameters. If parameter is not set, returns NULL.

◆ GetSameLevelMessageOrNULL()

const Message* MBase::Message::GetSameLevelMessageOrNULL ( ) const

Returns a pointer to a Message instance that represents a previous exception of the same level or NULL.

◆ GetTemplate()

const char* MBase::Message::GetTemplate ( ) const

Returns the default message template.

◆ Hex()

static void MBase::Message::Hex ( Message irMessage)
static

◆ IsEmpty()

bool MBase::Message::IsEmpty ( ) const

Returns true if message contains some fields.

◆ Localize()

MBase::ReturnString MBase::Message::Localize ( Localizer irLocalizer,
MBase::LanguageID  iLanguageID 
) const

Localize a single message. If the message already contains localized text for iLanguageID, the irLocalizer will not be called, and the stored text will be returned. Localize a single message. If the message already contains localized text for iLanguageID, the irLocalizer will not be called, and the stored text will be returned.

◆ operator<<() [1/8]

Message& MBase::Message::operator<< ( bool  iParameter)

Parameter formatting

◆ operator<<() [2/8]

Message& MBase::Message::operator<< ( int  iParameter)

◆ operator<<() [3/8]

Message& MBase::Message::operator<< ( unsigned int  iParameter)

◆ operator<<() [4/8]

Message& MBase::Message::operator<< ( long  iParameter)

◆ operator<<() [5/8]

Message& MBase::Message::operator<< ( unsigned long  iParameter)

◆ operator<<() [6/8]

Message& MBase::Message::operator<< ( const char *  ipParameter)

◆ operator<<() [7/8]

Message& MBase::Message::operator<< ( const WCHAR ipParameter)

◆ operator<<() [8/8]

Message& MBase::Message::operator<< ( Manipulator  ipManipulator)

◆ operator=()

Message& MBase::Message::operator= ( const Message irOther)

◆ PrependBy() [1/2]

Message& MBase::Message::PrependBy ( MessageDomain  iDomain,
MessageID  iID,
const char *  ipTemplate = NULL 
)

To chain the current message, so that it becomes the same-level message of the parameter. Note: when the message is blank (IsEmpty returns true), PrependBy behaves like a constructor.

◆ PrependBy() [2/2]

Message& MBase::Message::PrependBy ( const Message irMessage)

To chain the current message, so that it becomes the same-level message of the parameter. Note: when the message is blank (IsEmpty returns true), PrependBy behaves like a constructor.

◆ SetDomainAndID()

void MBase::Message::SetDomainAndID ( MBase::MessageDomain  iDomain,
MessageID  iID 
)

Sets the message ID and domain.

◆ SetLocalizedText()

void MBase::Message::SetLocalizedText ( MBase::LanguageID  iLanguageID,
const char *  ipText 
)

Stores the message text for a particular language. If ipText is NULL, the stored text is erased.

◆ SetMessage()

void MBase::Message::SetMessage ( const WCHAR ipMessage)
throw (
)

◆ SetTemplate()

void MBase::Message::SetTemplate ( const char *  ipTemplate)

◆ Swap()

bool MBase::Message::Swap ( Message irOther)
throw (
)

Swaps two message objects.

Returns
false if memory allocation was required, and failed.

◆ WideHex()

static void MBase::Message::WideHex ( Message irMessage)
static

◆ WideWideHex()

static void MBase::Message::WideWideHex ( Message irMessage)
static

◆ WrapBy()

Message& MBase::Message::WrapBy ( MessageDomain  iDomain,
MessageID  iID,
const char *  ipTemplate = NULL 
)

To chain the current message, so that it becomes the lower-level message of the parameter. Note: when the message is blank (IsEmpty returns true), WrapBy behaves like a constructor.

Friends And Related Function Documentation

◆ PlacementArrayPtr

friend class PlacementArrayPtr
friend

◆ PlacementPtr

friend class PlacementPtr
friend

Member Data Documentation

◆ MIN_SIZE

const SizeType MBase::Message::MIN_SIZE
static

Is the minimal size of a memory block, in which a Message can exist.

See also
MBase::Message::PlacementPtr
MBase::Message::PlacementArrayPtr