Ocean
Ocean::MessageObject< tActive > Class Template Reference

Messenger object, one object for each message. More...

Public Types

using MessageType = Messenger::MessageType
 Re-definition of MessageType. More...
 

Public Member Functions

 MessageObject (const MessageType type)
 Creates a new message object. More...
 
 MessageObject (const MessageType type, std::string &&location)
 Creates a new message object. More...
 
 MessageObject (const MessageObject &messageObject)=default
 Copy-constructs a new message object. More...
 
 ~MessageObject ()
 Destructs a message object. More...
 
MessageObjectnewLine (const bool condition=true)
 Adds a new line to this message object if a specified condition holds. More...
 
MessageObjectoperator<< (std::string &&message)
 Pushes another information message. More...
 
MessageObjectoperator<< (const std::string &message)
 Pushes another information message. More...
 
MessageObjectoperator<< (const char *message)
 Pushes another information message. More...
 
MessageObjectoperator<< (const double message)
 Pushes another information message. More...
 
MessageObjectoperator<< (const float message)
 Pushes another information message. More...
 
MessageObjectoperator<< (const int message)
 Pushes another information message. More...
 
MessageObjectoperator<< (const unsigned int message)
 Pushes another information message. More...
 
MessageObjectoperator<< (const long message)
 Pushes another information message. More...
 
MessageObjectoperator<< (const long long message)
 Pushes another information message. More...
 
MessageObjectoperator<< (const unsigned long long message)
 Pushes another information message. More...
 
MessageObjectoperator<< (const long unsigned int message)
 Pushes another information message. More...
 
void operator<< (const MessageObject &message)
 Pushes another information message. More...
 
MessageObjectoperator= (const MessageObject &messageObject)=default
 Assign operator. More...
 

Protected Member Functions

 MessageObject (const MessageType type, std::string &&location, std::string &&message)
 Creates a new message object. More...
 

Protected Attributes

std::string message_
 Entire message. More...
 
std::string location_
 Location of the message. More...
 
Messenger::MessageType type_ = Messenger::TYPE_UNDEFINED
 Type of this messenger. More...
 

Detailed Description

template<bool tActive>
class Ocean::MessageObject< tActive >

Messenger object, one object for each message.

This class is a helper class only, therefore there is no need to use it directly.

Template Parameters
tActiveTrue, if the message object is active; False, e.g., on builds in which messages must not appear in binary files
See also
Messenger.

Member Typedef Documentation

◆ MessageType

template<bool tActive>
using Ocean::MessageObject< tActive >::MessageType = Messenger::MessageType

Re-definition of MessageType.

Constructor & Destructor Documentation

◆ MessageObject() [1/4]

template<bool tActive>
Ocean::MessageObject< tActive >::MessageObject ( const MessageType  type)
inlineexplicit

Creates a new message object.

Parameters
typeThe type of the message object

◆ MessageObject() [2/4]

template<bool tActive>
Ocean::MessageObject< tActive >::MessageObject ( const MessageType  type,
std::string &&  location 
)
inline

Creates a new message object.

Parameters
typeThe type of the message object
locationThe location of the message

◆ MessageObject() [3/4]

template<bool tActive>
Ocean::MessageObject< tActive >::MessageObject ( const MessageObject< tActive > &  messageObject)
default

Copy-constructs a new message object.

Parameters
messageObjectAnother instance that will be used to create this instance, must be valid

◆ ~MessageObject()

template<bool tActive>
Ocean::MessageObject< tActive >::~MessageObject
inline

Destructs a message object.

◆ MessageObject() [4/4]

template<bool tActive>
Ocean::MessageObject< tActive >::MessageObject ( const MessageType  type,
std::string &&  location,
std::string &&  message 
)
inlineprotected

Creates a new message object.

Parameters
typeThe type of the message object
locationThe location of the message object
messageThe message of the object

Member Function Documentation

◆ newLine()

