DBus::priv::Transport Class Referenceabstract

#include <transport.h>

Inheritance diagram for DBus::priv::Transport:

Public Member Functions

virtual ~Transport ()
 
virtual ssize_t writeMessage (std::shared_ptr< const Message > message, uint32_t serial)=0
 Writes a message to the transport stream. More...
 
virtual std::shared_ptr< MessagereadMessage ()=0
 Read a message from the transport stream. More...
 
virtual bool is_valid () const =0
 Check to see if this transport is valid. More...
 
virtual int fd () const =0
 Returns the file descriptor that this transport acts on. More...
 

Static Public Member Functions

static std::shared_ptr< Transportopen_transport (std::string address)
 Open and return a transport based off of the given address. More...
 

Protected Attributes

std::vector< uint8_t > m_serverAddress
 

Constructor & Destructor Documentation

◆ ~Transport()

Transport::~Transport ( )
virtual

Member Function Documentation

◆ fd()

virtual int DBus::priv::Transport::fd ( ) const
pure virtual

Returns the file descriptor that this transport acts on.

Returns

Implemented in DBus::priv::SimpleTransport, and DBus::priv::SendmsgTransport.

Referenced by open_transport().

◆ is_valid()

virtual bool DBus::priv::Transport::is_valid ( ) const
pure virtual

Check to see if this transport is valid.

Returns

Implemented in DBus::priv::SimpleTransport, and DBus::priv::SendmsgTransport.

◆ open_transport()

std::shared_ptr< Transport > Transport::open_transport ( std::string  address)
static

Open and return a transport based off of the given address.

Parameters
addressThe address to connect to, in DBus transport format (e.g. unix:path=/tmp/dbus-test)
Returns
An opened file descriptor, or -1 on error(with errno set)

References DBus::priv::SASL::authenticate(), DBus::priv::SendmsgTransport::create(), fd(), LOGGER_NAME, open_unix_socket(), parseTransports(), and SIMPLELOGGER_DEBUG.

Referenced by DBus::Connection::Connection().

◆ readMessage()

virtual std::shared_ptr<Message> DBus::priv::Transport::readMessage ( )
pure virtual

Read a message from the transport stream.

If there is no message to be read, or there is not enough data to read a message yet, returns a default-constructed message.

Returns

Implemented in DBus::priv::SimpleTransport, and DBus::priv::SendmsgTransport.

◆ writeMessage()

virtual ssize_t DBus::priv::Transport::writeMessage ( std::shared_ptr< const Message message,
uint32_t  serial 
)
pure virtual

Writes a message to the transport stream.

Parameters
messageThe message to write
serialThe serial of the message to write.
Returns
The number of bytes written on success, an error code otherwise.

Implemented in DBus::priv::SimpleTransport, and DBus::priv::SendmsgTransport.

Member Data Documentation

◆ m_serverAddress

std::vector<uint8_t> DBus::priv::Transport::m_serverAddress
protected

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