1 #ifndef __JNET__JHOSTNAME__
2 #define __JNET__JHOSTNAME__
16 namespace JPP {
using namespace JNET; }
87 void set(
const std::string& buffer)
91 const string::size_type pos = buffer.find(
SEPARATOR);
93 if (pos != string::npos) {
95 this->
hostname = buffer.substr(0, pos);
97 istringstream(buffer.substr(pos + 1)) >> this->
port;
101 bool is_number =
true;
103 for (string::const_iterator i = buffer.begin(); is_number && i != buffer.end(); ++i) {
104 is_number &= isdigit(*i);
111 istringstream(buffer) >> this->
port;
150 return out <<
object.hostname <<
SEPARATOR <<
object.port;
JHostname(const std::string &buffer)
Constructor.
static const int DISPATCH_PORT
Default ControlHost port.
void set(const std::string &buffer)
Set hostname and port number.
Auxiliary data structure for hostname and port number.
JHostname(const std::string &hostname, const int port)
Constructor.
static const char SEPARATOR
Separation character between hostname and port number.
friend std::ostream & operator<<(std::ostream &out, const JHostname &object)
Write hostname to output stream.
JHostname()
Default constructor.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
friend std::istream & operator>>(std::istream &in, JHostname &object)
Read hostname from input stream.