Files
Cyd 2b8ca921cb Initial full mirror of c:\VWE (source + assets + toolchain + outputs) via Git LFS
Complete disaster-recovery snapshot: engine/game source, game data assets,
VC6 toolchain + DX SDKs, build outputs, deployed game, and _UNUSED archive.
Large binaries in Git LFS; text preserved byte-for-byte (core.autocrlf=false,
no eol attributes). See RECOVERY.md for the one-clone rebuild procedure.
2026-06-24 21:28:16 -05:00

170 lines
5.0 KiB
C++

//===========================================================================//
// File: plug.hpp //
// Project: MUNGA Brick: Connection Library //
// Contents: Interface specifications for plugs and their iterators //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- -----------------------------------------------------------//
// 10/19/94 ECH Initial coding. //
// 10/20/94 JMA Fixed style stuff, merged PLGITR.HPP, added Remove() to //
// PlugIterator //
// 10/23/94 ECH Added greater deletion safety //
// 10/28/94 JMA Made compatible with SGI CC //
// 11/02/94 ECH Restored base ReceivePlugCommand //
// 11/03/94 ECH Made compatible with BC4.0 //
// 11/08/94 JMA Made compatible with GNU C++ //
// 11/29/94 JMA Changed ClassIdentity to ClassID //
// 11/30/94 JMA Adapted to style changes //
// 12/06/94 JMA Made virtual data publicly visible //
// 12/12/94 ECH Removed release handler //
// 02/16/95 ECH Removed plug commands, added node command //
// 06/07/96 ECH Implemented socket based remove functionality //
//---------------------------------------------------------------------------//
// Copyright (C) 1994-1995, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#pragma once
#include "Stuff.hpp"
#include "RegisteredClass.hpp"
#include "Iterator.hpp"
#include "Link.hpp"
namespace Stuff {
//##########################################################################
//############################ Plug ##################################
//##########################################################################
typedef RegisteredClass__ClassData Plug__ClassData;
extern HGOSHEAP g_ConnectionEngineHeap;
class ChainLink;
class Chain;
class Plug :
public RegisteredClass
{
friend class Link;
friend class Socket;
friend class ChainLink;
friend class Chain;
public:
static void
InitializeClass();
static void
TerminateClass();
typedef RegisteredClass BaseClass;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Constructor/Destructor
//
public:
~Plug();
protected:
explicit Plug(ClassData *class_data):
RegisteredClass(class_data),
m_linkHead(NULL),
m_chainLinkHead(NULL)
{}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class Data Support
//
public:
typedef Plug__ClassData ClassData;
static ClassData
*DefaultData;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Utilities
//
public:
unsigned
GetSocketCount();
void
RemoveAllSockets();
unsigned
GetChainCount();
void
RemoveAllChains();
protected:
void
RemoveSocket(Socket *socket);
bool
IsSocketMember(Socket *socket);
void
RemoveChain(Chain *chain);
bool
IsChainMember(Chain *chain);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Testing
//
public:
void
TestInstance() const;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Private data
//
protected:
Link
*m_linkHead;
ChainLink
*m_chainLinkHead;
};
//##########################################################################
//############################ PlugOf ################################
//##########################################################################
template <class T> class PlugOf:
public Plug
{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Constructor, Destructor
//
public:
//
//--------------------------------------------------------------------
// Constructor, Destructor
//--------------------------------------------------------------------
//
typedef Plug BaseClass;
explicit PlugOf(const T &item):
Plug(DefaultData),
m_item(item)
{}
~PlugOf()
{}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Accessors, Casting
//
public:
T
GetItem() const
{return m_item;}
T*
GetPointer()
{return &m_item;}
operator T() const
{return m_item;}
protected:
T m_item;
};
}