Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
msg_control.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file msg_control.cc
1 
2 #include "msg_control.h"
3 
5 
6 
7 
8 
9 
10 msg_control::msg_control(const int mtype,
11  const int source,
12  const int severity,
13  const char * sourcecomponent)
14 {
15  msg_type = mtype;
17  msg_severity = severity;
18  storedseverity = severity;
19  msg_sourcecomponent = new char[strlen(sourcecomponent) + 1 ];
20  strcpy(msg_sourcecomponent,sourcecomponent);
21 }
22 
24  delete [] msg_sourcecomponent;
25 };
26 
27 int
29 {
30  int old = xx_active;
31  xx_active = 1;
32  return old;
33 }
34 
35 int
37 {
38  int old = xx_active;
39  xx_active = 0;
40  return old;
41 }
42 
43 void
44 msg_control::set_sourcecomponent (const char * msgsourcecomponent)
45 {
46 
47  delete msg_sourcecomponent;
48  msg_sourcecomponent = new char[strlen(msgsourcecomponent) + 1 ];
49  strcpy(msg_sourcecomponent,msgsourcecomponent);
50 
51 
52 }
53 
54 void
55 msg_control::set_severity(const int severity)
56 {
58  msg_severity = severity;
59 } // set_severity
60 
62 {
64  os << "<|A"
65  << SETW(MSG_TYPE_WIDTH) << mc.msg_type
66  << " |B "
68  << " |C "
70  << " |G "
71  << SETW(strlen(mc.msg_sourcecomponent)+1) << mc.msg_sourcecomponent
72  << " |>";
73  }
74 
75  return os;
76 }
77