Hazelcast C++ Client
 All Classes Functions Variables Enumerations Enumerator Pages
EntryArray.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 //
17 // Created by ihsan demir on 25 02, 2016.
18 //
19 #ifndef HAZELCAST_CLIENT_ENTRYARRAY_H_
20 #define HAZELCAST_CLIENT_ENTRYARRAY_H_
21 
22 #include <vector>
23 
24 #include "hazelcast/util/Util.h"
25 #include "hazelcast/client/exception/IllegalArgumentException.h"
26 #include "hazelcast/util/Comparator.h"
27 #include "hazelcast/client/query/PagingPredicate.h"
28 #include "hazelcast/client/serialization/pimpl/SerializationService.h"
29 #include "DataArray.h"
30 
31 namespace hazelcast {
32  namespace client {
33  template<typename K, typename V>
34  class EntryArray {
35  public:
36  virtual ~EntryArray() { }
37 
41  virtual size_t size() const = 0;
42 
50  virtual const K *getKey(size_t index) = 0;
51 
60  virtual std::auto_ptr<K> releaseKey(size_t index) = 0;
61 
69  virtual const V *getValue(size_t index) = 0;
70 
78  virtual std::auto_ptr<V> releaseValue(size_t index) = 0;
79 
84  virtual std::pair<const K *, const V *> operator[](size_t index) = 0;
85 
92  virtual void sort(query::IterationType iterationType, const util::Comparator<std::pair<const K *, const V *> > *comparator = 0) = 0;
93  };
94  }
95 }
96 
97 #endif //HAZELCAST_CLIENT_ENTRYARRAY_H_
98 
virtual size_t size() const =0
Definition: EntryArray.h:34
virtual std::auto_ptr< V > releaseValue(size_t index)=0
Please note that this operation is costly due to de-serialization.
virtual std::pair< const K *, const V * > operator[](size_t index)=0
virtual std::auto_ptr< K > releaseKey(size_t index)=0
Please note that this operation MAY(if not deserialized previously) be costly due to de-serialization...
virtual const V * getValue(size_t index)=0
Please note that this operation is costly due to de-serialization.
virtual const K * getKey(size_t index)=0
Please note that this operation is costly due to de-serialization.
virtual void sort(query::IterationType iterationType, const util::Comparator< std::pair< const K *, const V * > > *comparator=0)=0
Sorts the entries using the comparator if comparator is not null.