Apache Ignite C++
continuous_query.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
23 #ifndef _IGNITE_CACHE_QUERY_CONTINUOUS_CONTINUOUS_QUERY
24 #define _IGNITE_CACHE_QUERY_CONTINUOUS_CONTINUOUS_QUERY
25 
26 #include <ignite/impl/cache/query/continuous/continuous_query_impl.h>
27 
30 
31 namespace ignite
32 {
33  namespace cache
34  {
35  // Forward-declaration.
36  template<typename K, typename V>
37  class IGNITE_IMPORT_EXPORT Cache;
38 
39  namespace query
40  {
41  namespace continuous
42  {
57  template<typename K, typename V>
59  {
60  friend class Cache<K, V>;
61  public:
62 
66  enum { DEFAULT_BUFFER_SIZE = 1 };
67 
71  enum { DEFAULT_TIME_INTERVAL = 0 };
72 
77  {
78  // No-op.
79  }
80 
88  impl(new impl::cache::query::continuous::ContinuousQueryImpl<K, V>(lsnr, false))
89  {
90  // No-op.
91  }
92 
101  impl(new impl::cache::query::continuous::ContinuousQueryImpl<K, V>(lsnr, loc))
102  {
103  // No-op.
104  }
105 
113  template<typename F>
115  const Reference<F>& remoteFilter) :
116  impl(new impl::cache::query::continuous::ContinuousQueryImpl<K, V>(lsnr, false, remoteFilter))
117  {
118  // No-op.
119  }
120 
129  template<typename F>
131  const Reference<F>& remoteFilter, bool loc) :
132  impl(new impl::cache::query::continuous::ContinuousQueryImpl<K, V>(lsnr, loc, remoteFilter))
133  {
134  // No-op.
135  }
136 
144  void SetLocal(bool val)
145  {
146  impl.Get()->SetLocal(val);
147  }
148 
156  bool GetLocal() const
157  {
158  return impl.Get()->GetLocal();
159  }
160 
171  void SetBufferSize(int32_t val)
172  {
173  impl.Get()->SetBufferSize(val);
174  }
175 
186  int32_t GetBufferSize() const
187  {
188  return impl.Get()->GetBufferSize();
189  }
190 
206  void SetTimeInterval(int64_t val)
207  {
208  impl.Get()->SetTimeInterval(val);
209  }
210 
226  int64_t GetTimeInterval() const
227  {
228  return impl.Get()->GetTimeInterval();
229  }
230 
239  {
240  impl.Get()->SetListener(lsnr);
241  }
242 
249  {
250  return impl.Get()->GetListener();
251  }
252 
259  {
260  return impl.Get()->GetListener();
261  }
262 
263  private:
265  common::concurrent::SharedPointer<impl::cache::query::continuous::ContinuousQueryImpl<K, V> > impl;
266  };
267  }
268  }
269  }
270 }
271 
272 #endif //_IGNITE_CACHE_QUERY_CONTINUOUS_CONTINUOUS_QUERY
ContinuousQuery(Reference< event::CacheEntryEventListener< K, V > > lsnr, const Reference< F > &remoteFilter, bool loc)
Constructor.
Definition: continuous_query.h:130
~ContinuousQuery()
Destructor.
Definition: continuous_query.h:76
int32_t GetBufferSize() const
Get buffer size.
Definition: continuous_query.h:186
Main entry point for all Data Grid APIs.
Definition: cache.h:68
Continuous query.
Definition: continuous_query.h:58
void SetBufferSize(int32_t val)
Set buffer size.
Definition: continuous_query.h:171
ContinuousQuery(Reference< event::CacheEntryEventListener< K, V > > lsnr, const Reference< F > &remoteFilter)
Constructor.
Definition: continuous_query.h:114
void SetLocal(bool val)
Set local flag.
Definition: continuous_query.h:144
event::CacheEntryEventListener< K, V > & GetListener()
Get cache entry event listener.
Definition: continuous_query.h:258
Declares ignite::cache::event::CacheEntryEventListener class.
ContinuousQuery(Reference< event::CacheEntryEventListener< K, V > > lsnr, bool loc)
Constructor.
Definition: continuous_query.h:100
int64_t GetTimeInterval() const
Get time interval.
Definition: continuous_query.h:226
bool GetLocal() const
Get local flag.
Definition: continuous_query.h:156
Reference class.
Definition: reference.h:35
Declares ignite::cache::event::CacheEntryEventFilter class.
void SetTimeInterval(int64_t val)
Set time interval.
Definition: continuous_query.h:206
const event::CacheEntryEventListener< K, V > & GetListener() const
Get cache entry event listener.
Definition: continuous_query.h:248
Apache Ignite API.
Definition: cache.h:48
void SetListener(Reference< event::CacheEntryEventListener< K, V > > lsnr)
Set cache entry event listener.
Definition: continuous_query.h:238
Cache entry event listener.
Definition: cache_entry_event_listener.h:40
ContinuousQuery(Reference< event::CacheEntryEventListener< K, V > > lsnr)
Constructor.
Definition: continuous_query.h:87