Files
firestorm/Gameleap/code/mw4/Libraries/Proxies/GenericProxy.hpp
T
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

94 lines
1.9 KiB
C++

#pragma once
#include "Proxies.hpp"
namespace Proxies {
//
//#########################################################################
//######################## GenericProxy #############################
//#########################################################################
//
class _declspec(novtable) GenericProxy:
public Stuff::Plug
{
public:
static void
InitializeClass();
static void
TerminateClass();
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Constructors
//
public:
virtual void
Destroy() = 0;
protected:
GenericProxy(ClassData *class_data):
Plug(class_data)
{referenceCount = 1;}
virtual ~GenericProxy()
{Check_Object(this); Verify(!referenceCount);}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class Data Support
//
public:
static ClassData
*DefaultData;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Proxy name
//
public:
//
// Get the name of the proxy
//
virtual bool
GetName(Stuff::MString *name) = 0;
//
// Set the name of the proxy
//
virtual void
SetName(const char* name) = 0;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Reference counting
//
public:
void
AttachReference()
{Check_Object(this); ++referenceCount;}
void
DetachReference()
{
Check_Object(this); Verify(referenceCount > 0);
if ((--referenceCount) == 0)
{
Unregister_Object(this);
delete this;
}
}
int
GetReferenceCount()
{return referenceCount;}
protected:
int
referenceCount;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Testing
//
public:
void
TestInstance() const;
};
}