dbus-cxx
sendmsgtransport.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later OR BSD-3-Clause
2/***************************************************************************
3 * Copyright (C) 2020 by Robert Middleton *
4 * robert.middleton@rm5248.com *
5 * *
6 * This file is part of the dbus-cxx library. *
7 ***************************************************************************/
8
9#ifndef DBUS_CXX_SENDMSGTRANSPORT_H
10#define DBUS_CXX_SENDMSGTRANSPORT_H
11
12#include <dbus-cxx/dbus-cxx-config.h>
13#include <memory>
14#include <vector>
15#include <stdint.h>
16#include "transport.h"
17
18namespace DBus {
19
20class Message;
21
22namespace priv {
23
29private:
30 SendmsgTransport( int fd, bool initialize );
31
32public:
34
44 static std::shared_ptr<SendmsgTransport> create( int fd, bool initialize );
45
46 ssize_t writeMessage( std::shared_ptr<const Message> message, uint32_t serial );
47
48 std::shared_ptr<Message> readMessage();
49
54 bool is_valid() const;
55
56 int fd() const;
57
58private:
59 void purgeData();
60
61private:
62 class priv_data;
63
64 DBUS_CXX_PROPAGATE_CONST( std::unique_ptr<priv_data> ) m_priv;
65};
66
67} /* namespace priv */
68
69} /* namespace DBus */
70
71#endif /* DBUS_CXX_SENDMSGTRANSPORT_H */
The Sendmsg handles reading and writing over a Unix FD that supports sendmsg().
Definition: sendmsgtransport.h:28
bool is_valid() const
Check if this transport is OK.
Definition: sendmsgtransport.cpp:453
~SendmsgTransport()
Definition: sendmsgtransport.cpp:256
SendmsgTransport(int fd, bool initialize)
Definition: sendmsgtransport.cpp:230
ssize_t writeMessage(std::shared_ptr< const Message > message, uint32_t serial)
Definition: sendmsgtransport.cpp:264
DBUS_CXX_PROPAGATE_CONST(std::unique_ptr< priv_data >) m_priv
int fd() const
Definition: sendmsgtransport.cpp:457
static std::shared_ptr< SendmsgTransport > create(int fd, bool initialize)
Create a SendmsgTransport.
Definition: sendmsgtransport.cpp:260
std::shared_ptr< Message > readMessage()
Definition: sendmsgtransport.cpp:349
void purgeData()
Definition: sendmsgtransport.cpp:461
Definition: transport.h:22
Global DBus namespace, where everything happens.
Definition: callmessage.cpp:18