summaryrefslogtreecommitdiffstats
path: root/stub/diag_record/library_record_thread/include/stub/pfdrec_thread_ifc.h
blob: 9592939d11088b1cccaf500b38cc363434b67ba0 (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
/*
 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
 *
 * 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.
 */

#ifndef DIAG_RECORD_LIBRARY_RECORD_THREAD_INCLUDE_VEHICLE_SERVICE_PFDREC_THREAD_IFC_H_
#define DIAG_RECORD_LIBRARY_RECORD_THREAD_INCLUDE_VEHICLE_SERVICE_PFDREC_THREAD_IFC_H_

/**
 * @file pfdrec_thread_ifc.h
 * @brief diag_record thread header file
 */

/** @addtogroup BaseSystem
 *  @{
 */
/** @addtogroup vehicle_service
 *  @ingroup BaseSystem
 *  @{
 */
/** @addtogroup diag_record
 *  @ingroup vehicle_service
 *  @{
 */

#include <native_service/frameworkunified_types.h>

/**
 * @class CPFDRECThread
 * \~english @brief diag_record thread
 * \~english @par   Brief Introduction
 *        Class to provide the trace data record function
 *
 */
class CPFDRECThread {
 public:
    /////////////////////////////////////////////////////////////////////////////////////
    /// \ingroup CPFDRECThread
    /// \~english @par Summary
    ///       Constructor of CPFDRECThread class.
    /// \~english @param None
    /// \~english @retval None
    /// \~english @par Preconditions
    ///       - None.
    /// \~english @par Change of the internal state
    ///       - The internal state is not changed.
    /// \~english @par Causes of failures
    ///       None
    /// \~english @par Classification
    ///       Public
    /// \~english @par Type
    ///       None
    /// \~english @par Detail
    ///       To generate a CPFDRECThread class. \n
    ///       Member variables initialize. \n
    ///       After the constructor, be sure to call Initialize method.
    /// \~english @see  ~CPFDRECThread, Initialize
    ////////////////////////////////////////////////////////////////////////////////////
    CPFDRECThread();

    /////////////////////////////////////////////////////////////////////////////////////
    /// \ingroup ~CPFDRECThread
    /// \~english @par Summary
    ///       Destructor of CPFDRECThread class.
    /// \~english @param None
    /// \~english @retval None
    /// \~english @par Preconditions
    ///       - None.
    /// \~english @par Change of the internal state
    ///       - The internal state is not changed.
    /// \~english @par Causes of failures
    ///       None
    /// \~english @par Classification
    ///       Public
    /// \~english @par Type
    ///       None
    /// \~english @par Detail
    ///       To delete a CPFDRECThread class.
    /// \~english @see  CPFDRECThread
    ////////////////////////////////////////////////////////////////////////////////////
    virtual ~CPFDRECThread();

    /////////////////////////////////////////////////////////////////////////////////////
    /// \ingroup Initialize
    /// \~english @par Summary
    ///      - Initialize diag_record thread.
    /// \~english @param [in]    h_app    The application handle
    /// \~english @retval  eFrameworkunifiedStatusOK         Success
    /// \~english @retval  eFrameworkunifiedStatusFail       Failure
    /// \~english @par Precondition
    ///      - BackupMgr is available.
    ///      - The generation/initialization of dispatcher for application(PadCreateDispatcherWithoutLoop etc.) is done.
    /// \~english @par Changes in internal status
    ///      - There is no changes in internal status when the API is called.
    /// \~english @par Conditions of processing failure
    ///      - When fail to create TN_PFDRECTHREAD. [eFrameworkunifiedStatusFail]
    /// \~english @par Details
    ///      - The API is assumed to be executed only from the SS_LoggerService.
    ///      - Initialize diag_record thread.
    /// \~english @par Classification
    ///      - Public
    /// \~english @par Type
    ///      - Sync
    /// \~english @see FrameworkunifiedCreateChildThread, FrameworkunifiedStartChildThread
    /////////////////////////////////////////////////////////////////////////////////////
    EFrameworkunifiedStatus Initialize(HANDLE h_app);

    /////////////////////////////////////////////////////////////////////////////////////
    /// \ingroup Finalize
    /// \~english @par Summary
    ///      - Finalize diag_record thread.
    /// \~english @param [in]    h_app    The application handle
    /// \~english @retval  eFrameworkunifiedStatusOK         Success
    /// \~english @par Precondition
    ///      - The generation/initialization of dispatcher for application(PadCreateDispatcherWithoutLoop etc.) is done.
    ///      - The diag_record thread is running.
    /// \~english @par Changes in internal status
    ///      - There is no changes in internal status when the API is called.
    /// \~english @par Conditions of processing failure
    ///      - None
    /// \~english @par Details
    ///      - The API is assumed to be executed only from the SS_LoggerService.
    ///      - Finalize diag_record thread.
    /// \~english @par Classification
    ///      - Public
    /// \~english @par Type
    ///      - Sync
    /// \~english @see FrameworkunifiedStopChildThread
    /////////////////////////////////////////////////////////////////////////////////////
    EFrameworkunifiedStatus Finalize(HANDLE h_app);

 private:
    EFrameworkunifiedStatus Start(HANDLE h_thread);
    EFrameworkunifiedStatus Stop(HANDLE h_thread);

    EFrameworkunifiedStatus SetFuncOnOff(HANDLE h_thread);
    EFrameworkunifiedStatus GetFuncOnOff(HANDLE h_thread);
    EFrameworkunifiedStatus DeleteData(HANDLE h_thread);

    EFrameworkunifiedStatus DeleteIndividual(HANDLE f_hThread);
    EFrameworkunifiedStatus ComDataBackup(HANDLE h_thread);
    EFrameworkunifiedStatus ReadMemData(HANDLE h_thread);
    EFrameworkunifiedStatus GetDataInfo(HANDLE h_thread);
    EFrameworkunifiedStatus OutputData(HANDLE h_thread);
    EFrameworkunifiedStatus ReadData(HANDLE h_thread);
    EFrameworkunifiedStatus SearchData(HANDLE h_thread);
    EFrameworkunifiedStatus OverwriteData(HANDLE h_thread);
    EFrameworkunifiedStatus SetExtractMode(HANDLE h_thread);

    HANDLE                   m_thread;
};

/** @}*/  // end of diag_record
/** @}*/  // end of vehicle_service
/** @}*/  // end of BaseSystem

#endif  // DIAG_RECORD_LIBRARY_RECORD_THREAD_INCLUDE_VEHICLE_SERVICE_PFDREC_THREAD_IFC_H_