MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / constructTransportInst

Function constructTransportInst

java/dds/OpenDDS_DCPS_jni.cpp:268–290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266}
267
268jobject constructTransportInst(JNIEnv *jni,
269 OpenDDS::DCPS::TransportInst_rch inst)
270{
271 jclass instClazz = 0;
272 if (inst->transport_type_ == "tcp") {
273 instClazz = findClass(jni, "OpenDDS/DCPS/transport/TcpInst");
274 } else if (inst->transport_type_ == "udp") {
275 instClazz = findClass(jni, "OpenDDS/DCPS/transport/UdpInst");
276 } else if (inst->transport_type_ == "multicast") {
277 instClazz = findClass(jni, "OpenDDS/DCPS/transport/MulticastInst");
278 } else if (inst->transport_type_ == "rtps_udp") {
279 instClazz = findClass(jni, "OpenDDS/DCPS/transport/RtpsUdpInst");
280 } else {
281 throw_java_exception(jni, OpenDDS::DCPS::Transport::UnableToCreate());
282 }
283 jmethodID ctor = jni->GetMethodID(instClazz, "<init>", "(J)V");
284
285 jobject obj = jni->NewObject(instClazz, ctor,
286 reinterpret_cast<jlong>(inst._retn()));
287 jni->DeleteLocalRef(instClazz);
288
289 return obj;
290}
291
292// TheTransportRegistry
293

Calls 3

findClassFunction · 0.85
throw_java_exceptionFunction · 0.70
_retnMethod · 0.45

Tested by

no test coverage detected