/******************************************************************************
** Copyright (C) 2001, University of Alabama in Huntsville. 
** All rights reserved.
**
** File   : CRelation.h
**
** Author : David Phillips
**
** Description:
**    This file provides definition for the CRelation
**    class.
**
** History:
** 24-Nov-2001 : David Phillips
**    Created file.
** 02-Dec-2001 : Satish Hota
**    * Moved the RelationVector typedef to this class from the 
**      CSheetOfAssertion.h file.
**    * Added new methods GetFromArcs() and GetToArc().
**    * Renamed get_Type and set_Type to GetRelDef and SetRelDef respectively
**      and made them public.  Changed the input and output to CConcept*.
**    * Renamed the member Type to m_pType.
**    * Added members m_FromArcList and m_pToArc.
******************************************************************************/

#ifndef CRelation_h
#define CRelation_h 1

#pragma warning(disable: 4786)  // Disable debug information warning

#include "CGEngine\ACConstruct.h"
#include "CGEngine\CConcept.h"
#include "CGEngine\CRelationDefinition.h"

#include <vector>

class CRelation : public ACConstruct  //## Inherits: <unnamed>%3BE226FA02C8
{

  public:
	  typedef std::vector<CRelation*> RelationVector;
    //## Constructors (generated)
      CRelation();

      CRelation(const CRelation &right);

    //## Destructor (generated)
      ~CRelation();

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

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

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

	  void AddArc(CConcept* pArc);
	  const CConcept::ConceptVector* GetFromArcs();
	  CConcept* GetToArc();

    //## Other Operations (specified)
      //## Operation: Change_Type%3BE22F4B0085
      //	The Change_Type method changes the type for a selected
      //	Relation.
      void Change_Type ();

      void Replace(CConcept* pOriginalConcept, CConcept* pWithConcept);

	  //## Operation: Copy%3BE2315401C4
      //	The Copy method creates a new CRelation that is an exact
      //	duplicate of the Source CRelation.
      void Copy ();

      //## Operation: Simplify%3BE2315401CE
      //	The Simplify method removes a CRelation that has a
      //	duplicate.
      //
      //	PDL:
      //	  verify that a CRelation with the same Arcs exists
      //	  if CRelation is duplicated
      //	    delete CRelation
      void Simplify ();

    // Additional Public Declarations
      //## begin CRelation%3BE226E400F0.public preserve=yes
      //## end CRelation%3BE226E400F0.public
      CRelationDefinition* GetRelDef();
      void SetRelDef (CRelationDefinition* value);

  protected:
    // Additional Protected Declarations
      //## begin CRelation%3BE226E400F0.protected preserve=yes
      //## end CRelation%3BE226E400F0.protected

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

      //## Attribute: m_pType%3BE22F23002D

    // Additional Private Declarations
      //## begin CRelation%3BE226E400F0.private preserve=yes
      //## end CRelation%3BE226E400F0.private

  private: //## implementation
      CConcept::ConceptVector m_FromArcList;
	  CConcept *m_pToArc;
    // Data Members for Class Attributes

      //## begin CRelation::m_pType%3BE22F23002D.attr preserve=no  private: CRelationDefinition {R} 
      CRelationDefinition *m_pType;
      //## end CRelation::m_pType%3BE22F23002D.attr

    // Additional Implementation Declarations
      //## begin CRelation%3BE226E400F0.implementation preserve=yes
      //## end CRelation%3BE226E400F0.implementation

};

//## begin CRelation%3BE226E400F0.postscript preserve=yes
//## end CRelation%3BE226E400F0.postscript

// Class CRelation 

//## Get and Set Operations for Class Attributes (inline)

inline CRelationDefinition* CRelation::GetRelDef ()
{
  //## begin CRelation::get_Type%3BE22F23002D.get preserve=no
  return m_pType;
  //## end CRelation::get_Type%3BE22F23002D.get
}

inline void CRelation::SetRelDef (CRelationDefinition* value)
{
  //## begin CRelation::set_Type%3BE22F23002D.set preserve=no
  m_pType = value;
  //## end CRelation::set_Type%3BE22F23002D.set
}

//## begin module%3BE226E400F0.epilog preserve=yes
//## end module%3BE226E400F0.epilog


#endif
