Re-organized sub-directory by category
[staging/basesystem.git] / service / system / logger_service / server / include / readerWriter / reader / mem_reader.h
1 /*
2  * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 /*
18  * mem_reader.h
19  *
20  *  Created on: Oct 22, 2013
21  */
22
23 #ifndef LOGGER_SERVICE_SERVER_INCLUDE_READERWRITER_READER_MEM_READER_H_
24 #define LOGGER_SERVICE_SERVER_INCLUDE_READERWRITER_READER_MEM_READER_H_
25
26 #include <native_service/ns_sharedmem.h>
27 #include <native_service/ns_sharedmem_reader.h>
28 #include <string>
29 #include "reader.h"
30
31 namespace ReaderWriter {
32 class CMemReader : public ReaderWriter::CReader {
33  public:
34   CMemReader();
35   virtual ~CMemReader();
36   EFrameworkunifiedStatus Initialize(CLoggerCfg* f_pLoggerCfg, std::string f_name,
37                         UI_32 f_maxSize);
38   EFrameworkunifiedStatus Read(UI_8* f_data, UI_32 f_length, SI_32& f_bytesRead);  // NOLINT (runtime/references)
39   EFrameworkunifiedStatus ReadToFile(std::string f_fileName, UI_32& f_Written);  // NOLINT (runtime/references)
40   EFrameworkunifiedStatus Open(void);
41   BOOL IsOpen(void);
42   void Close();
43   EFrameworkunifiedStatus ResetPosition(void);
44
45  private:
46   CNSSharedMemReader* m_pSharedBuf;
47   UI_32 m_sharedBufSize;
48 };
49 }  // namespace ReaderWriter
50
51 #endif  // LOGGER_SERVICE_SERVER_INCLUDE_READERWRITER_READER_MEM_READER_H_