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 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200
|
%module(directors="1") RobotRaconteurJava
#pragma SWIG nowarn=473
%{
#if defined(__clang__)
// cSpell: disable-next-line
#pragma clang diagnostic ignored "-Wunused-function"
#endif
%}
%rename("%(firstlowercase)s", %$isfunction) "";
//%rename("$ignore",regextarget=1,fullname=1) "std::$";
%include "CommonInclude.i"
%include "typemaps.i"
%include "arrays_java.i"
%include "boost_intrusive_ptr.i"
#if defined(SWIGWORDSIZE64)
%apply unsigned int { size_t };
%apply const unsigned int & { const size_t & };
#endif
%define RR_PUBLIC_OVERRIDE_METHOD(a)
%javamethodmodifiers a "public";
%enddef
%define RR_PUBLIC_VIRTUAL_METHOD(a)
%javamethodmodifiers a "public";
%enddef
%define RR_PROPERTY(a)
%enddef
%define RR_MAKE_METHOD_PRIVATE(a)
%javamethodmodifiers a "private"; %javamethodmodifiers _ ## a "private"; %rename(_ ## a) a;
%enddef
%define RR_RELEASE_GIL()
%enddef
%define RR_KEEP_GIL()
%enddef
%define RR_DIRECTOR_SHARED_PTR_RETURN_DEFAULT(TYPE)
%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE >
%{ if ($input) {
SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *smartarg = (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *)$input;
$result = *smartarg;
}
%}
%enddef
%define RR_DIRECTOR_SHARED_PTR_RETURN_RESET(TYPE)
%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE >
%{ if ($input) {
SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *smartarg = (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *)$input;
$result = *smartarg;
smartarg->reset();
}
%}
%enddef
%include "enums.swg"
%javaconst(1);
%rename("%(regex:/^(RobotRaconteur_LogLevel)_(.*)/LogLevel_\\2/)s", %$isenumitem) "";
%rename("%(regex:/^(RobotRaconteur_LogComponent)_(.*)/LogComponent_\\2/)s", %$isenumitem) "";
%ignore "RR_TIMEOUT_INFINITE";
%ignore "RR_VALUE_LIFESPAN_INFINITE";
%include "RobotRaconteurConstants.i"
%include "JavaTypemaps.i"
%include "JavaExceptionTypemaps.i"
//%rename ToString toString;
%rename("add", match$name="push_back") "";
%include "DataTypes.i"
//Native loader
%pragma(java) jniclasscode=%{
static class NativeLoader {
public NativeLoader()
{
try
{
RobotRaconteurNativeLoader.load();
}
catch(Exception e) {}
}
}
static NativeLoader myLoader=new NativeLoader();
%}
%shared_ptr(RobotRaconteur::RobotRaconteurNode)
%include "ServiceDefinitionJava.i"
%include "NodeIDJava.i"
#define RR_MESSAGE_ELEMENT_DATA_UTIL_EXTRAS
%include "MessageJava.i"
%include "AsyncHandlerDirector.i"
%include "Transport.i"
%include "TcpTransportJava.i"
%include "LocalTransport.i"
%include "HardwareTransportJava.i"
%include "IntraTransport.i"
%include "TimerJava.i"
%include "TimeSpecJava.i"
%include "TypedPacket.i"
%include "PipeMember.i"
%include "WireMember.i"
%include "MemoryMember.i"
%include "Generator.i"
%include "Client.i"
%include "ServiceJava.i"
%include "ServiceSecurityJava.i"
%include "DiscoveryJava.i"
%include "Subscription.i"
%include "Logging.i"
%include "NodeSetupJava.i"
%include "BroadcastDownsamplerJava.i"
%inline
{
class RRMonitor
{
boost::recursive_timed_mutex mlock;
public:
void lock()
{
mlock.lock();
}
bool tryLock(int timeout)
{
if (timeout==-1)
{
lock();
return true;
}
return mlock.timed_lock(boost::posix_time::milliseconds(timeout));
}
void unlock()
{
mlock.unlock();
}
};
}
namespace RobotRaconteur {
%feature("director") RRNativeObjectHeapSupport;
class RRNativeObjectHeapSupport
{
public:
static void Set_Support(RRNativeObjectHeapSupport* s);
virtual void DeleteObject_i(int32_t id)=0;
static void DeleteObject(int32_t id);
virtual ~RRNativeObjectHeapSupport();
};
}
%include "NodeDirectories.i";
%include "RobotRaconteurJavaNode.i";
//%include "Android.i"
|