UMPS
The University of Utah Seismograph Stations Message Passing System.
UMPS::MessageFormats::Messages Class Reference

This is a container for holding multiple (unique) message formats. More...

#include "umps/messageFormats/messages.hpp"

Public Member Functions

void add (const std::unique_ptr< IMessage > &message)
 Add the message type to the container. More...
 
bool contains (const IMessage &message) const noexcept
 
bool contains (const std::unique_ptr< IMessage > &message) const
 
bool contains (const std::string &messageType) const noexcept
 
void remove (const std::unique_ptr< IMessage > &message)
 Removes the message. More...
 
void remove (const std::string &messageType)
 
int size () const noexcept
 
bool empty () const noexcept
 
std::map< std::string, std::unique_ptr< IMessage > > get () const noexcept
 
std::unique_ptr< IMessageget (const std::string &messageType) const
 
Constructors
 Messages ()
 Constructor.
 
 Messages (const Messages &messages)
 Copy constructor. More...
 
 Messages (Messages &&messages) noexcept
 Move constructor. More...
 
Operators
Messagesoperator= (const Messages &messages)
 Copy assignment operator. More...
 
Messagesoperator= (Messages &&messages) noexcept
 Move assignment operator. More...
 
Destructors
void clear () noexcept
 Resets the class and releases all memory.
 
 ~Messages ()
 Destructor.
 

Detailed Description

This is a container for holding multiple (unique) message formats.

Constructor & Destructor Documentation

◆ Messages() [1/2]

UMPS::MessageFormats::Messages::Messages ( const Messages messages)

Copy constructor.

Parameters
[in]messagesThe messages container from which to initialize this class.

◆ Messages() [2/2]

UMPS::MessageFormats::Messages::Messages ( Messages &&  messages)
noexcept

Move constructor.

Parameters
[in,out]messagesThe messages container from which to initialize this class. On exit, messages's behavior is undefined.

Member Function Documentation

◆ add()

void UMPS::MessageFormats::Messages::add ( const std::unique_ptr< IMessage > &  message)

Add the message type to the container.

Parameters
[in]messageThe message to add to the container.
Exceptions
std::invalid_argumentif the message type already exists.

◆ contains() [1/3]

bool UMPS::MessageFormats::Messages::contains ( const IMessage message) const
noexcept
Parameters
[in]messageDetermines if the message is set by calling contains(getMessageType()).
Returns
True indicates the message type exists.

◆ contains() [2/3]

bool UMPS::MessageFormats::Messages::contains ( const std::string &  messageType) const
noexcept
Parameters
[in]messageTypeThe name of the message type.
Returns
True indicates the message type exists.

◆ contains() [3/3]

bool UMPS::MessageFormats::Messages::contains ( const std::unique_ptr< IMessage > &  message) const
Parameters
[in]messageDetermines if the message is set by calling contains(getMessageType()).
Returns
True indicates the message type exists.
Exceptions
std::invalid_argumentif the message is NULL.

◆ empty()

bool UMPS::MessageFormats::Messages::empty ( ) const
noexcept
Returns
True indicates there are no messages.

◆ get() [1/2]

std::map<std::string, std::unique_ptr<IMessage> > UMPS::MessageFormats::Messages::get ( ) const
noexcept
Returns
All the message types in this container.

◆ get() [2/2]

std::unique_ptr<IMessage> UMPS::MessageFormats::Messages::get ( const std::string &  messageType) const
Returns
The message container corresponding to the message type,

◆ operator=() [1/2]

Messages& UMPS::MessageFormats::Messages::operator= ( const Messages messages)

Copy assignment operator.

Parameters
[in]messagesThe messages container to copy to this.
Returns
A deep copy of the input messages container.

◆ operator=() [2/2]

Messages& UMPS::MessageFormats::Messages::operator= ( Messages &&  messages)
noexcept

Move assignment operator.

Parameters
[in,out]messagesThe messages container whose memory will be moved to this. On exit, messageses's behavior is undefined.

◆ remove() [1/2]

void UMPS::MessageFormats::Messages::remove ( const std::string &  messageType)
Parameters
[in]messageTypeThe name of the message type to remove.
Exceptions
std::runtime_errorif contains(messageType) is false.

◆ remove() [2/2]

void UMPS::MessageFormats::Messages::remove ( const std::unique_ptr< IMessage > &  message)

Removes the message.

Exceptions
std::invalid_argumentif the message is NULL.

◆ size()

int UMPS::MessageFormats::Messages::size ( ) const
noexcept
Returns
The number of message formats.

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