TImageP TImageReader::load() { TImageP image = load0(); if (!image) return TImageP(); TImageInfo info = m_reader->getImageInfo(); if (info.m_lx <= 0 || info.m_ly <= 0) return TImageP(); return image; }
int main(int argc, char * argv[]) { int a = 1, b = 2, z1 = 3, z2 = 4, z3 = 5; void *handle0, *handle1; char *error; if (argc == 3) { a = atoi(argv[1]); b = atoi(argv[2]); } DynamicLoader load0("./closure_callee0"); DynamicLoader load1("./closure_callee1"); DynamicLoader load2("./closure_callee2"); DynamicLoader load3("./closure_callee3"); std::function<int (int)> init_0 = load0.load<int (int)>("callee_init"); std::function<int (int, int&, int*)> init_1 = load1.load<int (int, int&, int*)>("callee_init"); std::function<int (int, int&, int*)> init_3 = load3.load<int (int, int&, int*)>("create_callee"); std::function<int (void)> del_3 = load3.load<int (void)>("destroy_callee"); std::function<int (int, int)> callee_0 = load0.load<int (int, int)>("callee"); std::function<int (int, int)> callee_1 = load1.load<int (int, int)>("callee"); std::function<int (int, int)> callee_3 = load3.load<int (int, int)>("lam"); typedef std::function<int (int, int)> T_lam; std::function<int (T_lam, int, int)> callee_2 = load2.load<int (T_lam, int, int)>("callee"); init_0(z1); init_1(z1, z2, &z3); printf("<%s:%d> : z1 = %d, z2 = %d, z3 = %d\n", __FUNCTION__, __LINE__, z1, z2, z3); init_3(z1, z2, &z3); printf("<%s:%d> : z1 = %d, z2 = %d, z3 = %d\n", __FUNCTION__, __LINE__, z1, z2, z3); callee_0(a, b); callee_1(a, b); // callee_3(a, b); callee_2(callee_0, a, b); callee_2(callee_1, a, b); printf("<%s:%d> : z1 = %d, z2 = %d, z3 = %d\n", __FUNCTION__, __LINE__, z1, z2, z3); callee_2(callee_3, a, b); printf("<%s:%d> : z1 = %d, z2 = %d, z3 = %d\n", __FUNCTION__, __LINE__, z1, z2, z3); del_3(); load0.close(); load1.close(); load2.close(); load3.close(); return 0; }