Convert rtems-record-lttng program to C++

Chris Johns chrisj at rtems.org
Sun Sep 1 02:46:05 UTC 2019


On 31/8/19 5:29 am, Sebastian Huber wrote:
> attached are two patches which convert the rtems-record-lttng client program from C to C++.

Is this a step to a full C++ app?

The following are some observations about the C++ piece of code...

Why in this code ..

+
+#include <rtems/recordclient.h>
+#include <rtems/recorddata.h>
+
+#include <assert.h>
+#include <fcntl.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include <arpa/inet.h>
+#include <netinet/in.h>
+
+#include <csignal>
+#include <cstring>
+
+#ifndef RTEMS_TOOLS_TRACE_RECORD_CLIENT_H_
+#define RTEMS_TOOLS_TRACE_RECORD_CLIENT_H_
+

are the includes not protected as well? I think the inlines in Client are too
big and would be better in a .cc or .cpp file. Why use an assert when you can
throw an exception?


Chris



More information about the devel mailing list