Hazelcast C++ Client
 All Classes Functions Variables Enumerations Enumerator Pages
EvictionPolicyComparator.h
1 /*
2  * Copyright (c) 2008-2017, Hazelcast, Inc. All Rights Reserved.
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 #ifndef HAZELCAST_CLIENT_INTERNAL_EVICTION_EVICTIONPOLICYCOMPARATOR_H_
17 #define HAZELCAST_CLIENT_INTERNAL_EVICTION_EVICTIONPOLICYCOMPARATOR_H_
18 
19 #include <assert.h>
20 
21 #include "hazelcast/util/Comparator.h"
22 #include "hazelcast/client/internal/eviction/EvictableEntryView.h"
23 
24 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
25 #pragma warning(push)
26 #pragma warning(disable: 4251) //for dll export
27 #endif
28 
29 namespace hazelcast {
30  namespace client {
31  namespace internal {
32  namespace eviction {
37  template<typename K, typename V>
38  class EvictionPolicyComparator : util::Comparator<EvictableEntryView<K, V> > {
39  public:
40  virtual ~EvictionPolicyComparator() {
41  }
42 
47 
52 
57 
72  //@Override
73  virtual int compare(const EvictableEntryView<K, V> *e1, const EvictableEntryView<K, V> *e2) const {
74  assert(0);
75  return 0;
76  }
77  };
78  }
79  }
80  }
81 };
82 
83 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
84 #pragma warning(pop)
85 #endif
86 
87 #endif /* HAZELCAST_CLIENT_INTERNAL_EVICTION_EVICTIONPOLICYCOMPARATOR_H_ */
static const int BOTH_OF_ENTRIES_HAVE_SAME_PRIORITY_TO_BE_EVICTED
Integer constant for representing behaviour for giving same priority to both of entry to be evicted...
Definition: EvictionPolicyComparator.h:56
A kind of java.util.Comparator to be used while comparing entries to be evicted.
Definition: EvictionPolicyComparator.h:38
Contract point (from the end user perspective) for serving/accessing entries that can be evicted...
Definition: EvictableEntryView.h:40
static const int SECOND_ENTRY_HAS_HIGHER_PRIORITY_TO_BE_EVICTED
Integer constant for representing behaviour for giving higher priority to second entry to be evicted...
Definition: EvictionPolicyComparator.h:51
virtual int compare(const EvictableEntryView< K, V > *e1, const EvictableEntryView< K, V > *e2) const
Compares the given EvictableEntryView instances and returns the result.
Definition: EvictionPolicyComparator.h:73
static const int FIRST_ENTRY_HAS_HIGHER_PRIORITY_TO_BE_EVICTED
Integer constant for representing behaviour for giving higher priority to first entry to be evicted...
Definition: EvictionPolicyComparator.h:46