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

Function gen_helper

java/idl2jni/codegen/im_java.cpp:156–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154}
155
156bool gen_helper(const JavaName &jn, const char *repoid, bool narrow = false)
157{
158 JavaName jn_help(jn, "Helper");
159
160 string body =
161 " // Any and TypeCode operations not currently implemented\n"
162 " public static String id() { return \"" + string(repoid) + "\"; }\n";
163
164 if (narrow) {
165 body +=
166 " public static " + jn.clazz_
167 + " narrow(org.omg.CORBA.Object obj) {\n"
168 " if (obj == null)\n"
169 " return null;\n"
170 " else if (obj instanceof " + jn.clazz_ + ")\n"
171 " return (" + jn.clazz_ + ")obj;\n"
172 " else if (!obj._is_a (id ()))\n"
173 " throw new org.omg.CORBA.BAD_PARAM ();\n"
174 " else\n"
175 " return native_unarrow(obj);\n"
176 " }\n\n"
177 " public static " + jn.clazz_
178 + " unchecked_narrow(org.omg.CORBA.Object obj) {\n"
179 " if (obj == null)\n"
180 " return null;\n"
181 " else if (obj instanceof " + jn.clazz_ + ")\n"
182 " return (" + jn.clazz_ + ")obj;\n"
183 " else\n"
184 " return native_unarrow(obj);\n"
185 " }\n\n"
186 " private native static " + jn.clazz_
187 + " native_unarrow(org.omg.CORBA.Object obj);\n";
188 }
189
190 return java_class_gen(jn_help, JABSTRACT_CLASS, body.c_str());
191}
192
193bool gen_holder(const JavaName &jn, const char *held = "")
194{

Callers 6

gen_enumMethod · 0.85
gen_structMethod · 0.85
gen_typedefMethod · 0.85
gen_interfMethod · 0.85
gen_nativeMethod · 0.85
gen_unionMethod · 0.85

Calls 1

java_class_genFunction · 0.85

Tested by

no test coverage detected