OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
FixturePythonAPI.h
Go to the documentation of this file.
1#pragma once
2#include <gtest/gtest.h>
3#include "CPythonObjectNew.h"
4#include <list>
6#include "PythonAPI.h"
7#include "PythonModuleAPI.h"
8#include "OTCore/Variable.h"
10
11class FixturePythonAPI : public testing::Test
12{
13public:
15 {
16 EntityBase::setUidGenerator(new DataStorageAPI::UniqueUIDGenerator(123, 456));
17 }
18 CPythonObjectNew CreateParameterSet(std::list<ot::Variable>& parameterSet)
19 {
20 PythonObjectBuilder pyObBuilder;
21 return pyObBuilder.setVariableTuple(parameterSet);
22 };
23
24 std::string GetModuleEntryPoint() {
25 PythonModuleAPI moduleAPI;
26 return moduleAPI.GetModuleEntryPoint(_moduleName);
27 };
28
29 ot::ReturnMessage ExecuteCommand(const std::string& command)
30 {
31 return _api.Execute(command);
32 }
33
34 void SetupModule(const std::string& script);
35private:
36 PythonWrapper _wrapper;
37 PythonAPI _api;
38 const std::string _moduleName = "example";
39};
Wrapper around a PyObject* that is a new reference. This owns the reference so does not increment it ...
Builder to transfer typically used PyObjects to c++ types and vice versa.
Definition CPythonObjectNew.h:14
Definition UniqueUIDGenerator.h:8
Definition FixturePythonAPI.h:12
ot::ReturnMessage ExecuteCommand(const std::string &command)
Definition FixturePythonAPI.h:29
std::string GetModuleEntryPoint()
Definition FixturePythonAPI.h:24
void SetupModule(const std::string &script)
Definition FixturePythonAPI.cpp:4
CPythonObjectNew CreateParameterSet(std::list< ot::Variable > &parameterSet)
Definition FixturePythonAPI.h:18
FixturePythonAPI()
Definition FixturePythonAPI.h:14
Definition PythonAPI.h:11
Functions that investigate an existing module for the starting function. If the module contains only ...
Definition PythonModuleAPI.h:8
PyObjects don't distingiush between float and double and int32 and int64. All floating point values a...
Definition PythonObjectBuilder.h:28
CPythonObjectNew setVariableTuple(const std::list< ot::Variable > &values)
Definition PythonObjectBuilder.cpp:535
Definition PythonWrapper.h:19
Definition ReturnMessage.h:14