#ifndef DBISIMFLAGASSOCIATION
#define DBISIMFLAGASSOCIATION

/**
 *
 * $Id: IDbiSimFlagAssociation.hxx,v 1.1 2011/01/18 05:49:20 finch Exp $
 *
 * \class COMET::IDbiSimFlagAssociation
 *
 *
 * \brief
 * <b>Concept</b> Association of a particular SimFlag type with a list
 *  of SimFlag types.
 *
 * \brief
 * <b>Purpose</b> To allow the DBI to choose an alternative SimFlag type
 * when attempting to satisfy queries.  For example, allow MC data to
 * use Data constants.
 *
 * Contact: A.Finch@lancaster.ac.uk
 *
 *
 */

#include <iosfwd>
using std::ostream;
#include <list>
using std::list;
#include <map>
using std::map;

#include "DbiSimFlag.hxx"

namespace COMET {
class IDbiSimFlagAssociation;
}
namespace COMET{
class IDbiRegistry;
}

ostream& operator<<(ostream& s, const COMET::IDbiSimFlagAssociation& simFlagAss);

namespace COMET {
class IDbiSimFlagAssociation
{


public:

// Typedefs for tired fingers.
  typedef list<COMET::DbiSimFlag::SimFlag_t>           SimList_t;
  typedef map<COMET::DbiSimFlag::SimFlag_t,SimList_t > SimMap_t;

// Constructors and destructors.
           IDbiSimFlagAssociation();
  virtual ~IDbiSimFlagAssociation();

// State testing member functions

  SimList_t Get(const COMET::DbiSimFlag::SimFlag_t value)const;
                      void Print(ostream& s)const;
                      void Show();

///  Get access to the one and only instance.
  static const IDbiSimFlagAssociation& Instance();

// State changing member functions.

  void Clear() { fAssociations.clear(); }
  void Set(const COMET::DbiSimFlag::SimFlag_t value, SimList_t list) {
                                          fAssociations[value] = list; }
  void Set(IDbiRegistry& reg);

private:

///  The one and only instance (owned by IDbiDatabaseManager).
  static const IDbiSimFlagAssociation* fgInstance;

// Data members

 SimMap_t fAssociations;

 ClassDef(IDbiSimFlagAssociation,0)  // Association between SimFlag types.

};
};


#endif // DBISIMFLAGASSOCIATION