Allow public access to raw message object
There are certain cases where one would like to access the raw message
object under certain contexts. In general, these are contexts where
you need runtime access to the message type information, rather than
compile time template typing that the existing message object gives
you. It is still desirable to use the message object itself for
exception safety and RAII usage semantics.
Specifically, this came up when attempting to replicate the actions
interface in phosphor-rest, where types and conversions are determined
at runtime via introspect, and the type hierarchies are not known at
compile time.
Change-Id: I1e93af30992ffedbf470c1024eefe10cc5e21031
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
diff --git a/sdbusplus/message.hpp b/sdbusplus/message.hpp
index d6b5aa7..2c66d06 100644
--- a/sdbusplus/message.hpp
+++ b/sdbusplus/message.hpp
@@ -263,7 +263,10 @@
friend struct sdbusplus::bus::bus;
- /** @brief Get a pointer to the owned 'msgp_t'. */
+ /** @brief Get a pointer to the owned 'msgp_t'.
+ * This api should be used sparingly and carefully, as it opens a number of
+ * possibilities for race conditions, RAII destruction issues, and runtime
+ * problems when using the sd-bus c api. Here be dragons. */
msgp_t get()
{
return _msg.get();