multiplereturn.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) 2022 by Christopher Schimp *
4  * silverchris@gmail.com *
5  * *
6  * This file is part of the dbus-cxx library. *
7  ***************************************************************************/
8 #ifndef DBUSCXX_MULTIPLERETURN_H
9 #define DBUSCXX_MULTIPLERETURN_H
10 
11 #include <dbus-cxx/enums.h>
12 #include <dbus-cxx/path.h>
13 #include <dbus-cxx/signature.h>
15 #include <dbus-cxx/marshaling.h>
16 #include <dbus-cxx/types.h>
17 #include <dbus-cxx/error.h>
18 #include <string>
19 #include <cstdint>
20 #include <ostream>
21 #include <tuple>
23 
24 namespace DBus {
25 
26  class MessageIterator;
27 
28  template<typename... Ts>
30  public:
31  std::tuple<Ts...> m_data;
32 
33  public:
34  MultipleReturn()= default;
35 
36  explicit MultipleReturn(Ts... args) {
37  m_data = std::make_tuple(std::ref(args)...);
38  };
39 
40  bool operator==(const MultipleReturn &other) const {
41  return m_data == other.m_data;
42  }
43 
45  m_data = other.m_data;
46  return *this;
47  }
48 
49  private:
50  friend class MessageAppendIterator;
51  friend class MessageIterator;
52  };
53 
54 }
55 #endif
Insertion iterator allow values to be appended to a message.
Definition: messageappenditerator.h:38
Extraction iterator allowing values to be retrieved from a message.
Definition: messageiterator.h:56
Definition: multiplereturn.h:29
std::tuple< Ts... > m_data
Definition: multiplereturn.h:31
MultipleReturn(Ts... args)
Definition: multiplereturn.h:36
MultipleReturn()=default
bool operator==(const MultipleReturn &other) const
Definition: multiplereturn.h:40
MultipleReturn & operator=(const MultipleReturn &other)
Definition: multiplereturn.h:44
Global DBus namespace, where everything happens.
Definition: callmessage.cpp:18