/******************************************************************
** Copyright (C) 2001, University of Alabama in Huntsville. 
** All rights reserved.
**
** File   : CCatalogOfIndividuals.cpp
**
** Author : David Phillips
**
** Description:
**    This file provides implementation for the CCatalogOfIndividuals
**    class.
**
** History:
**    24-Nov-2001 : David Phillips
**        Created file.
******************************************************************/

// CCatalogOfIndividuals
#include "CGEngine\CCatalogOfIndividuals.h"

// Class CCatalogOfIndividuals 

CCatalogOfIndividuals::CCatalogOfIndividuals()
{
}

CCatalogOfIndividuals::CCatalogOfIndividuals(const CCatalogOfIndividuals &right)
{
}


CCatalogOfIndividuals::~CCatalogOfIndividuals()
{
}


CCatalogOfIndividuals & CCatalogOfIndividuals::operator=(const CCatalogOfIndividuals &right)
{
	throw ACConstruct::Not_Implemented_Yet();
}

void CCatalogOfIndividuals::Insert (ACConstruct* pConstruct)
{
	std::cout << "Inserting Concept into COI" << std::endl;
	CConcept *pConcept = dynamic_cast<CConcept*>(pConstruct);

	if (pConcept)
	{
      std::cout << "Concept " << pConcept->GetIndividualMarker() << " inserted into COI" << std::endl;
	  m_mapIndividual.insert(IndividualMap::value_type(pConcept->GetIndividualMarker(), pConcept));
	}
	else
	{
		std::cout << "*** Non-Concept inserted into Catalog" << std::endl;
	}
}

CConcept* CCatalogOfIndividuals::FindByMarker(std::string sMarker)
{
	IndividualMap::iterator iter;
	
	iter = m_mapIndividual.find(sMarker);
	
	if (iter == m_mapIndividual.end())
	{
		return NULL;
	}
	else
	{
		return (*iter).second;
	}
}

int CCatalogOfIndividuals::operator==(const CCatalogOfIndividuals &right) const
{
	throw ACConstruct::Not_Implemented_Yet();
}

int CCatalogOfIndividuals::operator!=(const CCatalogOfIndividuals &right) const
{
	throw ACConstruct::Not_Implemented_Yet();
}

const CCatalogOfIndividuals::IndividualMap* CCatalogOfIndividuals::GetIndividuals() const
{
	return &m_mapIndividual;
};
