Google Cloud Pub/Sub C++ Client  1.32.1
A C++ Client Library for Google Cloud Pub/Sub
List of all members
google::cloud::pubsub::v1::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
 

Equality operators

Compares two messages.

class MessageBuilder
 Construct Message objects. More...
 
bool operator== (Message const &a, Message const &b)
 Construct Message objects. More...
 
bool operator!= (Message const &a, Message const &b)
 Compares two messages. More...
 
std::ostream & operator<< (std::ostream &os, Message const &rhs)
 Output in protobuf format, this is intended for debugging. 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.

Definition at line 78 of file message.h.

Constructor & Destructor Documentation

◆ Message() [1/2]

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

◆ Message() [2/2]

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

Member Function Documentation

◆ attributes()

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

Definition at line 89 of file message.h.

◆ data() [1/2]

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

Definition at line 83 of file message.h.

◆ data() [2/2]

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

Definition at line 82 of file message.h.

◆ message_id()

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

Definition at line 86 of file message.h.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ ordering_key()

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

Definition at line 87 of file message.h.

◆ publish_time()

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

Definition at line 42 of file message.cc.

Friends And Related Function Documentation

◆ MessageBuilder

friend class MessageBuilder
friend

Construct Message objects.

Definition at line 129 of file message.h.

◆ operator!=

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

Compares two messages.

Definition at line 111 of file message.h.

◆ operator<<

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

Output in protobuf format, this is intended for debugging.

Definition at line 55 of file message.cc.

◆ operator==

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

Construct Message objects.

Definition at line 50 of file message.cc.