VMware Tanzu GemFire Native C++ Reference  10.1.5
FunctionService.hpp
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 
18 #pragma once
19 
20 #ifndef GEODE_FUNCTIONSERVICE_H_
21 #define GEODE_FUNCTIONSERVICE_H_
22 
23 #include <memory>
24 
25 #include "Execution.hpp"
26 #include "internal/geode_globals.hpp"
27 
32 namespace apache {
33 namespace geode {
34 namespace client {
35 class Pool;
36 class Region;
37 class RegionService;
38 class Execution;
39 
45 class APACHE_GEODE_EXPORT FunctionService {
46  public:
65  static Execution onRegion(const std::shared_ptr<Region>& region);
66 
80  inline static Execution onServer(const std::shared_ptr<Pool>& pool) {
81  return onServerWithPool(pool);
82  }
83 
98  inline static Execution onServer(RegionService& regionService) {
99  return onServerWithCache(regionService);
100  }
101 
115  inline static Execution onServers(const std::shared_ptr<Pool>& pool) {
116  return onServersWithPool(pool);
117  }
118 
133  inline static Execution onServers(RegionService& regionService) {
134  return onServersWithCache(regionService);
135  }
136 
137  virtual ~FunctionService() {}
138 
139  private:
140  static Execution onServerWithPool(const std::shared_ptr<Pool>& pool);
141 
142  static Execution onServerWithCache(RegionService& regionService);
143 
144  static Execution onServersWithPool(const std::shared_ptr<Pool>& pool);
145 
146  static Execution onServersWithCache(RegionService& regionService);
147 };
148 } // namespace client
149 } // namespace geode
150 } // namespace apache
151 
152 #endif // GEODE_FUNCTIONSERVICE_H_
apache::geode::client::FunctionService::onServers
static Execution onServers(RegionService &regionService)
Returns a Execution object that can be used to execute a data independent function on all the servers...
Definition: FunctionService.hpp:133
apache::geode::client::FunctionService::onRegion
static Execution onRegion(const std::shared_ptr< Region > &region)
Returns a Execution object that can be used to execute a data dependent function on the specified Reg...
apache::geode::client::FunctionService::onServer
static Execution onServer(const std::shared_ptr< Pool > &pool)
Returns a Execution object that can be used to execute a data independent function on a server in the...
Definition: FunctionService.hpp:80
Execution.hpp
apache::geode::client::FunctionService::onServer
static Execution onServer(RegionService &regionService)
Returns a Execution object that can be used to execute a data independent function on a server where ...
Definition: FunctionService.hpp:98
apache::geode::client::RegionService
A RegionService provides access to existing regions that exist in a Geode cache.
Definition: RegionService.hpp:62
apache::geode::client::FunctionService
entry point for function execution
Definition: FunctionService.hpp:45
apache::geode::client::Execution
gathers results from function execution
Definition: Execution.hpp:47
apache::geode::client::FunctionService::onServers
static Execution onServers(const std::shared_ptr< Pool > &pool)
Returns a Execution object that can be used to execute a data independent function on all the servers...
Definition: FunctionService.hpp:115

Apache Geode C++ Cache API Documentation