summaryrefslogtreecommitdiffstats
path: root/src/usr/diag/prdf/common/framework/resolution/prdfResetThresholdResolution.H
blob: c0f79ba7c422cb94902c5292fce27bcf4faefe4d (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
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/usr/diag/prdf/common/framework/resolution/prdfResetThresholdResolution.H $ */
/*                                                                        */
/* IBM CONFIDENTIAL                                                       */
/*                                                                        */
/* COPYRIGHT International Business Machines Corp. 2002,2013              */
/*                                                                        */
/* p1                                                                     */
/*                                                                        */
/* Object Code Only (OCO) source materials                                */
/* Licensed Internal Code Source Materials                                */
/* IBM HostBoot Licensed Internal Code                                    */
/*                                                                        */
/* The source code for this program is not published or otherwise         */
/* divested of its trade secrets, irrespective of what has been           */
/* deposited with the U.S. Copyright Office.                              */
/*                                                                        */
/* Origin: 30                                                             */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */

#ifndef prdfResetThresholdResolution_H
#define prdfResetThresholdResolution_H
/**
 @file prdfResetThresholdResolution.H
 @brief Resolution that counts occurrances up to a threshold, then reports and resets
        the count and starts counting again.
*/

#include <prdfThresholdResolutions.H>
#warning -This is an obsolite part

#if defined(_OBSOLITE_)
//--------------------------------------------------------------------
// Includes
//--------------------------------------------------------------------

#ifndef iipResolution_h
#include <iipThresholdResolution.h>
#endif

//--------------------------------------------------------------------
//  Forward References
//--------------------------------------------------------------------

/**
 ResetThresholdResolution
 @par
 Resolution that has a threshold and keeps track of how
 many times its called. When the threshold is reached, it
 tells the service data collector and sends it a mask id,
 then resets the threshold count to 0.
 @code
   enum { thresholdValue = 32, MaskId = 05 };
   ResetThresholdResolution rtr(thresholdValue,MaskId);
   Resolution & fr = ResolutionFactory::Access().GetCalloutResolution(HOM_IOHUBCHIP0,MRU_HIGH);
   ResolutionMap rm(...);    // see ResolutionMap
   rm.Add(BIT_LIST_STRING_05,&rtr,&ftr);   // Resolution invoked when bit 5
  //                                          is on - callsout callout and
  //                                          thresholds at thresholdValue
 @endcode
*/
class ResetThresholdResolution : public ThresholdResolution
{
public:
  /**
   ctor
   @param thresholdValue, error is reported when count == thresholdValue
   @param maskId is send to the service data collector when threshold is reached
   @pre none
   @post internal count set to zero
   @note If another resolution is chained to this one, it is always called reguardless of the count
   */
  ResetThresholdResolution(uint16_t thresholdValue, uint32_t mask_id);

  /**
   ctor
   @param thresholdValue, error is reported when count == thresholdValue
   @param maskId is send to the service data collector when threshold is reached
   @param Another resolution to call (chained) after this one
   @pre none
   @post internal count set to zero
   @note If another resolution is chained to this one, it is always called reguardless of the count
   */
//  ResetThresholdResolution(uint32_t thresholdValue, uint32_t mask_id, Resolution &r);

  // ~ResetThresholdResolution(); compiler default is ok
  // copy ctor - Compiler default ok
  // Assignment - Compiler default ok

  /**
   Resolve this part of the error (increment count)
   @param error, Access to ServiceDataCollector @see ServiceDataCollector
   @returns [SUCCESS| return code]
   @pre none
   @post 1) ++count.
         2) if count == threshold then error.service_data->IsAtThreshold() == true and
             maskId is sent to serviceDataCollector.
         3)Chained resolution called if one was provided in ctor
   */
  virtual int32_t Resolve(STEP_CODE_DATA_STRUCT & error);


private:  // functions
private:  // Data

//  uint8_t  threshold;
//  uint8_t  count;
//  uint16_t maskId;
//  Resolution * xRes;
};

inline
ResetThresholdResolution::ResetThresholdResolution(uint16_t thresholdValue, uint32_t mask_id)
: ThresholdResolution(thresholdValue,mask_id)
{}

/*
inline
ResetThresholdResolution::ResetThresholdResolution(uint32_t thresholdValue,
                                         uint32_t mask_id,
                                         Resolution & r)
: Resolution(), threshold(thresholdValue), count(0), maskId(mask_id), xRes(&r)
{}
*/
#endif
#endif /* xspprdResetThresholdResolution_h */
OpenPOWER on IntegriCloud