Google Cloud Pub/Sub C++ Client 2.13.0
A C++ Client Library for Google Cloud Pub/Sub
Loading...
Searching...
No Matches
Friends | List of all members
google::cloud::pubsub::Message Class Reference

The C++ representation for a Cloud Pub/Sub messages. More...

#include <google/cloud/pubsub/message.h>

Public Member Functions

accessors
PubsubMessageDataType const & data () const &
 
PubsubMessageDataType && data () &&
 
std::string const & message_id () const
 
std::string const & ordering_key () const
 
std::chrono::system_clock::time_point publish_time () const
 
std::map< std::string, std::string > attributes () const
 
Copy and move
 Message (Message const &)=default
 
Messageoperator= (Message const &)=default
 
 Message (Message &&)=default
 
Messageoperator= (Message &&)=default
 

Friends

class MessageBuilder
 Construct Message objects. More...
 
std::ostream & operator<< (std::ostream &os, Message const &rhs)
 Output in protobuf format, this is intended for debugging. More...
 
Equality operators

Compares two messages.

bool operator== (Message const &a, Message const &b)
 Compares two messages. More...
 
bool operator!= (Message const &a, Message const &b)
 Compares two messages. More...
 

Detailed Description

The C++ representation for a Cloud Pub/Sub messages.

Cloud Pub/Sub applications communicate to each other using messages. Note that messages must provide at least some data or some attributes. Use MessageBuilder to create instances of this class.

Constructor & Destructor Documentation

◆ Message() [1/2]

google::cloud::pubsub::Message::Message ( Message const &  )
default

◆ Message() [2/2]

google::cloud::pubsub::Message::Message ( Message &&  )
default

Member Function Documentation

◆ attributes()

std::map< std::string, std::string > google::cloud::pubsub::Message::attributes ( ) const
inline

◆ data() [1/2]

PubsubMessageDataType && google::cloud::pubsub::Message::data ( ) &&
inline

◆ data() [2/2]

PubsubMessageDataType const & google::cloud::pubsub::Message::data ( ) const &
inline

◆ message_id()

std::string const & google::cloud::pubsub::Message::message_id ( ) const
inline

◆ operator=() [1/2]

Message & google::cloud::pubsub::Message::operator= ( Message &&  )
default

◆ operator=() [2/2]

Message & google::cloud::pubsub::Message::operator= ( Message const &  )
default

◆ ordering_key()

std::string const & google::cloud::pubsub::Message::ordering_key ( ) const
inline

◆ publish_time()

std::chrono::system_clock::time_point google::cloud::pubsub::Message::publish_time ( ) const

Friends And Related Function Documentation

◆ MessageBuilder

friend class MessageBuilder
friend

Construct Message objects.

◆ operator!=

bool operator!= ( Message const &  a,
Message const &  b 
)
friend

Compares two messages.

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
Message const &  rhs 
)
friend

Output in protobuf format, this is intended for debugging.

◆ operator==

bool operator== ( Message const &  a,
Message const &  b 
)
friend

Compares two messages.