C++ API Reference for Intel® Data Analytics Acceleration Library 2020 Update 1

algorithms/engines/engine.h
1 /* file: engine.h */
2 /*******************************************************************************
3 * Copyright 2014-2020 Intel Corporation
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * 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 /*
19 //++
20 // Implementation engine.
21 //--
22 */
23 
24 #ifndef __ENGINE_H__
25 #define __ENGINE_H__
26 
27 #include "algorithms/engines/engine_types.h"
28 
29 namespace daal
30 {
31 namespace algorithms
32 {
33 namespace engines
34 {
39 namespace interface1
40 {
45 class DAAL_EXPORT BatchBase : public daal::algorithms::Analysis<batch>
46 {
47 public:
48  typedef algorithms::engines::Input InputType;
49  typedef algorithms::engines::Result ResultType;
50 
51  InputType input;
53  BatchBase() {}
54  virtual ~BatchBase() {}
55 
62  services::Status saveState(byte* dest) const
63  {
64  return saveStateImpl(dest);
65  }
66 
73  services::Status loadState(const byte* src)
74  {
75  return loadStateImpl(src);
76  }
77 
85  services::Status leapfrog(size_t threadIdx, size_t nThreads)
86  {
87  return leapfrogImpl(threadIdx, nThreads);
88  }
89 
96  services::Status skipAhead(size_t nSkip)
97  {
98  return skipAheadImpl(nSkip);
99  }
100 
106  services::SharedPtr<BatchBase> clone() const
107  {
108  return services::SharedPtr<BatchBase>(cloneImpl());
109  }
110 
111 protected:
112  virtual services::Status saveStateImpl(byte* dest) const { return services::Status(); }
113  virtual services::Status loadStateImpl(const byte* src) { return services::Status(); }
114  virtual services::Status leapfrogImpl(size_t threadNum, size_t nThreads) { return services::Status(services::ErrorMethodNotSupported); }
115  virtual services::Status skipAheadImpl(size_t nSkip) { return services::Status(); }
116  virtual BatchBase *cloneImpl() const = 0;
117 };
118 typedef services::SharedPtr<BatchBase> EnginePtr;
119 
120 } // namespace interface1
121 using interface1::BatchBase;
122 using interface1::EnginePtr;
124 } // namespace engines
125 } // namespace algorithms
126 } // namespace daal
127 #endif
daal::services::ErrorMethodNotSupported
Definition: error_indexes.h:71
daal::algorithms::engines::interface1::BatchBase::saveState
services::Status saveState(byte *dest) const
Definition: algorithms/engines/engine.h:62
daal::algorithms::engines::interface1::BatchBase::input
InputType input
Definition: algorithms/engines/engine.h:51
daal::algorithms::engines::interface1::BatchBase::leapfrog
services::Status leapfrog(size_t threadIdx, size_t nThreads)
Definition: algorithms/engines/engine.h:85
daal::algorithms::engines::interface1::BatchBase::clone
services::SharedPtr< BatchBase > clone() const
Definition: algorithms/engines/engine.h:106
daal::algorithms::engines::interface1::BatchBase::skipAhead
services::Status skipAhead(size_t nSkip)
Definition: algorithms/engines/engine.h:96
daal::algorithms::engines::interface1::BatchBase
Class representing an engine.
Definition: algorithms/engines/engine.h:45
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:70
daal::algorithms::engines::interface1::BatchBase::loadState
services::Status loadState(const byte *src)
Definition: algorithms/engines/engine.h:73

For more complete information about compiler optimizations, see our Optimization Notice.