NRP Core  1.4.1
from_engine_datapack.h
Go to the documentation of this file.
1 /* * NRP Core - Backend infrastructure to synchronize simulations
2  *
3  * Copyright 2020-2023 NRP Team
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  * This project has received funding from the European Union’s Horizon 2020
18  * Framework Programme for Research and Innovation under the Specific Grant
19  * Agreement No. 945539 (Human Brain Project SGA3).
20  */
21 
22 #ifndef SINGLE_TRANSCEIVER_DATAPACK_H
23 #define SINGLE_TRANSCEIVER_DATAPACK_H
24 
26 
27 
29 {
32 };
33 
34 
40 {
41  public:
42  EngineDataPack(const std::string &keyword, const DataPackIdentifier &datapackID, bool isPreprocessed);
43  virtual ~EngineDataPack() override = default;
44 
46 
47  boost::python::object runTf(boost::python::tuple &args, boost::python::dict &kwargs, datapacks_set_t dataPacks) override;
48 
49  private:
50 
51  std::string _keyword;
52  DataPackIdentifier _datapackID;
53  bool _isPreprocessed;
54  DataPackPassingPolicy _DataPackPassingPolicy;
55 };
56 
62 {
63 public:
64  EngineDataPacks(const std::string &keyword, const boost::python::list &datapackListNames, const std::string &engineName, bool isPreprocessed);
65  virtual ~EngineDataPacks() override = default;
66 
68 
69  boost::python::object runTf(boost::python::tuple &args, boost::python::dict &kwargs, datapacks_set_t dataPacks) override;
70 
71 private:
72 
73  std::string _keyword;
74  std::vector<DataPackIdentifier> _datapacksIDs;
75  std::string _engineName;
76  bool _isPreprocessed;
77  DataPackPassingPolicy _DataPackPassingPolicy;
78 };
79 
80 #endif // SINGLE_TRANSCEIVER_DATAPACK_H
datapacks_set_t
std::set< std::shared_ptr< const DataPackInterface >, DataPackPointerComparator > datapacks_set_t
Definition: datapack_interface.h:219
EngineDataPack::getRequestedDataPackIDs
datapack_identifiers_set_t getRequestedDataPackIDs() const override
Returns datapack IDs of this DataPack that should be requested from the engines. TODO: Make protected...
Definition: from_engine_datapack.cpp:38
EngineDataPacks::getRequestedDataPackIDs
datapack_identifiers_set_t getRequestedDataPackIDs() const override
Returns datapack IDs of this DataPack that should be requested from the engines. TODO: Make protected...
Definition: from_engine_datapack.cpp:93
DataPackPassingPolicy
DataPackPassingPolicy
Definition: from_engine_datapack.h:28
python_json_engine.args
Namespace args
Definition: python_json_engine.py:196
EngineDataPack
Class for input datapacks for transceiver functions, mapped to EngineDataPack python decorator.
Definition: from_engine_datapack.h:38
PASS_BY_REFERENCE
@ PASS_BY_REFERENCE
Definition: from_engine_datapack.h:31
EngineDataPack::~EngineDataPack
virtual ~EngineDataPack() override=default
EngineDataPacks::runTf
boost::python::object runTf(boost::python::tuple &args, boost::python::dict &kwargs, datapacks_set_t dataPacks) override
Execute Transceiver Function. Base class will simply call runTf on _function.
Definition: from_engine_datapack.cpp:110
datapack_identifiers_set_t
std::set< DataPackIdentifier > datapack_identifiers_set_t
Definition: datapack_interface.h:221
EngineDataPacks
Class for input multiple datapacks for a single transceiver function, mapped to EngineDataPacks pytho...
Definition: from_engine_datapack.h:60
PASS_BY_VALUE
@ PASS_BY_VALUE
Definition: from_engine_datapack.h:30
EngineDataPack::EngineDataPack
EngineDataPack(const std::string &keyword, const DataPackIdentifier &datapackID, bool isPreprocessed)
Definition: from_engine_datapack.cpp:29
EngineDataPack::runTf
boost::python::object runTf(boost::python::tuple &args, boost::python::dict &kwargs, datapacks_set_t dataPacks) override
Execute Transceiver Function. Base class will simply call runTf on _function.
Definition: from_engine_datapack.cpp:50
TransceiverDataPackInterface
Base of TF Decorators.
Definition: transceiver_datapack_interface.h:40
EngineDataPacks::EngineDataPacks
EngineDataPacks(const std::string &keyword, const boost::python::list &datapackListNames, const std::string &engineName, bool isPreprocessed)
Definition: from_engine_datapack.cpp:70
DataPackIdentifier
Identifies a single datapack.
Definition: datapack_interface.h:38
EngineDataPacks::~EngineDataPacks
virtual ~EngineDataPacks() override=default
transceiver_datapack_interface.h