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

#ifndef CTypeDefinition_h
#define CTypeDefinition_h 1

//## begin module%3BD773D90165.additionalIncludes preserve=no
//## end module%3BD773D90165.additionalIncludes

//## begin module%3BD773D90165.includes preserve=yes
#include <string>
//## end module%3BD773D90165.includes

// ACConstruct
#include "CGEngine\ACConstruct.h"
#include "ClipsInterface\Class.h"
//## begin module%3BD773D90165.additionalDeclarations preserve=yes
#include <vector>
//## end module%3BD773D90165.additionalDeclarations


//## begin CTypeDefinition%3BD773D90165.preface preserve=yes
//## end CTypeDefinition%3BD773D90165.preface

//## Class: CTypeDefinition%3BD773D90165
//	The CTypeDefinition is used to define the base Concept
//	Type within a CG KnowledgeBase.
//## Category: CGEngine%3BD772CB008A
//## Persistence: Transient
//## Cardinality/Multiplicity: n

class CTypeDefinition : public ACConstruct  //## Inherits: <unnamed>%3BD77418001B
{
  //## begin CTypeDefinition%3BD773D90165.initialDeclarations preserve=yes
  //## end CTypeDefinition%3BD773D90165.initialDeclarations
  public:

	typedef std::vector<CTypeDefinition*> TypeDefVector;

  public:
    //## Constructors (generated)
      CTypeDefinition(std::string name);

      CTypeDefinition(const CTypeDefinition &right);

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

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

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

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


    //## Other Operations (specified)
      //## Operation: Add_Lambda_Element%3BE3689003B8
      //	The Add_Lambda_Element stores the supplied Lambda
      //	expression into the CLIPS engine via the CLIPS_Class Add_
      //	Slot interface.
      void AddLambdaElement (std::string String);

      void AddSuperclass (CTypeDefinition *pSuperclass);

	  // Additional Public Declarations
      //## begin CTypeDefinition%3BD773D90165.public preserve=yes
      //## end CTypeDefinition%3BD773D90165.public

	  std::string GetTypeName () const;

      const TypeDefVector* GetSuperclassVector () const;
      const TypeDefVector* GetSubclassVector () const;

	  bool IsPrimitive() const;

	  void Commit();
      void Browse();

	  std::string GetClipsName();

  protected:
    // Additional Protected Declarations
      //## begin CTypeDefinition%3BD773D90165.protected preserve=yes
      //## end CTypeDefinition%3BD773D90165.protected

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

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

      TypeDefVector m_superclass_vector;
      TypeDefVector m_subclass_vector;
	  bool m_bPrimitive;

	  CCLPClass *m_clipClass;

    // Additional Implementation Declarations
      //## begin CTypeDefinition%3BD773D90165.implementation preserve=yes
	  std::string m_name;
      //## end CTypeDefinition%3BD773D90165.implementation

};

//## begin CTypeDefinition%3BD773D90165.postscript preserve=yes
//## end CTypeDefinition%3BD773D90165.postscript

// Class CTypeDefinition 

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

inline const CTypeDefinition::TypeDefVector* CTypeDefinition::GetSuperclassVector () const
{
  //## begin CTypeDefinition::get_superclass_vector%3BE36913001D.get preserve=no
  return &m_superclass_vector;
  //## end CTypeDefinition::get_superclass_vector%3BE36913001D.get
}

inline const CTypeDefinition::TypeDefVector* CTypeDefinition::GetSubclassVector () const
{
  //## begin CTypeDefinition::get_superclass_vector%3BE36913001D.get preserve=no
  return &m_subclass_vector;
  //## end CTypeDefinition::get_superclass_vector%3BE36913001D.get
}

inline  std::string CTypeDefinition::GetTypeName () const
{
  //## begin CTypeDefinition::get_superclass_vector%3BE36913001D.get preserve=no
  return m_name;
  //## end CTypeDefinition::get_superclass_vector%3BE36913001D.get
}

inline bool CTypeDefinition::IsPrimitive() const
{
	return m_bPrimitive;
}

inline std::string CTypeDefinition::GetClipsName()
{
	if (m_clipClass)
	{
		return (m_clipClass->NameOf());
	}
	else
	{
		return ("");
	}
}

#endif
