kitt_platform
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Macros
GetLoggers.h
Go to the documentation of this file.
1 #ifndef _ROS_SERVICE_GetLoggers_h
2 #define _ROS_SERVICE_GetLoggers_h
3 #include <stdint.h>
4 #include <string.h>
5 #include <stdlib.h>
6 #include "ros/msg.h"
7 #include "roscpp/Logger.h"
8 
9 namespace roscpp
10 {
11 
12 static const char GETLOGGERS[] = "roscpp/GetLoggers";
13 
14  class GetLoggersRequest : public ros::Msg
15  {
16  public:
17 
19  {
20  }
21 
22  virtual int serialize(unsigned char *outbuffer) const
23  {
24  int offset = 0;
25  return offset;
26  }
27 
28  virtual int deserialize(unsigned char *inbuffer)
29  {
30  int offset = 0;
31  return offset;
32  }
33 
34  const char * getType(){ return GETLOGGERS; };
35  const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; };
36 
37  };
38 
40  {
41  public:
42  uint8_t loggers_length;
45 
47  loggers_length(0), loggers(NULL)
48  {
49  }
50 
51  virtual int serialize(unsigned char *outbuffer) const
52  {
53  int offset = 0;
54  *(outbuffer + offset++) = loggers_length;
55  *(outbuffer + offset++) = 0;
56  *(outbuffer + offset++) = 0;
57  *(outbuffer + offset++) = 0;
58  for( uint8_t i = 0; i < loggers_length; i++){
59  offset += this->loggers[i].serialize(outbuffer + offset);
60  }
61  return offset;
62  }
63 
64  virtual int deserialize(unsigned char *inbuffer)
65  {
66  int offset = 0;
67  uint8_t loggers_lengthT = *(inbuffer + offset++);
68  if(loggers_lengthT > loggers_length)
69  this->loggers = (roscpp::Logger*)realloc(this->loggers, loggers_lengthT * sizeof(roscpp::Logger));
70  offset += 3;
71  loggers_length = loggers_lengthT;
72  for( uint8_t i = 0; i < loggers_length; i++){
73  offset += this->st_loggers.deserialize(inbuffer + offset);
74  memcpy( &(this->loggers[i]), &(this->st_loggers), sizeof(roscpp::Logger));
75  }
76  return offset;
77  }
78 
79  const char * getType(){ return GETLOGGERS; };
80  const char * getMD5(){ return "32e97e85527d4678a8f9279894bb64b0"; };
81 
82  };
83 
84  class GetLoggers {
85  public:
88  };
89 
90 }
91 #endif
Definition: Logger.h:12
const char * getMD5()
Definition: GetLoggers.h:80
GetLoggersResponse()
Definition: GetLoggers.h:46
const char * getMD5()
Definition: GetLoggers.h:35
Definition: GetLoggers.h:39
const char * getType()
Definition: GetLoggers.h:79
roscpp::Logger * loggers
Definition: GetLoggers.h:44
static const char GETLOGGERS[]
Definition: GetLoggers.h:12
virtual int serialize(unsigned char *outbuffer) const
Definition: Logger.h:24
virtual int serialize(unsigned char *outbuffer) const
Definition: GetLoggers.h:51
virtual int serialize(unsigned char *outbuffer) const
Definition: GetLoggers.h:22
roscpp::Logger st_loggers
Definition: GetLoggers.h:43
const char * getType()
Definition: GetLoggers.h:34
virtual int deserialize(unsigned char *inbuffer)
Definition: GetLoggers.h:64
Definition: GetLoggers.h:84
Definition: GetLoggers.h:14
uint8_t loggers_length
Definition: GetLoggers.h:42
GetLoggersRequest()
Definition: GetLoggers.h:18
virtual int deserialize(unsigned char *inbuffer)
Definition: Logger.h:40
GetLoggersRequest Request
Definition: GetLoggers.h:86
Definition: msg.h:43
GetLoggersResponse Response
Definition: GetLoggers.h:87
virtual int deserialize(unsigned char *inbuffer)
Definition: GetLoggers.h:28