⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 options.cpp

📁 ace开发环境 用来开发网络程序 其运用了设计模式、多平台、C++等多种知识
💻 CPP
📖 第 1 页 / 共 3 页
字号:
          }        // Skip the class definition while in C++ mode.        case 'M':          {            ACE_SET_BITS (option_word_, SKIPCLASS);            break;          }        // Don't include the length when computing hash function.        case 'n':          {            ACE_SET_BITS (option_word_, NOLENGTH);            break;          }        // Make generated lookup function name be.opt_arg ()        case 'N':          {            function_name_ = getopt.opt_arg ();            break;          }        // Make fill_default be.opt_arg ()        case 'F':          {            fill_default_ = getopt.opt_arg ();            break;          }        // Order input by frequency of key set occurrence.        case 'o':          {            ACE_SET_BITS (option_word_, ORDER);            break;          }        case 'O':          {            ACE_SET_BITS (option_word_, OPTIMIZE);            break;          }        // Generated lookup function now a pointer instead of int.        case 'p':          {            ACE_SET_BITS (option_word_, POINTER);            break;          }        // Utilize randomness to initialize the associated values        // table.        case 'r':          {            ACE_SET_BITS (option_word_, RANDOM);            if (initial_asso_value_ != 0)              ACE_ERROR ((LM_ERROR,                          "warning, -r option superceeds -i, disabling -i option and continuing\n"));            break;          }        // Range of associated values, determines size of final table.        case 's':          {            size_ = ACE_OS::atoi (getopt.opt_arg ());            if (abs (size_) > 50)              ACE_ERROR ((LM_ERROR,                          "%d is excessive, did you really mean this?! (type %n -h for help)\n",                          size_));            break;          }        // Generate switch statement output, rather than lookup table.        case 'S':          {            ACE_SET_BITS (option_word_, SWITCH);            total_switches_ = ACE_OS::atoi (getopt.opt_arg ());            if (total_switches_ <= 0)              ACE_ERROR_RETURN ((LM_ERROR,                                 "number of switches %s must be a positive number\n%r",                                 getopt.opt_arg (),                                 &Options::usage),                                -1);            break;          }        // Enable the TYPE mode, allowing arbitrary user structures.        case 't':          {            ACE_SET_BITS (option_word_, TYPE);            break;          }        // Don't print structure definition.        case 'T':          {            ACE_SET_BITS (option_word_, NOTYPE);            break;          }        // Print out the version and quit.        case 'v':          ACE_ERROR ((LM_ERROR,                      "%n: version %s\n%r\n",                      version_string,                      &Options::usage));          ACE_OS::exit (0);          /* NOTREACHED */          break;        // Exit with value of 0 (this is useful to check if gperf exists)        case 'V':          ACE_OS::exit (0);          /* NOTREACHED */          break;        // Set the class name.        case 'Z':          {            class_name_ = getopt.opt_arg ();            break;          }        default:          ACE_ERROR_RETURN ((LM_ERROR,                             "%r",                             &Options::usage),                            -1);        }    }  if (argv[getopt.opt_ind ()] &&    ACE_OS::freopen (argv[getopt.opt_ind ()],                     "r",                     stdin) == 0)    ACE_ERROR_RETURN ((LM_ERROR,                       "Cannot open keyword file %p\n%r",                       argv[getopt.opt_ind ()],                       &Options::usage),                      -1);  if (getopt.opt_ind () + 1 < argc)    ACE_ERROR_RETURN ((LM_ERROR,                       "Extra trailing arguments to %n.\n%r",                       usage),                      -1);  return 0;}// True if option enable, else false.intOptions::operator[] (Option_Type option){  return ACE_BIT_ENABLED (option_word_, option);}// Enables option OPT.voidOptions::operator = (enum Option_Type opt){  ACE_SET_BITS (option_word_, opt);}// Disables option OPT.boolOptions::operator != (enum Option_Type opt){  // @@ Why is this inequality comparison operator clearing bits?  ACE_CLR_BITS (option_word_, opt);  return true;}// Initializes the key Iterator.voidOptions::reset (void){  key_pos_ = 0;}// Returns current key_position and advanced index.intOptions::get (void){  return key_positions_[key_pos_++];}// Sets the size of the table size.voidOptions::asso_max (int r){  size_ = r;}// Returns the size of the table size.intOptions::asso_max (void){  return size_;}// Returns total distinct key positions.u_intOptions::max_keysig_size (void){  return total_keysig_size_;}// Sets total distinct key positions.voidOptions::keysig_size (u_int a_size){  total_keysig_size_ = a_size;}// Returns the jump value.intOptions::jump (void){  return jump_;}// Returns the generated function name.const char *Options::function_name (void){  return function_name_;}// Returns the fill defaultconst char *Options::fill_default (void){  return fill_default_;}// Returns the keyword key name.const char *Options::key_name (void){  return key_name_;}// Returns the hash function name.const char *Options::hash_name (void){  return hash_name_;}// Returns the generated class name.const char *Options::class_name (void){  return class_name_;}// Returns the initial associated character value.intOptions::initial_value (void){  return initial_asso_value_;}// Returns the iterations value.intOptions::iterations (void){  return iterations_;}// Returns the string used to delimit keywords from other attributes.const char *Options::delimiter (void){  return delimiters_;}// Gets the total number of switch statements to generate.intOptions::total_switches (void){  return total_switches_;}#endif /* ACE_HAS_GPERF */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -