85 , f_priority(priority)
86 , f_ip_address(ip_address)
95 throw cluck::invalid_parameter(
"the computer name cannot be an empty string.");
97 std::string invalid_name_characters(
"|");
98 invalid_name_characters +=
'\0';
99 if(
f_name.find_first_of(invalid_name_characters) != std::string::npos)
101 throw cluck::invalid_parameter(
"a computer name cannot include the '|' or null characters.");
107 throw cluck::invalid_parameter(
108 "priority is limited to a number between "
157 throw cluck::logic_error(
"computer::set_id() cannot be called more than once.");
160 std::vector<std::string> parts;
161 snapdev::tokenize_string(parts,
id,
"|");
162 if(parts.size() != 5)
168 <<
"received a computer id which does not have exactly 5 parts: \""
178 std::int64_t value(0);
179 bool valid(advgetopt::validator_integer::convert_string(parts[0], value));
185 <<
"priority is limited to a number between "
195 if(!advgetopt::validator_integer::convert_string(parts[1], value))
198 <<
"random value is expected to be a valid integer, not "
209 <<
"the process IP cannot be an empty string."
219 <<
"the IP address cannot be the default IP (0.0.0.0)."
224 catch(addr::addr_invalid_argument
const & e)
230 <<
"the process IP, \""
232 <<
"\", is not valid: "
238 valid = advgetopt::validator_integer::convert_string(parts[3], value);
241 || value > cppthread::get_pid_max())
244 <<
"process identifier "
247 << std::boolalpha << valid
248 <<
") or out of bounds: [1.."
249 << cppthread::get_pid_max()
259 <<
"the server name in the lock identifier cannot be empty."