2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
23 class CApplicationMessenger
;
27 friend CApplicationMessenger
;
30 : ThreadMessage
{ 0, -1, -1, nullptr }
34 explicit ThreadMessage(uint32_t messageId
)
35 : ThreadMessage
{ messageId
, -1, -1, nullptr }
39 ThreadMessage(uint32_t messageId
, int64_t p3
)
40 : ThreadMessage
{ messageId
, -1, -1, nullptr, p3
}
44 ThreadMessage(uint32_t messageId
, int p1
, int p2
, void* payload
, int64_t p3
= 0)
45 : dwMessage
{ messageId
}
53 ThreadMessage(uint32_t messageId
,
58 std::vector
<std::string
> vecParams
)
59 : dwMessage
{messageId
},
64 strParam(std::move(param
)),
65 params(std::move(vecParams
))
69 ThreadMessage(const ThreadMessage
& other
) = default;
71 ThreadMessage(ThreadMessage
&& other
) noexcept
72 : dwMessage(other
.dwMessage
),
77 strParam(std::move(other
.strParam
)),
78 params(std::move(other
.params
)),
79 waitEvent(std::move(other
.waitEvent
)),
80 result(std::move(other
.result
))
84 ThreadMessage
& operator=(const ThreadMessage
& other
)
88 dwMessage
= other
.dwMessage
;
89 param1
= other
.param1
;
90 param2
= other
.param2
;
91 param3
= other
.param3
;
92 lpVoid
= other
.lpVoid
;
93 strParam
= other
.strParam
;
94 params
= other
.params
;
95 waitEvent
= other
.waitEvent
;
96 result
= other
.result
;
100 ThreadMessage
& operator=(ThreadMessage
&& other
) noexcept
104 dwMessage
= other
.dwMessage
;
105 param1
= other
.param1
;
106 param2
= other
.param2
;
107 param3
= other
.param3
;
108 lpVoid
= other
.lpVoid
;
109 strParam
= std::move(other
.strParam
);
110 params
= std::move(other
.params
);
111 waitEvent
= std::move(other
.waitEvent
);
112 result
= std::move(other
.result
);
121 std::string strParam
;
122 std::vector
<std::string
> params
;
125 * \brief set the message return value, will only be returned when
126 * the message is sent using SendMsg
127 * \param [in] res the return value or a result status code that is returned to the caller
129 void SetResult(int res
) const
131 //On posted messages result will be zero, since they can't
132 //retrieve the response we silently ignore this to let message
133 //handlers not have to worry about it
138 std::shared_ptr
<CEvent
> waitEvent
;
139 std::shared_ptr
<int> result
;