Google Cloud Pub/Sub C++ Client  1.32.1
A C++ Client Library for Google Cloud Pub/Sub
Public Member Functions | List of all members
google::cloud::pubsub::v1::Topic Class Reference

Objects of this class identify a Cloud Pub/Sub topic. More...

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

Public Member Functions

 Topic (std::string project_id, std::string topic_id)
 
Copy and move
 Topic (Topic const &)=default
 Returns the Project ID. More...
 
Topicoperator= (Topic const &)=default
 Returns the Project ID. More...
 
 Topic (Topic &&)=default
 Returns the Project ID. More...
 
Topicoperator= (Topic &&)=default
 Returns the Project ID. More...
 
std::string const & project_id () const
 Returns the Project ID. More...
 
std::string const & topic_id () const
 Returns the Topic ID. More...
 
std::string FullName () const
 Returns the fully qualified topic name as a string of the form: "projects/<project-id>/topics/<topic-id>". More...
 

Equality operators

bool operator== (Topic const &a, Topic const &b)
 Output the FullName() format. More...
 
bool operator!= (Topic const &a, Topic const &b)
 Output the FullName() format. More...
 
std::ostream & operator<< (std::ostream &os, Topic const &rhs)
 Output the FullName() format. More...
 

Detailed Description

Objects of this class identify a Cloud Pub/Sub topic.

Note
This class makes no effort to validate the ids provided. The application should verify that any ids passed to this application conform to the Cloud Pub/Sub resource name restrictions.

Definition at line 37 of file topic.h.

Constructor & Destructor Documentation

◆ Topic() [1/3]

google::cloud::pubsub::v1::Topic::Topic ( std::string  project_id,
std::string  topic_id 
)
inline

Definition at line 39 of file topic.h.

◆ Topic() [2/3]

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

Returns the Project ID.

◆ Topic() [3/3]

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

Returns the Project ID.

Member Function Documentation

◆ FullName()

std::string google::cloud::pubsub::v1::Topic::FullName ( ) const

Returns the fully qualified topic name as a string of the form: "projects/<project-id>/topics/<topic-id>".

Definition at line 22 of file topic.cc.

◆ operator=() [1/2]

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

Returns the Project ID.

◆ operator=() [2/2]

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

Returns the Project ID.

◆ project_id()

std::string const& google::cloud::pubsub::v1::Topic::project_id ( ) const
inline

Returns the Project ID.

Definition at line 51 of file topic.h.

◆ topic_id()

std::string const& google::cloud::pubsub::v1::Topic::topic_id ( ) const
inline

Returns the Topic ID.

Definition at line 54 of file topic.h.

Friends And Related Function Documentation

◆ operator!=

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

Output the FullName() format.

Definition at line 65 of file topic.h.

◆ operator<<

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

Output the FullName() format.

Definition at line 30 of file topic.cc.

◆ operator==

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

Output the FullName() format.

Definition at line 26 of file topic.cc.