-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathHelloWorld.i
More file actions
127 lines (98 loc) · 3.9 KB
/
HelloWorld.i
File metadata and controls
127 lines (98 loc) · 3.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*!
* @file HelloWorld.i
* This header file contains the SWIG interface of the described types in the IDL file.
*
* This file was generated by the tool fastddsgen (version: 4.0.5).
*/
%module(moduleimport="if __import__('os').name == 'nt': import win32api; win32api.LoadLibrary('HelloWorld.dll')\nif __package__ or '.' in __name__:\n from . import _HelloWorldWrapper\nelse:\n import _HelloWorldWrapper") HelloWorld
// If using windows in debug, it would try to use python_d, which would not be found.
%begin %{
#ifdef _MSC_VER
#define SWIG_PYTHON_INTERPRETER_NO_DEBUG
#endif
#include <exception>
%}
// SWIG helper modules
%include "stdint.i"
%include "std_array.i"
%include "std_map.i"
%include "std_string.i"
%include "std_vector.i"
%include "typemaps.i"
// Assignemt operators are ignored, as there is no such thing in Python.
// Trying to export them issues a warning
%ignore *::operator=;
// Macro declarations
// Any macro used on the Fast DDS header files will give an error if it is not redefined here
#define FASTDDS_EXPORTED_API
#define eProsima_user_DllExport
%{
#include "HelloWorld.hpp"
#include <fastdds/dds/core/LoanableSequence.hpp>
%}
%include <fastcdr/config.h>
%import(module="fastdds") "fastcdr/cdr/fixed_size_string.hpp"
%import(module="fastdds") "fastdds/dds/core/LoanableCollection.hpp"
%import(module="fastdds") "fastdds/dds/core/LoanableTypedCollection.hpp"
%import(module="fastdds") "fastdds/dds/core/LoanableSequence.hpp"
%define %traits_penumn(Type...)
%fragment(SWIG_Traits_frag(Type),"header",
fragment="StdTraits") {
namespace swig {
template <> struct traits< Type > {
typedef value_category category;
static const char* type_name() { return #Type; }
};
}
}
%enddef
////////////////////////////////////////////////////////
// Binding for class HelloWorld
////////////////////////////////////////////////////////
// Ignore overloaded methods that have no application on Python
// Otherwise they will issue a warning
%ignore HelloWorld::HelloWorld(HelloWorld&&);
// Overloaded getter methods shadow each other and are equivalent in python
// Avoid a warning ignoring all but one
%ignore HelloWorld::index(uint32_t&&);
// Overloaded getter methods shadow each other and are equivalent in python
// Const accesors produced constant enums instead of arrays/dictionaries when used
// We ignore them to prevent this
%ignore HelloWorld::index();
%rename("%s") HelloWorld::index() const;
%ignore HelloWorld::message(std::string&&);
// Overloaded getter methods shadow each other and are equivalent in python
// Const accesors produced constant enums instead of arrays/dictionaries when used
// We ignore them to prevent this
%ignore HelloWorld::message();
%rename("%s") HelloWorld::message() const;
%template(_HelloWorldSeq) eprosima::fastdds::dds::LoanableTypedCollection<HelloWorld, std::false_type>;
%template(HelloWorldSeq) eprosima::fastdds::dds::LoanableSequence<HelloWorld, std::false_type>;
%extend eprosima::fastdds::dds::LoanableSequence<HelloWorld, std::false_type>
{
size_t __len__() const
{
return self->length();
}
const HelloWorld& __getitem__(size_t i) const
{
return (*self)[i];
}
}
// Include the class interfaces
%include "HelloWorld.hpp"
// Include the corresponding TopicDataType
%include "HelloWorldPubSubTypes.i"