summaryrefslogtreecommitdiffstats
path: root/src/usr/diag/prdf/common/framework/service/xspprdService.h
blob: 1f368326d88ff8e0abb10959f0fe3cc75d6fece6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/usr/diag/prdf/common/framework/service/xspprdService.h $  */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* COPYRIGHT International Business Machines Corp. 1999,2014              */
/*                                                                        */
/* Licensed under the Apache License, Version 2.0 (the "License");        */
/* you may not use this file except in compliance with the License.       */
/* You may obtain a copy of the License at                                */
/*                                                                        */
/*     http://www.apache.org/licenses/LICENSE-2.0                         */
/*                                                                        */
/* Unless required by applicable law or agreed to in writing, software    */
/* distributed under the License is distributed on an "AS IS" BASIS,      */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or        */
/* implied. See the License for the specific language governing           */
/* permissions and limitations under the License.                         */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */

// Class Description *************************************************
//
//  Name:  ServiceGeneratorClass
//  Base class: None
//
//  Description: Service interface for PRD
//  Usage:
//  ServiceGenerator serv_generator
//  ATTENTION_TYPE attentionType = MACHINE_CHECK;  (see iipsdbug.h)
//
//
//  ///// Query for flooding condition
//  if(serv_generator.QueryLoggingBufferFull())
//  {  WE ARE FLOODING.... mask errors }
//
//  ///// Save a bad return code to be in th SRC
//  serv_generator.SaveRcForSrc((int32_t)analyzeRc);
//
//  ServiceDataCollector serviceData;
//  // serviceData = results from PRD Analysis;
//  ///// Make an SRC for PRD
//  rc = serv_generator.GenerateSrcPfa(attentionType, serviceData);
//
//
// End Class Description *********************************************


#if !(defined (xspprdService_h) || defined(IIPSERVICEGENERATOR_H))
#define xspprdService_h
#define IIPSERVICEGENERATOR_H


#include <iipsdbug.h>       // for ATTENTION_TYPE
#include <errlentry.H>      //for errlHndl_t



namespace PRDF
{

//--------------------------------------------------------------------
//  Forward References
//--------------------------------------------------------------------
class ServiceDataCollector;
class ErrDataService;


/**
 Provide error loging and SRC generation services for PRD
 <b>Owner:</b> S. Bailey
 <b>CSP Only</b>
 */
class ServiceGeneratorClass
{
public:

  // dg00 start
  /**
   Access the current concrete service generator
   <ul>
   <br><b>Paramters:   </b> None
   <br><b>Returns:     </b> Reference to active ServiceGenerator
   <br><b>Requirements:</b> None
   <br><b>Promises:    </b> ServiceGenerator
   <br><b>Notes:       </b> The definition of this function should exist
                            in the *.C of the derived class
   </ul><br>
   */
  static ServiceGeneratorClass & ThisServiceGenerator(void);
  // dg00 end

  /**
   Constructor
   <ul>
   <br><b>Parameters:  </b> None
   <br><b>Returns:     </b> Nothing
   <br><b>Requirements:</b> None
   <br><b>Promises:    </b> Object created
   <br><b>Exceptions:  </b> None
   </ul><br>
   */
  ServiceGeneratorClass(void){}

  /*
   Destructor
   <ul>
   <br><b>Parameters:  </b> None.
   <br><b>Returns:     </b> No value returned
   <br><b>Requirements:</b> None.
   <br><b>Promises:    </b> None.
   <br><b>Exceptions:  </b> None.
   <br><b>Notes:       </b> Compiler default is sufficient
   </ul><br>
   */
  virtual ~ServiceGeneratorClass(void) {};


  virtual void Initialize()=0;

  /**
   * @brief set the err data service to be used
   * @param[in] i_errDataService new err data service
   */
  virtual void setErrDataService(ErrDataService & i_errDataService)=0;

  /**
   Set the TOD of the current error
   <ul>
   <br><b>Parameter:   </b> the_attention (see iipsdbug.h)
   <br><b>Requirements:</b> None.
   <br><b>Promises:    </b> Error timestamped with TOD, latency state modifed
   <br><b>Notes:       </b> Uses the SPC interface to get the TOD
   </ul><br>
   */
  virtual void SetErrorTod( ATTENTION_TYPE the_attention,
                            ServiceDataCollector & sdc)=0;

  /**
   Query if logging buffer full - indicates attention flooding
   <ul>
   <br><b>Parameters:  </b> none.
   <br><b>Returns:     </b> [true | false]
   <br><b>Requirements:</b> None.
   <br><b>Promises:    </b> None.
   </ul><br>
   */
  virtual bool QueryLoggingBufferFull(void) const=0;

  /**
   Save a return code for inclusion in the SRC (something failed)
   <ul>
   <br><b>Parameters:  </b> a return code
   <br><b>Returns:     </b> none.
   <br><b>Requirements:</b> None.
   <br><b>Promises:    </b> Rc stored
   </ul><br>
   */
  virtual void SaveRcForSrc(int32_t the_rc)=0;

  /**
   Create an SRC, PFA data, and Error log for the ServiceData provided
   <ul>
   <br><b>Parameter:   </b> attn_type  (see iipsdbug.h)
   <br><b>Parameter:   </b> sdc  (see iipServiceData.h)
   <br><b>Returns:     </b> Error Log - Null if successfully committed
   <br><b>Requirements:</b> SetErrorTod()?
   <br><b>Promises:    </b> Error log(s) build and logged, SRC built, etc.
   <br><b>Exceptions:  </b> None.
   <br><b>Notes:       </b>
   </ul><br>
   */

  virtual errlHndl_t GenerateSrcPfa(ATTENTION_TYPE attn_type, ServiceDataCollector & sdc)=0; // mp01 c

private:


};

} // End namespace PRDF

#endif /* xspprdService_h */

OpenPOWER on IntegriCloud