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

//## begin module%1.4%.codegen_version preserve=yes
//   Read the documentation to learn more about C++ code generator
//   versioning.
//## end module%1.4%.codegen_version

//## begin module%3BD773C20071.cm preserve=no
//	  %X% %Q% %Z% %W%
//## end module%3BD773C20071.cm

//## begin module%3BD773C20071.cp preserve=no
//## end module%3BD773C20071.cp

//## Module: ACConstruct%3BD773C20071; Pseudo Package body
//## Source file: C:\Documents and Settings\dphillips.PORTABLE\Desktop\CS650\ConGraT\CGEngine\ACConstruct.cpp

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

//## begin module%3BD773C20071.includes preserve=yes
//## end module%3BD773C20071.includes

// ACConstruct
#include "CGEngine\ACConstruct.h"
#include  <iostream>
//## begin module%3BD773C20071.additionalDeclarations preserve=yes
//## end module%3BD773C20071.additionalDeclarations


// Class ACConstruct 

ACConstruct::UidMap ACConstruct::c_mapUid;

//## begin ACConstruct::next_uid%3BE366AF0095.attr preserve=no  private: static int {U} 
int ACConstruct::c_nNextUid = 1;
//## end ACConstruct::next_uid%3BE366AF0095.attr

ACConstruct::ACConstruct()
: m_pParent(NULL)
{
    m_nUid = c_nNextUid++;

    c_mapUid.insert(UidMap::value_type(m_nUid, this));

}

ACConstruct::ACConstruct(const ACConstruct &right)
  //## begin ACConstruct::ACConstruct%3BD773C20071_copy.hasinit preserve=no
  //## end ACConstruct::ACConstruct%3BD773C20071_copy.hasinit
  //## begin ACConstruct::ACConstruct%3BD773C20071_copy.initialization preserve=yes
  //## end ACConstruct::ACConstruct%3BD773C20071_copy.initialization
{
  //## begin ACConstruct::ACConstruct%3BD773C20071_copy.body preserve=yes
  //## end ACConstruct::ACConstruct%3BD773C20071_copy.body
}


ACConstruct::~ACConstruct()
{
	if (m_pParent)
	{
	  m_pParent->Remove(this);
	}
}


ACConstruct & ACConstruct::operator=(const ACConstruct &right)
{
  //## begin ACConstruct::operator=%3BD773C20071_assign.body preserve=yes
	throw Not_Implemented_Yet();
  //## end ACConstruct::operator=%3BD773C20071_assign.body
}


int ACConstruct::operator==(const ACConstruct &right) const
{
  //## begin ACConstruct::operator==%3BD773C20071_eq.body preserve=yes
	throw Not_Implemented_Yet();
  //## end ACConstruct::operator==%3BD773C20071_eq.body
}

int ACConstruct::operator!=(const ACConstruct &right) const
{
  //## begin ACConstruct::operator!=%3BD773C20071_neq.body preserve=yes
	throw Not_Implemented_Yet();
  //## end ACConstruct::operator!=%3BD773C20071_neq.body
}



//## Other Operations (implementation)
void ACConstruct::Insert (ACConstruct* construct)
{
  //## begin ACConstruct::Insert%3BD774350009.body preserve=yes
	std::cout << "Insert needs to be overloaded" << std::endl;
  //## end ACConstruct::Insert%3BD774350009.body
}

//## Other Operations (implementation)
void ACConstruct::Remove (ACConstruct* construct)
{
  //## begin ACConstruct::Insert%3BD774350009.body preserve=yes
	std::cout << "Remove needs to be overloaded" << std::endl;
  //## end ACConstruct::Insert%3BD774350009.body
}

bool ACConstruct::Validate ()
{
  //## begin ACConstruct::Validate%3BD77442030A.body preserve=yes
	throw Not_Implemented_Yet();
  //## end ACConstruct::Validate%3BD77442030A.body
}

void ACConstruct::Create ()
{
  //## begin ACConstruct::Create%3BD7778502A7.body preserve=yes
	throw Not_Implemented_Yet();
  //## end ACConstruct::Create%3BD7778502A7.body
}

void ACConstruct::Install ()
{
  //## begin ACConstruct::Install%3BE229A8030B.body preserve=yes
	throw Not_Implemented_Yet();
  //## end ACConstruct::Install%3BE229A8030B.body
}

ACConstruct* ACConstruct::FindByUid (int nUid)
{
	UidMap::iterator iter;
	
	iter = c_mapUid.find(nUid);
	
	if (iter == c_mapUid.end())
	{
		return NULL;
	}
	else
	{
		return (*iter).second;
	}
}

// Additional Declarations
  //## begin ACConstruct%3BD773C20071.declarations preserve=yes
  //## end ACConstruct%3BD773C20071.declarations

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