#ifndef n_dummyServiceAnnouncer_H
#define n_dummyServiceAnnouncer_H

/*
 *
 * nucleo/network/rdv/dummyServiceAnnouncer.H --
 *
 * Copyright (C) Nicolas Roussel
 *
 * See the file LICENSE for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 */

#include <iostream>

#include <nucleo/network/rdv/ServiceAnnouncer.H>

namespace nucleo {

  // Simply prints out the service on stdout...

  class dummyServiceAnnouncer : public ServiceAnnouncer {

  protected:

    std::string name ;

  public:

    dummyServiceAnnouncer(const char *n, const char *type, int port,
					 TextRecords *textRecords,
					 bool autorename,
					 const char *domain, const char *host) {
	 name = n ;
	 std::cerr << "Service '" << n << "' (" << type << ") is running on port " << port ;
	 if (host) std::cerr << " on machine '" << host << "'" ;
	 else std::cerr << " on localhost" << std::endl ;
    }

    state getState(void) { return UNKNOWN ; }
    bool changeName(const char *newname) { return false ; }
    std::string getName(void) { return name ; }

  } ;

}

#endif
