354 {
355
356
357 char prod_name[] = "defproducera";
358 if (producer_number > valid_char_range) {
359 for (int current_char_loc = 5; current_char_loc < total_chars; ++current_char_loc) {
360 prod_name[current_char_loc] = slot_chars[0];
361 }
362 }
363
364 prod_name[total_chars] = '\0';
365 for (int current_char_loc = total_chars - 1; current_char_loc >= 0; --current_char_loc) {
366 const unsigned int slot_value = static_cast<char>(producer_number % valid_char_range);
367 producer_number /= valid_char_range;
368 prod_name[current_char_loc] = slot_chars[slot_value];
369 if (!producer_number)
370 break;
371 }
372
373
374 if (string(prod_name) == "defproducera" && producer_number != 0)
375 throw std::runtime_error( "launcher not designed to handle numbers this large " );
376
377 if (shared_producer) {
378 prod_name[0] = 's';
379 prod_name[1] = 'h';
380 prod_name[2] = 'r';
381 }
382 return prod_name;
383}