Files
CydandClaude Fable 5 fdd9ac9d97 Initial import: Tesla Release 4.10 (Tesla:BattleTech & Tesla:Red Planet)
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>
2026-07-02 13:21:58 -05:00

167 lines
4.7 KiB
C++

//===========================================================================//
// File: slot.hh //
// Project: MUNGA Brick: Connection Library //
// Contents: Interface specification for slot class //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 10/20/94 ECH Initial coding. //
// 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++ //
// 12/12/94 ECH Changed release handling //
//---------------------------------------------------------------------------//
// Copyright (C) 1994-1995, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#if !defined(SLOT_HPP)
# define SLOT_HPP
# if !defined(SOCKET_HPP)
# include <socket.hpp>
# endif
# if !defined(MEMBLOCK_HPP)
# include <memblock.hpp>
# endif
class Slot;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SlotLink ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#define SLOTLINK_MEMORYBLOCK_ALLOCATION (100)
class SlotLink:
public Link
{
friend class Slot;
public:
~SlotLink();
Logical
TestInstance() const;
private:
SlotLink(
Slot *slot,
Plug *plug
);
private:
static MemoryBlock
AllocatedMemory;
void*
operator new(size_t)
{return AllocatedMemory.New();}
void
operator delete(void *where)
{AllocatedMemory.Delete(where);}
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~ Slot ~~~~~~~~~~~~~~~~~~~~~~~~~~~
class Slot : public Socket
{
friend class SlotLink;
public:
//
//--------------------------------------------------------------------
//--------------------------------------------------------------------
// Public interface
//--------------------------------------------------------------------
//--------------------------------------------------------------------
//
//
//--------------------------------------------------------------------
// Constructor, Destructor and testing
//--------------------------------------------------------------------
//
Slot(Node *node);
~Slot();
Logical
TestInstance() const;
//
//--------------------------------------------------------------------
// Remove - Remove the link
//--------------------------------------------------------------------
//
void
Remove();
protected:
//
//--------------------------------------------------------------------
//--------------------------------------------------------------------
// Protected interface
//--------------------------------------------------------------------
//--------------------------------------------------------------------
//
void
AddImplementation(Plug *plug);
Plug*
GetCurrentPlug() const;
private:
//
//--------------------------------------------------------------------
// Private data
//--------------------------------------------------------------------
//
SlotLink
*slotLink;
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~ SlotOf ~~~~~~~~~~~~~~~~~~~~~~~~~~~
template <class T> class SlotOf:
public Slot
{
public:
//
//--------------------------------------------------------------------
//--------------------------------------------------------------------
// Public interface
//--------------------------------------------------------------------
//--------------------------------------------------------------------
//
SlotOf(Node *node);
~SlotOf();
//
//--------------------------------------------------------------------
// Socket methods (see Socket for full listing)
//--------------------------------------------------------------------
//
void
Add(T plug)
{AddImplementation(Cast_Object(Plug*,plug));}
T
GetCurrent() const
{return (T)GetCurrentPlug();}
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~ SlotOf templates ~~~~~~~~~~~~~~~~~~~~~~~~~~~
template <class T>
SlotOf<T>::SlotOf(Node *node):
Slot(node)
{
}
template <class T>
SlotOf<T>::~SlotOf()
{
}
#endif