/******************************************************************
** Copyright (C) 2001, University of Alabama in Huntsville. 
** All rights reserved.
**
** File   : CConcept.h
**
** Author : David Phillips
**
** Description:
**    This file provides definition for the CConcept
**    class.
**
** History:
**    24-Nov-2001 : David Phillips
**        Created file.
**    02-Dec-2001 : Satish Hota
**        Moved the ConceptVector typedef into this file from the
**        SheetOfAssertion.
******************************************************************/

#ifndef CConcept_h
#define CConcept_h 1

#include "CGEngine\ACConstruct.h"
#include "CGEngine\CTypeDefinition.h"
#include "CGEngine\CCoreferentSet.h"
#include "CLIPSInterface\Instance.h"
#include <vector>

class CRelation;
class ACCGFactory;

class CConcept : public ACConstruct  //## Inherits: <unnamed>%3BE226F40003
{

  public:
	  typedef std::vector<CConcept*> ConceptVector;

	//## Constructors (generated)
      CConcept();

      CConcept(const CConcept &right);

    //## Destructor (generated)
      virtual ~CConcept();

    //## Assignment Operation (generated)
      CConcept & operator=(const CConcept &right);

    //## Equality Operations (generated)
      int operator==(const CConcept &right) const;

      int operator!=(const CConcept &right) const;

	  const std::string& GetName () const;
      void SetName (std::string sName);

      const std::string& GetIndividualMarker () const;
      void SetIndividualMarker (std::string sMarker);
      
      const std::string& GetLabel () const;
      void SetLabel (std::string sLabel);
      
	  CTypeDefinition* GetTypeDef () const;
      void SetTypeDef (CTypeDefinition *pTypeDef);

	  void AddRelation(CRelation* pRelation);
	  void RemoveRelation(CRelation* pRelation);

    //## Other Operations (specified)
      void Change_Referent ();
      void Change_Type ();

      //	The Join method joins two graphs by manipulating the
      //	CLIPS representation to replace the Source CConcept with
      //	the Target CConcept.
      void Join (CConcept* pNonSurvivingConcept);

      //	The Detach method splits a graph by replicating the
      //	CConcept and manipulating the CLIPS representation to
      //	have two separate Conceptual Graphs.
      void Detach (ACCGFactory* pFactory);

      //	The Copy method creates a new CConcept and copies all
      //	associated Relations.
      void Copy ();

      //## Operation: Simplify%3BE2314401C1
      //	The Simplify method removes a CConcept and associated
      //	Relations.
      void Simplify ();

      //	The Add_To_CoreferentSet method adds the current
      //	Concept to the specified Coreferent_Set.
      void Add_To_Coreferent_Set ();

  	  void Commit();

  private:
    //## Get and Set Operations for Class Attributes (generated)

      const CCoreferentSet get_coreferent_set () const;
      void set_coreferent_set (CCoreferentSet value);

	  typedef std::vector<CRelation*> RelationVector;

  private: //## implementation
    // Data Members for Class Attributes

	  std::string m_sName;
	  std::string m_sMarker;
	  std::string m_sLabel;
	  CTypeDefinition *m_pTypeDef;
      CCoreferentSet *m_coreferent_set;
	  RelationVector m_vectorRelation;
	  CCLPInstance *m_pClpInstance;
};

// Class CConcept 

inline const std::string& CConcept::GetName () const
{
	return m_sName;
}

inline void CConcept::SetName (std::string sName)
{
	m_sName = sName;
}

inline const std::string& CConcept::GetIndividualMarker () const
{
	return m_sMarker;
}

inline void CConcept::SetIndividualMarker (std::string sMarker)
{
	m_sMarker = sMarker;
}

inline const std::string& CConcept::GetLabel () const
{
	return m_sLabel;
}

inline void CConcept::SetLabel (std::string sLabel)
{
	m_sLabel = sLabel;
}

inline CTypeDefinition* CConcept::GetTypeDef () const
{
  return m_pTypeDef;
}

inline void CConcept::SetTypeDef (CTypeDefinition* pTypeDef)
{
  m_pTypeDef = pTypeDef;
}

inline const CCoreferentSet CConcept::get_coreferent_set () const
{
  return *m_coreferent_set;
}

inline void CConcept::set_coreferent_set (CCoreferentSet value)
{
  *m_coreferent_set = value;
}

#endif
