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 
13 #include <memory>
14 #include <vector>
15 #include <stdint.h>
16 #include "transport.h"
17 
18 namespace DBus {
19 
20 class Message;
21 
22 namespace priv {
23 
28 class SendmsgTransport : public Transport {
29 private:
30  SendmsgTransport( int fd, bool initialize );
31 
32 public:
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 
58 private:
59  void purgeData();
60 
61 private:
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:448
~SendmsgTransport()
Definition: sendmsgtransport.cpp:253
SendmsgTransport(int fd, bool initialize)
Definition: sendmsgtransport.cpp:227
ssize_t writeMessage(std::shared_ptr< const Message > message, uint32_t serial)
Definition: sendmsgtransport.cpp:261
DBUS_CXX_PROPAGATE_CONST(std::unique_ptr< priv_data >) m_priv
int fd() const
Definition: sendmsgtransport.cpp:452
static std::shared_ptr< SendmsgTransport > create(int fd, bool initialize)
Create a SendmsgTransport.
Definition: sendmsgtransport.cpp:257
std::shared_ptr< Message > readMessage()
Definition: sendmsgtransport.cpp:344
void purgeData()
Definition: sendmsgtransport.cpp:456
Definition: transport.h:22
Global DBus namespace, where everything happens.
Definition: callmessage.cpp:18