/** @brief Register a single method for a specified application. @param appName Pointer to the application that implements the method. @param methodName The fully qualified name of the method. @param symbolName The symbol name (function name) that implements the method. @param notes Public documentation for this method. @param argc How many arguments this method expects. @param options Bit switches setting various options. @param user_data Opaque pointer to be passed to the dynamically called function. */ static void register_method( osrfApplication* app, const char* methodName, const char* symbolName, const char* notes, int argc, int options, void * user_data ) { if( !app || ! methodName ) return; // Build a method and add it to the list of methods osrfMethod* method = build_method( methodName, symbolName, notes, argc, options, user_data ); osrfHashSet( app->methods, method, method->name ); }
void EquivalenceTest::generate(DexClass* cls) { setup(cls); auto ret = DexType::make_type("I"); auto args = DexTypeList::make_type_list({}); auto proto = DexProto::make_proto(ret, args); // I() DexMethod* before = static_cast<DexMethod*>(DexMethod::make_method( cls->get_type(), DexString::make_string("before_" + test_name()), proto)); before->make_concrete(ACC_PUBLIC | ACC_STATIC, false); before->set_code(std::make_unique<IRCode>(before, 0)); build_method(before); cls->add_method(before); auto after = DexMethod::make_method_from( before, cls->get_type(), DexString::make_string("after_" + test_name())); cls->add_method(after); transform_method(after); }