static corto_int16 cpp_fluent_create(corto_type type, cpp_classWalk_t *data) { corto_id id, cId, varId; cpp_typeId(data->g, type, Cpp_Return, Cpp_ByCRef, cId); cpp_varId(data->g,type, varId); g_oid(data->g, type, id); g_fileWrite(data->header, "%s create();\n", id); g_fileWrite(data->hiddenImpl, "%s %s_t::create()\n", id, corto_path(NULL, g_getCurrent(data->g), type, "::")); g_fileWrite(data->hiddenImpl, " { return %s((%s)((corto::Object_t*)this)->create((corto_type)%s, &this->m_value)); }\n", id, cId, varId); return 0; }
int tc_lookupAllWalk(corto_object o, void *ctx) { CORTO_UNUSED(ctx); corto_id id; corto_object r; corto_path(id, NULL, o, "/"); r = corto_lookup(NULL, id); /* Set errormessage to ease debugging */ if (!r) corto_seterr("failed to lookup %s", id); test_assert(r != NULL); test_assert(r == o); corto_release(r); corto_objectseq scope = corto_scopeClaim(o); int i; for (i = 0; i < scope.length; i ++) { tc_lookupAllWalk(scope.buffer[i], NULL); } corto_scopeRelease(scope); return 1; }