~thomas-voss/dbus-cpp/add_support_for_get_connection_app_armor_security_context

« back to all changes in this revision

Viewing changes to src/core/dbus/message_factory_impl.h

  • Committer: Tarmac
  • Author(s): thomas-voss, Thomas Voß
  • Date: 2013-12-12 13:25:20 UTC
  • mfrom: (11.2.42 dbus-cpp-refactoring)
  • Revision ID: tarmac-20131212132520-gi9pig97oo57tke5
 * Add introspect function to autogenerated protocol header files.
 * Add a code generator for protocol header files.
 * Split up files and move the boost::asio executor implementation into src.
 * Force definitions inline.

Approved by Timo Jyrinki, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright © 2012 Canonical Ltd.
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify it
 
5
 * under the terms of the GNU Lesser General Public License version 3,
 
6
 * as published by the Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU Lesser General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU Lesser General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 *
 
16
 * Authored by: Thomas Voß <thomas.voss@canonical.com>
 
17
 */
 
18
#ifndef CORE_DBUS_MESSAGE_FACTORY_IMPL_H_
 
19
#define CORE_DBUS_MESSAGE_FACTORY_IMPL_H_
 
20
 
 
21
#include <core/dbus/message_factory.h>
 
22
 
 
23
namespace core
 
24
{
 
25
namespace dbus
 
26
{
 
27
namespace impl
 
28
{
 
29
struct MessageFactory : public core::dbus::MessageFactory
 
30
{
 
31
    MessageFactory() = default;
 
32
 
 
33
    inline std::shared_ptr<Message> make_method_call(
 
34
            const std::string& destination,
 
35
            const types::ObjectPath& path,
 
36
            const std::string& interface,
 
37
            const std::string& method)
 
38
    {
 
39
        return Message::make_method_call(destination, path, interface, method);
 
40
    }
 
41
 
 
42
    inline std::shared_ptr<Message> make_method_return(const Message::Ptr& msg)
 
43
    {
 
44
        return Message::make_method_return(msg);
 
45
    }
 
46
 
 
47
    inline std::shared_ptr<Message> make_signal(
 
48
            const std::string& path,
 
49
            const std::string& interface,
 
50
            const std::string& signal)
 
51
    {
 
52
        return Message::make_signal(path, interface, signal);
 
53
    }
 
54
 
 
55
    inline std::shared_ptr<Message> make_error(
 
56
            const Message::Ptr& in_reply_to,
 
57
            const std::string& error_name,
 
58
            const std::string& error_desc)
 
59
    {
 
60
        return Message::make_error(in_reply_to, error_name, error_desc);
 
61
    }
 
62
};
 
63
}
 
64
}
 
65
}
 
66
 
 
67
#endif // CORE_DBUS_MESSAGE_FACTORY_H_