Grok  10.0.3
ICacheable.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016-2022 Grok Image Compression Inc.
3  *
4  * This source code is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Affero General Public License, version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This source code is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Affero General Public License for more details.
12  *
13  * You should have received a copy of the GNU Affero General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 #pragma once
18 
19 namespace grk
20 {
22 {
26 };
27 
29 {
30  public:
32  virtual ~ICacheable() = default;
33  bool isOpen(void)
34  {
35  return state_ == GRK_CACHE_STATE_OPEN;
36  }
37  bool isClosed(void)
38  {
40  }
41  bool isError(void)
42  {
43  return state_ == GRK_CACHE_STATE_ERROR;
44  }
46  {
47  state_ = state;
48  }
49 
50  private:
52 };
53 
54 } // namespace grk
Definition: ICacheable.h:29
bool isOpen(void)
Definition: ICacheable.h:33
GrkCacheState state_
Definition: ICacheable.h:51
void setCacheState(GrkCacheState state)
Definition: ICacheable.h:45
bool isError(void)
Definition: ICacheable.h:41
virtual ~ICacheable()=default
ICacheable()
Definition: ICacheable.h:31
bool isClosed(void)
Definition: ICacheable.h:37
Copyright (C) 2016-2022 Grok Image Compression Inc.
Definition: ICacheable.h:20
GrkCacheState
Definition: ICacheable.h:22
@ GRK_CACHE_STATE_CLOSED
Definition: ICacheable.h:23
@ GRK_CACHE_STATE_ERROR
Definition: ICacheable.h:25
@ GRK_CACHE_STATE_OPEN
Definition: ICacheable.h:24