template<bool tActive>
MessageObject< tActive > & Ocean::MessageObject< tActive >::newLine ( const bool  condition = true)
inline

Adds a new line to this message object if a specified condition holds.

Parameters
conditionTrue, to add the line; False, to do nothing
Returns
Reference to this object

◆ operator<<() [1/12]

template<bool tActive>
MessageObject< tActive > & Ocean::MessageObject< tActive >::operator<< ( const char *  message)
inline

Pushes another information message.

Parameters
messageThe message to push
Returns
Reference to this object

◆ operator<<() [2/12]

template<bool tActive>
MessageObject< tActive > & Ocean::MessageObject< tActive >::operator<< ( const double  message)
inline

Pushes another information message.

Parameters
messageThe message to push
Returns
Reference to this object

◆ operator<<() [3/12]

template<bool tActive>
MessageObject< tActive > & Ocean::MessageObject< tActive >::operator<< ( const float  message)
inline

Pushes another information message.

Parameters
messageThe message to push
Returns
Reference to this object

◆ operator<<() [4/12]

template<bool tActive>
MessageObject< tActive > & Ocean::MessageObject< tActive >::operator<< ( const int  message)
inline

Pushes another information message.

Parameters
messageThe message to push
Returns
Reference to this object

◆ operator<<() [5/12]

template<bool tActive>
MessageObject< tActive > & Ocean::MessageObject< tActive >::operator<< ( const long long  message)
inline

Pushes another information message.

Parameters
messageThe message to push
Returns
Reference to this object

◆ operator<<() [6/12]

template<bool tActive>
MessageObject< tActive > & Ocean::MessageObject< tActive >::operator<< ( const long  message)
inline

Pushes another information message.

Parameters
messageThe message to push
Returns
Reference to this object

◆ operator<<() [7/12]

template<bool tActive>
MessageObject< tActive > & Ocean::MessageObject< tActive >::operator<< ( const long unsigned int  message)
inline

Pushes another information message.

Parameters
messageThe message to push
Returns
Reference to this object

◆ operator<<() [8/12]

template<bool tActive>
void Ocean::MessageObject< tActive >::operator<< ( const MessageObject< tActive > &  message)
inline

Pushes another information message.

Parameters
messageThe message to push

◆ operator<<() [9/12]

template<bool tActive>
MessageObject< tActive > & Ocean::MessageObject< tActive >::operator<< ( const std::string &  message)
inline

Pushes another information message.

Parameters
messageThe message to push
Returns
Reference to this object

◆ operator<<() [10/12]

template<bool tActive>
MessageObject< tActive > & Ocean::MessageObject< tActive >::operator<< ( const unsigned int  message)
inline

Pushes another information message.

Parameters
messageThe message to push
Returns
Reference to this object

◆ operator<<() [11/12]

template<bool tActive>
MessageObject< tActive > & Ocean::MessageObject< tActive >::operator<< ( const unsigned long long  message)
inline

Pushes another information message.

Parameters
messageThe message to push
Returns
Reference to this object

◆ operator<<() [12/12]

template<bool tActive>
MessageObject< tActive > & Ocean::MessageObject< tActive >::operator<< ( std::string &&  message)
inline

Pushes another information message.

Parameters
messageThe message to push
Returns
Reference to this object

◆ operator=()

template<bool tActive>
MessageObject& Ocean::MessageObject< tActive >::operator= ( const MessageObject< tActive > &  messageObject)
default

Assign operator.

Parameters
messageObjectAnother instance that will assigned to this instance, must be valid

Field Documentation

◆ location_

template<bool tActive>
std::string Ocean::MessageObject< tActive >::location_
protected

Location of the message.

◆ message_

template<bool tActive>
std::string Ocean::MessageObject< tActive >::message_
protected

Entire message.

◆ type_

template<bool tActive>
Messenger::MessageType Ocean::MessageObject< tActive >::type_ = Messenger::TYPE_UNDEFINED
protected

Type of this messenger.


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