Apache Geode Native C++ Reference 1.15.0
Execution.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_EXECUTION_H_
21#define GEODE_EXECUTION_H_
22
23#include <chrono>
24#include <memory>
25#include <string>
26
27#include "CacheableBuiltins.hpp"
28#include "ResultCollector.hpp"
29#include "internal/geode_globals.hpp"
30
35namespace apache {
36namespace geode {
37namespace client {
38
39class ExecutionImpl;
40class FunctionService;
41
47class APACHE_GEODE_EXPORT Execution {
48 public:
49 Execution();
50 ~Execution() noexcept;
51 Execution(Execution&& move) noexcept;
52 Execution& operator=(Execution&& move) noexcept;
53
68 Execution withFilter(std::shared_ptr<CacheableVector> routingObj);
76 Execution withArgs(std::shared_ptr<Cacheable> args);
84 Execution withCollector(std::shared_ptr<ResultCollector> rs);
94 std::shared_ptr<ResultCollector> execute(
95 const std::string& func,
96 std::chrono::milliseconds timeout = DEFAULT_QUERY_RESPONSE_TIMEOUT);
97
113 std::shared_ptr<ResultCollector> execute(
114 const std::shared_ptr<CacheableVector>& routingObj,
115 const std::shared_ptr<Cacheable>& args,
116 const std::shared_ptr<ResultCollector>& rs, const std::string& func,
117 std::chrono::milliseconds timeout);
118
119 private:
120 std::unique_ptr<ExecutionImpl> impl_;
121
122 explicit Execution(std::unique_ptr<ExecutionImpl> impl);
123
124 friend ExecutionImpl;
125 friend FunctionService;
126};
127
128} // namespace client
129} // namespace geode
130} // namespace apache
131
132#endif // GEODE_EXECUTION_H_
Contains generic template definitions for Cacheable types and instantiations for built-in types.
gathers results from function execution
Definition: Execution.hpp:47
Execution withArgs(std::shared_ptr< Cacheable > args)
Specifies the user data passed to the function when it is executed.
Execution withCollector(std::shared_ptr< ResultCollector > rs)
Specifies the ResultCollector that will receive the results after the function has been executed.
std::shared_ptr< ResultCollector > execute(const std::shared_ptr< CacheableVector > &routingObj, const std::shared_ptr< Cacheable > &args, const std::shared_ptr< ResultCollector > &rs, const std::string &func, std::chrono::milliseconds timeout)
Executes the function using its name.
std::shared_ptr< ResultCollector > execute(const std::string &func, std::chrono::milliseconds timeout=DEFAULT_QUERY_RESPONSE_TIMEOUT)
Executes the function using its name.
Execution withFilter(std::shared_ptr< CacheableVector > routingObj)
Specifies a data filter of routing objects for selecting the Geode members to execute the function.
entry point for function execution
Definition: FunctionService.hpp:45

Apache Geode C++ Cache API Documentation