Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
msg_buffer.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file msg_buffer.h
1 
2 #ifndef __MSG_BUFFER_H__
3 #define __MSG_BUFFER_H__
4 
5 
6 #include "event_io.h"
7 
8 #ifdef __CINT__
9 #include <iostream>
10 #endif
11 
12 
13 #ifndef __CINT__
14 
15 #include <cstdio>
16 #include <cstdarg>
17 #include <string>
18 #include <ctime>
19 #include <time.h>
20 
21 #endif
22 
23 
24 #include "msg_control.h"
25 
26 // if we find that our buffer is too small, we extend it
27 // by this amount.
28 #define MSG_EXTENSION_AMOUNT 32
29 
30 
31 typedef struct msgProfile {
32  int type;
33  int source;
34  int severity;
35  int reserved1;
36  int reserved2;
37  int reserved3;
38  char sourcecomponent[256];
39 } msgProfile;
40 
41 
42 
43 //class msg_control;
44 
45 
64 #ifdef __CINT__
65 class msg_buffer : public streambuf {
66 #else
67 class msg_buffer : public STREAMBUF {
68 #endif
69 
70 protected:
71  char *oBuffer;
72  int pos;
75 
76  virtual char * format(int * length, msgProfile *mp);
77 
78 
79 
80  public:
81  msg_buffer (const int msglen=256);
82  virtual ~msg_buffer();
83 
84  virtual int overflow (int ch);
85  virtual int sync ();
86 };
87 
88 #ifndef __CINT__
89 void streambuf_add_date (STREAMBUF * sb);
90 #endif
91 
92 
93 #endif /* __MSG_BUFFER_H__ */