2 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 ///////////////////////////////////////////////////////////////////////////////
18 /// \ingroup tag_SS_LoggerService
19 /// \brief This file supports error event logging.
21 ///////////////////////////////////////////////////////////////////////////////
22 #ifndef LOGGER_SERVICE_SERVER_INCLUDE_SS_LOGGER_ERROR_EVENT_STORAGE_H_
23 #define LOGGER_SERVICE_SERVER_INCLUDE_SS_LOGGER_ERROR_EVENT_STORAGE_H_
25 #include <sys/types.h>
29 #include <native_service/frameworkunified_types.h>
30 #include <ss_logger_error_event_cfg.h>
31 #include <stub/Clock_API.h>
33 #include "ss_logger_cfg.h"
35 enum ELoggerStorageThreadCommands {
36 eLoggerStorageThreadCmdOK = 0xAFFE,
37 eLoggerStorageThreadCmdWriteFailed,
38 eLoggerStorageThreadCmdNotFound,
39 eLoggerStorageThreadCmdNoWritten
42 class CLoggerErrorEventStorage {
44 CLoggerErrorEventStorage();
45 virtual ~CLoggerErrorEventStorage();
47 EFrameworkunifiedStatus Initialize(HANDLE f_hApp, std::string f_ParentName,
48 CLoggerCfg *f_pLoggerCfg);
50 EFrameworkunifiedStatus Start(std::string f_target, TArtifactResponseVec f_responseVector,
53 void ThreadFunction(void);
57 static void* ThreadFunctionWrapper(void* param);
58 static void CleanupWrapper(void* param);
60 EFrameworkunifiedStatus PackageAndPlaceArtifacts(std::string f_archiveDestination,
61 TArtifactResponseVec &f_responseVector, // NOLINT (runtime/references)
64 SI_32 CopyFiles(std::string f_archiveDestination,
65 TArtifactResponseVec &f_responseVector, BOOL isDeleteFiles); // NOLINT (runtime/references)
67 EFrameworkunifiedStatus RemoveDeprecatedArtifacts(TArtifactResponseVec &f_responseVector); // NOLINT (runtime/references)
68 HANDLE m_parentMcQueue;
70 pthread_mutex_t m_mutex;
73 std::string m_destination;
74 TArtifactResponseVec m_responseVec;
75 struct mq_attr m_mqattr;
77 CLoggerCfg *m_pLoggerCfg;
78 SLoggerStorageInfo m_loggerStorageInfo;
82 #endif // LOGGER_SERVICE_SERVER_INCLUDE_SS_LOGGER_ERROR_EVENT_STORAGE_H_