Hazelcast C++ Client
EntryView.h
1 /*
2  * Copyright (c) 2008-2018, 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 //
17 // Created by sancar koyunlu on 5/23/13.
18 
19 #ifndef HAZELCAST_MAP_SIMPLE_ENTRY_VIEW
20 #define HAZELCAST_MAP_SIMPLE_ENTRY_VIEW
21 
22 #include <stdint.h>
23 
24 #include "hazelcast/client/map/DataEntryView.h"
25 #include "hazelcast/client/serialization/ObjectDataInput.h"
26 
27 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
28 #pragma warning(push)
29 #pragma warning(disable: 4251) //for dll export
30 #endif
31 
32 namespace hazelcast {
33  namespace client {
40  template<typename K, typename V>
41  class EntryView{
42  public:
43 
47  EntryView(const K &key, const V &value, const map::DataEntryView& rhs)
48  : key(key)
49  , value(value)
50  , cost (rhs.getCost())
51  , creationTime (rhs.getCreationTime())
52  , expirationTime (rhs.getExpirationTime())
53  , hits (rhs.getHits())
54  , lastAccessTime (rhs.getLastAccessTime())
55  , lastStoredTime (rhs.getLastStoredTime())
56  , lastUpdateTime (rhs.getLastUpdateTime())
57  , version (rhs.getVersion()) {
58 
59  };
63  K key;
67  V value;
71  int64_t cost;
75  int64_t creationTime;
79  int64_t expirationTime;
83  int64_t hits;
87  int64_t lastAccessTime;
91  int64_t lastStoredTime;
95  int64_t lastUpdateTime;
99  int64_t version;
100  };
101  }
102 }
103 
104 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
105 #pragma warning(pop)
106 #endif
107 
108 #endif //HAZELCAST_MAP_SIMPLE_ENTRY_VIEW
109 
int64_t lastStoredTime
last stored time.
Definition: EntryView.h:91
int64_t cost
memory cost of entry
Definition: EntryView.h:71
int64_t expirationTime
entry expiration time if ttl is defined.
Definition: EntryView.h:79
EntryView(const K &key, const V &value, const map::DataEntryView &rhs)
Constructor.
Definition: EntryView.h:47
int64_t version
version.
Definition: EntryView.h:99
int64_t lastAccessTime
last access time
Definition: EntryView.h:87
int64_t lastUpdateTime
last update time.
Definition: EntryView.h:95
int64_t hits
number of hits.
Definition: EntryView.h:83
int64_t creationTime
entry creation time
Definition: EntryView.h:75
K key
key
Definition: EntryView.h:59
EntryView represents a readonly view of a map entry.
Definition: EntryView.h:41
V value
value
Definition: EntryView.h:67
PN (Positive-Negative) CRDT counter.
Definition: MapEntryView.h:32