EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
date_filter_msg_buffer.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file date_filter_msg_buffer.cc
1 
3 
4 // in the constructor we allocate the specified amount of bytes for
5 // the output array.
6 
8  : filter_msg_buffer(msglen)
9 {
10 
11 }
12 
14  const int type_max,
15  const int source_max,
16  const int sev_max,
17  const int msglen)
18  : filter_msg_buffer(type_max, source_max,sev_max,msglen)
19 {}
20 
21 
22 
23 // in the destructor, we restore the original streambuf for COUT.
25 {}
26 
27 // this is the function which is called as a result of the << std::endl
28 // and flush() operations
29 
31 {
32 
33  msgProfile mp;
34  int length, ix;
35 
36 
37  char *x = format(&length, &mp);
38  int ret = 0;
39 
40  if ( state[mp.type][mp.source][mp.severity] )
41  {
43 #if defined(LVL2_WINNT) || defined(STREAMBUF_NEW_IOSTREAM)
44  for (ix =0; ix < length; ix++)
45  original_streambuf->sputc( x[ix] );
46  ret = original_streambuf->pubsync();
47 #else
48  for (ix =0; ix < length; ix++)
49  original_streambuf->overflow( x[ix] );
50  ret = original_streambuf->sync();
51 #endif
52  }
53  delete [] x;
54 
55  pos = 0;
56 
57  return ret;
58 }
59 
60 
61 
62 
63 
64 
65