summaryrefslogtreecommitdiff
path: root/libs/interprocess/test/get_process_id_name.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/interprocess/test/get_process_id_name.hpp')
-rw-r--r--libs/interprocess/test/get_process_id_name.hpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/libs/interprocess/test/get_process_id_name.hpp b/libs/interprocess/test/get_process_id_name.hpp
index afc28031ce..4e495258e8 100644
--- a/libs/interprocess/test/get_process_id_name.hpp
+++ b/libs/interprocess/test/get_process_id_name.hpp
@@ -27,6 +27,13 @@ inline void get_process_id_name(std::string &str)
str = sstr.str().c_str();
}
+inline void get_process_id_ptr_name(std::string &str, const void *ptr)
+{
+ std::stringstream sstr;
+ sstr << "process_" << boost::interprocess::ipcdetail::get_current_process_id() << "_" << ptr << std::ends;
+ str = sstr.str().c_str();
+}
+
inline const char *get_process_id_name()
{
static std::string str;
@@ -34,6 +41,13 @@ inline const char *get_process_id_name()
return str.c_str();
}
+inline const char *get_process_id_ptr_name(void *ptr)
+{
+ static std::string str;
+ get_process_id_ptr_name(str, ptr);
+ return str.c_str();
+}
+
inline const char *add_to_process_id_name(const char *name)
{
static std::string str;
@@ -42,6 +56,14 @@ inline const char *add_to_process_id_name(const char *name)
return str.c_str();
}
+inline const char *add_to_process_id_ptr_name(const char *name, void *ptr)
+{
+ static std::string str;
+ get_process_id_ptr_name(str, ptr);
+ str += name;
+ return str.c_str();
+}
+
} //namespace test{
} //namespace interprocess{
} //namespace boost{