Texture::Texture(Texture&& texture): m_handle(texture.m_handle), m_size(texture.m_size) { texture.m_size = Size(); texture.m_handle = handle_t(); }
Texture& Texture::operator=(Texture&& texture) { Dispose(); m_handle = texture.m_handle; m_size = texture.m_size; texture.m_size = Size(); texture.m_handle = handle_t(); }
bool ContextClosest::parseCmdArgs(int argc, char **argv, int skipFirstArgs){ _argc = argc; _argv = argv; _skipFirstArgs = skipFirstArgs; if (_argc < 2) { setShowHelp(true); return false; } setProgram(_programNames[argv[0]]); _argsProcessed.resize(_argc - _skipFirstArgs, false); for (_i=_skipFirstArgs; _i < argc; _i++) { if (isUsed(_i - _skipFirstArgs)) { continue; } if (strcmp(_argv[_i], "-c") == 0) { //bypass intersect's use of the -c option, because -c //means writeCount for intersect, but means columns for map. if (!ContextBase::handle_c()) return false; } else if (strcmp(_argv[_i], "-d") == 0) { if (!handle_d()) return false; } else if (strcmp(_argv[_i], "-D") == 0) { if (!handle_D()) return false; } else if (strcmp(_argv[_i], "-io") == 0) { if (!handle_io()) return false; } else if (strcmp(_argv[_i], "-iu") == 0) { if (!handle_iu()) return false; } else if (strcmp(_argv[_i], "-id") == 0) { if (!handle_id()) return false; } else if (strcmp(_argv[_i], "-N") == 0) { if (!handle_N()) return false; } else if (strcmp(_argv[_i], "-t") == 0) { if (!handle_t()) return false; } else if (strcmp(_argv[_i], "-mdb") == 0) { if (!handle_mdb()) return false; } } return ContextIntersect::parseCmdArgs(argc, argv, _skipFirstArgs); }
/* ////////////////////////////////////////////////////////////////////////// */ int mmu_args_process_user_input(mmu_args_t *a, int argc, char **argv) { int c; int rc = MMU_FAILURE; char **tmp_argv = NULL; if (NULL == (tmp_argv = mmu_args_dup_argv(argc, argv))) { MMU_OOR_COMPLAIN(); return MMU_FAILURE_OOR; } while (-1 != (c = getopt_long_only(argc, tmp_argv, opt_string, long_opts, NULL))) { switch (c) { case 's': /* samples-per-sec */ if (MMU_SUCCESS != (rc = handle_s(a, c, optarg))) { goto show_usage; } break; case 't': /* sample-time */ if (MMU_SUCCESS != (rc = handle_t(a, c, optarg))) { goto show_usage; } break; case 'w': /* enable workload */ if (MMU_SUCCESS != (rc = handle_w(a))) { goto show_usage; } break; case 'h': /* help! */ mmu_args_usage(); rc = MMU_SUCCESS_EXIT_SUCCESS; goto cleanup; break; case 'v': /* version, please */ showver(); rc = MMU_SUCCESS_EXIT_SUCCESS; goto cleanup; break; default: goto show_usage; } } if (optind < argc) { fprintf(stderr, MMU_ERR_PREFIX"unrecognized input: \"%s\"\n", tmp_argv[optind]); goto show_usage; } /* all is well */ rc = MMU_SUCCESS; goto cleanup; show_usage: mmu_args_usage(); rc = MMU_FAILURE_INVALID_USER_INPUT; cleanup: if (NULL != tmp_argv) { mmu_args_free_dup_argv(tmp_argv); } return rc; }