Archival snapshot of the Virtual World Entertainment Tesla cockpit software, 1994-1996: MUNGA engine and L4 pod layer source (Borland C++ 5.0), BT/RP game code, and game content (models, audio, maps, gauges, Division renderer data). Includes third-party libraries: Division dVS/DPL graphics, HMI SOS audio, WATTCP networking. Files are preserved byte-for-byte (.gitattributes disables all line-ending conversion). README.md documents the layout, target hardware, and toolchain. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
180 lines
5.1 KiB
C++
180 lines
5.1 KiB
C++
//===========================================================================//
|
|
// File: iterator.cc //
|
|
// Project: MUNGA Brick: Connection Library //
|
|
// Contents: Implementation details of base iterator //
|
|
//---------------------------------------------------------------------------//
|
|
// Date Who Modification //
|
|
// -------- --- ---------------------------------------------------------- //
|
|
// 10/08/94 ECH Initial coding. //
|
|
// 10/20/94 JMA Fixed style stuff. //
|
|
// 10/23/94 ECH Added Begin, End, Forward, Backward style iteration //
|
|
// methods //
|
|
// 10/23/94 ECH Added higher level of deletion safety //
|
|
// 10/28/94 JMA Made compatible with SGI CC //
|
|
// 11/03/94 ECH Made compatible with BC4.0 //
|
|
// 11/05/94 JMA Made compatible with GNU C++ //
|
|
// 01/04/95 ECH Added base methods for some iterator methods //
|
|
//---------------------------------------------------------------------------//
|
|
// Copyright (C) 1994-1995, Virtual World Entertainment, Inc. //
|
|
// All Rights reserved worldwide //
|
|
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
|
|
//===========================================================================//
|
|
|
|
#include <munga.hpp>
|
|
#pragma hdrstop
|
|
|
|
#if !defined(ITERATOR_HPP)
|
|
#include <iterator.hpp>
|
|
#endif
|
|
|
|
//
|
|
//#############################################################################
|
|
//#############################################################################
|
|
//
|
|
Iterator::Iterator()
|
|
{
|
|
}
|
|
|
|
//
|
|
//#############################################################################
|
|
//#############################################################################
|
|
//
|
|
Iterator::~Iterator()
|
|
{
|
|
}
|
|
|
|
//
|
|
//#############################################################################
|
|
//#############################################################################
|
|
//
|
|
Logical
|
|
Iterator::TestInstance() const
|
|
{
|
|
return True;
|
|
}
|
|
|
|
//
|
|
//###########################################################################
|
|
// First
|
|
//###########################################################################
|
|
//
|
|
void
|
|
Iterator::First()
|
|
{
|
|
Fail("Iterator::First - Should never reach here");
|
|
}
|
|
|
|
//
|
|
//###########################################################################
|
|
// Last
|
|
//###########################################################################
|
|
//
|
|
void
|
|
Iterator::Last()
|
|
{
|
|
Fail("Iterator::Last - Should never reach here");
|
|
}
|
|
|
|
//
|
|
//###########################################################################
|
|
// Next
|
|
//###########################################################################
|
|
//
|
|
void
|
|
Iterator::Next()
|
|
{
|
|
Fail("Iterator::Next - Should never reach here");
|
|
}
|
|
|
|
//
|
|
//###########################################################################
|
|
// Previous
|
|
//###########################################################################
|
|
//
|
|
void
|
|
Iterator::Previous()
|
|
{
|
|
Fail("Iterator::Previous - Should never reach here");
|
|
}
|
|
|
|
//
|
|
//###########################################################################
|
|
// GetSize
|
|
//###########################################################################
|
|
//
|
|
CollectionSize
|
|
Iterator::GetSize()
|
|
{
|
|
Fail("Iterator::GetSize - Should never reach here");
|
|
return 0;
|
|
}
|
|
|
|
//
|
|
//###########################################################################
|
|
// ReadAndNextImplementation
|
|
//###########################################################################
|
|
//
|
|
void
|
|
*Iterator::ReadAndNextImplementation()
|
|
{
|
|
void *item;
|
|
|
|
if ((item = GetCurrentImplementation()) != NULL)
|
|
{
|
|
Next();
|
|
}
|
|
return item;
|
|
}
|
|
|
|
//
|
|
//###########################################################################
|
|
// ReadAndPreviousImplementation
|
|
//###########################################################################
|
|
//
|
|
void
|
|
*Iterator::ReadAndPreviousImplementation()
|
|
{
|
|
void *item;
|
|
|
|
if ((item = GetCurrentImplementation()) != NULL)
|
|
{
|
|
Previous();
|
|
}
|
|
return item;
|
|
}
|
|
|
|
//
|
|
//###########################################################################
|
|
// GetCurrentImplementation
|
|
//###########################################################################
|
|
//
|
|
void*
|
|
Iterator::GetCurrentImplementation()
|
|
{
|
|
Fail("Iterator::GetCurrentImplementation - Should never reach here");
|
|
return NULL;
|
|
}
|
|
|
|
//
|
|
//###########################################################################
|
|
// GetNthImplementation
|
|
//###########################################################################
|
|
//
|
|
void
|
|
*Iterator::GetNthImplementation(CollectionSize index)
|
|
{
|
|
CollectionSize i = 0;
|
|
void *item;
|
|
|
|
First();
|
|
while ((item = GetCurrentImplementation()) != NULL)
|
|
{
|
|
if (i == index)
|
|
return item;
|
|
Next();
|
|
i++;
|
|
}
|
|
return NULL;
|
|
}
|
|
|