#ifndef CLUSTER_CONF_PARSER_HH
# define CLUSTER_CONF_PARSER_HH

# include "Syslog.h"

# include "SingletonUse.hh"
# include "ConfLoader_fwd.hh"
# include "ParseError.hh"

/** @brief Configuration parsing singleton class
 *
 * This singleton class provides an interface to dynamically
 * load classes vby reading a configuration file.
 *
 * @note You gelerally don't uses this class directly. The best
 * way to use it is to work with a class that derives from dummyConfLoader.
 *
 * @sa dummyConfLoader
 * @author Frederic Py <fpy@mbari.org>
 */
class ConfParser {
public:
  /** @brief Parsing method.
   *
   * @param fileName A file name
   * @param loader A configuration loader
   *
   * This method parses the file @e fileName and
   * provides the resultings ArgList dto @e loader so it
   * can treat them.
   *
   * @throw ParseError An error occured during the parsing. This error may
   * be a simple parse error or coming from @e loader to express
   * another problem.
   *
   * @note All exceptions which may occur during the parsing will
   * be converted into a ParseError 
   */
  void parse(Symbol const &fileName, 
	     dummyConfLoader &loader) /* throw(ParseError) */;

private:
  /** @brief Constructor 
   */
  ConfParser() {}
  /** @brief Destructor 
   */
  ~ConfParser() {
    Syslog::write("Cluster : destroying ConfParser");
  }

  friend class SingletonUse<ConfParser>;
}; // ConfParser

#endif // CLUSTER_CONF_PARSER_HH$
