#ifndef CLUSTER_DUMMY_CONF_LOADER_HH
# define CLUSTER_DUMMY_CONF_LOADER_HH

# include "ConfParser.hh"

/** @brief Dynamic configuration loader.
 *
 * This abstract class can be derived to implement a configuration loader.
 * Such component can be used to generate dynamically object based on a
 * configuration file parsed by ConfParser class.
 *
 * @sa ConfParser
 *
 * @author Frederic Py <fpy@mbari.org>
 */
class dummyConfLoader {
public:
  /** @brief Load configuration.
   *
   * @param fileName A file name
   *
   * This method parse the file @e fileName and apply its output to current instance.
   *
   * @throw ParseError error during loading of @e fileName
   *
   * @sa void dummyConfLoader::load(ArgList const &)
   */
  void load(Symbol const &fileName) /* throw(ParseError) */ {
    m_parser->parse(fileName, *this);
  }
  /** @brief Parsing callback.
   *
   * This method is called by ConfParser during paresing when a new
   * ArgList was extracted from parsing.
   *
   * @param arg information extracted from the configuration file.
   *
   * @throw Exception An error occured while loading @e arg. This exception
   * will be transformed as a ParseError by ConfParser
   *
   * @sa void dummyConfLoader::load(Symbol const &)
   */
  virtual void parseEvent(ArgList const &arg) =0;
     
protected:
  /** @brief Default constructor 
   */
  dummyConfLoader() {}
  /** @brief Destructor.
   */
  ~dummyConfLoader() {}
  
private:
  /** @brief Access point to the ConfParser
   */
  SingletonUse<ConfParser> m_parser;
  
}; // dummyConfLoader

#endif // CLUSTER_DUMMY_CONF_LOADER_HH
