GEOS
BufferedHistoryIO.hpp
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2024 Total, S.A
7  * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
8  * Copyright (c) 2023-2024 Chevron
9  * Copyright (c) 2019- GEOS/GEOSX Contributors
10  * All rights reserved
11  *
12  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
13  * ------------------------------------------------------------------------------------------------------------
14  */
15 
16 #ifndef GEOS_FILEIO_TIMEHISTORY_BUFFEREDHISTORYIO_HPP_
17 #define GEOS_FILEIO_TIMEHISTORY_BUFFEREDHISTORYIO_HPP_
18 
19 #include "common/DataTypes.hpp"
20 
21 namespace geos
22 {
23 
29 {
30 public:
31 
33  virtual ~BufferedHistoryIO() {}
34 
40 
46  virtual void init( bool existsOkay ) = 0;
47 
51  virtual void write() = 0;
52 
57  virtual void compressInFile() = 0;
58 
63  virtual void updateCollectingCount( localIndex count ) = 0;
64 
76 
81  int getLogLevel() const { return m_logLevel; }
82 
87  void setLogLevel( int logLevel ) { m_logLevel = logLevel; }
88 
89 private:
90 
92  int m_logLevel = 0;
93 };
94 
95 }
96 #endif
An abstract class for performing buffered history output.
virtual ~BufferedHistoryIO()
Destructor.
int getLogLevel() const
Get the log-level for BufferedHistoryIO classes.
virtual void write()=0
Write the buffered history data to the output target.
virtual void updateCollectingCount(localIndex count)=0
Update the number of items being stored for IO in this object.
virtual void init(bool existsOkay)=0
Perform and intialization needed for time-history output.
virtual localIndex getBufferedCount()=0
Query the number of history states currently stored in the internal buffer.
virtual buffer_unit_type * getBufferHead()=0
Get the head of the internal history storage buffer.
virtual void compressInFile()=0
Ensure the repressentation of the data in the output target is dense and terse.
void setLogLevel(int logLevel)
Set the log-level for BufferedHistoryIO classes.
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:85
signed char buffer_unit_type
Type stored in communication buffers.
Definition: DataTypes.hpp:109