Hazelcast C++ Client
Hazelcast C++ Client Library
entry_view.h
1 /*
2  * Copyright (c) 2008-2021, 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 #pragma once
17 
18 #include <stdint.h>
19 
20 #include "hazelcast/client/map/data_entry_view.h"
21 #include "hazelcast/client/serialization/serialization.h"
22 
23 namespace hazelcast {
24  namespace client {
31  template<typename K, typename V>
32  class entry_view{
33  public:
34  entry_view(K key, V value, map::data_entry_view rhs)
35  : key(std::move(key))
36  , value(std::move(value))
37  , cost (rhs.get_cost())
38  , creation_time (rhs.get_creation_time())
39  , expiration_time (rhs.get_expiration_time())
40  , hits (rhs.get_hits())
41  , last_access_time (rhs.get_last_access_time())
42  , last_stored_time (rhs.get_last_stored_time())
43  , last_update_time (rhs.get_last_update_time())
44  , version (rhs.get_version()) {};
45 
49  K key;
53  V value;
57  int64_t cost;
61  int64_t creation_time;
65  int64_t expiration_time;
69  int64_t hits;
85  int64_t version;
86  };
87  }
88 }
89 
90 
EntryView represents a readonly view of a map entry.
Definition: entry_view.h:32
int64_t hits
number of hits.
Definition: entry_view.h:69
int64_t creation_time
entry creation time
Definition: entry_view.h:61
int64_t expiration_time
entry expiration time if ttl is defined.
Definition: entry_view.h:65
int64_t last_stored_time
last stored time.
Definition: entry_view.h:77
int64_t last_update_time
last update time.
Definition: entry_view.h:81
int64_t last_access_time
last access time
Definition: entry_view.h:73
int64_t cost
memory cost of entry
Definition: entry_view.h:57