summaryrefslogtreecommitdiffstats
path: root/src/include/usr/hwpf/fapi/fapiErrorInfoMem.H
blob: 9689766fefc75e3d6d5f4f4461f113cbc6e34099 (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
//  IBM_PROLOG_BEGIN_TAG
//  This is an automatically generated prolog.
//
//  $Source: src/include/usr/hwpf/fapi/fapiErrorInfoMem.H $
//
//  IBM CONFIDENTIAL
//
//  COPYRIGHT International Business Machines Corp. 2011
//
//  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 other-
//  wise divested of its trade secrets, irrespective of what has
//  been deposited with the U.S. Copyright Office.
//
//  Origin: 30
//
//  IBM_PROLOG_END
/**
 *  @file fapiErrorInfoMem.H
 *
 *  @brief Defines the ErrorInfoRepositoryMem class.
 *
 *  ErrorInfoRepositoryMem is a concrete Error Info repository that stores
 *  ErrorInfoRecords in heap based memory. A particular platform may choose to
 *  implement a different repository (in which case it would not compile this
 *  file)
 */

/*
 * Change Log ******************************************************************
 * Flag     Defect/Feature  User        Date        Description
 * ------   --------------  ----------  ----------- ----------------------------
 *                          mjjones     08/08/2011  Created.
 */

#ifndef FAPIERRORINFOMEM_H_
#define FAPIERRORINFOMEM_H_

#include <stdint.h>
#include <fapiReturnCode.H>
#include <fapiErrorInfo.H>
#include <vector>

namespace fapi
{

/**
 * @class ErrorInfoRepositoryMem
 *
 * This class defines a concrete error information repository. ErrorInfoRecords
 * are stored in heap based memory.
 */
class ErrorInfoRepositoryMem : public ErrorInfoRepository
{
public:

    /**
     * @brief Default constructor.
     */
    ErrorInfoRepositoryMem();

    /**
     * @brief Destructor
     */
    virtual ~ErrorInfoRepositoryMem();

    /**
     * @brief Find Error Information Record for given ReturnCode value
     *
     * Implementation of pure virtual function in base ErrorInfoRepository class
     *
     * @param[in]  i_rc     The ReturnCode value. User can pass in a ReturnCode
     *                      object and it will be implicitly converted to a
     *                      uint32_t using the ReturnCode conversion operator
     * @param[out] o_record Reference to a ErrorInfoRecord. If the record is
     *                      found then it is assigned to o_record, else it is
     *                      not. User should pass an ErrorInfoRecord with a good
     *                      ReturnCode value and then look to see if the value
     *                      was changed to the ReturnCode value to figure out if
     *                      the record was found.
     *
     * @return ReturnCode. Always success.
     */
    virtual ReturnCode find(const uint32_t i_rc,
                            ErrorInfoRecord & o_record);

private:

    /**
     * @brief Initialize the repository with ErrorInfoRecords
     *
     * This function is implemented in the generated fapiErrorInfoMemInit.C file
     * (generated using data from the Error Information XML file)
     */
    void init();

    // Vector of ErrorInfoRecords
    std::vector<ErrorInfoRecord> iv_errorInfoRecords;
    typedef std::vector<ErrorInfoRecord>::iterator ErrorInfoRecordItr_t;
};

}

#endif // FAPIERRORINFOMEM_H_
OpenPOWER on IntegriCloud