OmniSciDB  04ee39c94c
CacheInvalidator.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019 OmniSci, Inc.
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 #ifndef CACHEINVALIDATOR_H
18 #define CACHEINVALIDATOR_H
19 
20 template <typename... CACHE_HOLDING_TYPES>
22  public:
23  static void invalidateCaches() { internalInvalidateCache<CACHE_HOLDING_TYPES...>(); }
24 
25  private:
26  CacheInvalidator() = delete;
27  ~CacheInvalidator() = delete;
28 
29  template <typename CACHE_HOLDING_TYPE>
30  static void internalInvalidateCache() {
31  CACHE_HOLDING_TYPE::yieldCacheInvalidator()();
32  }
33 
34  template <typename FIRST_CACHE_HOLDING_TYPE,
35  typename SECOND_CACHE_HOLDING_TYPE,
36  typename... REMAINING_CACHE_HOLDING_TYPES>
37  static void internalInvalidateCache() {
38  FIRST_CACHE_HOLDING_TYPE::yieldCacheInvalidator()();
39  internalInvalidateCache<SECOND_CACHE_HOLDING_TYPE,
40  REMAINING_CACHE_HOLDING_TYPES...>();
41  }
42 };
43 
44 #endif
static void internalInvalidateCache()
static void invalidateCaches()
~CacheInvalidator()=delete
static void internalInvalidateCache()
CacheInvalidator()=delete