This repository has been archived on 2024-06-13. You can view files and clone it, but cannot push or open issues or pull requests.
2020-08-04 13:13:01 -04:00

46 lines
1.3 KiB
C++

//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: A higher level link library for general use in the game and tools.
//
//===========================================================================//
#ifndef TIER3DM_H
#define TIER3DM_H
#if defined(_WIN32)
#pragma once
#endif
#include "tier2/tier2dm.h"
#include "tier3/tier3.h"
//-----------------------------------------------------------------------------
// Helper empty implementation of an IAppSystem for tier2 libraries
//-----------------------------------------------------------------------------
template <class IInterface, int ConVarFlag = 0>
class CTier3DmAppSystem : public CTier2DmAppSystem<IInterface, ConVarFlag> {
typedef CTier2DmAppSystem<IInterface, ConVarFlag> BaseClass;
public:
CTier3DmAppSystem(bool bIsPrimaryAppSystem = true)
: BaseClass(bIsPrimaryAppSystem) {}
virtual bool Connect(CreateInterfaceFn factory) {
if (!BaseClass::Connect(factory)) return false;
if (IsPrimaryAppSystem()) {
ConnectTier3Libraries(&factory, 1);
}
return true;
}
virtual void Disconnect() {
if (IsPrimaryAppSystem()) {
DisconnectTier3Libraries();
}
BaseClass::Disconnect();
}
};
#endif // TIER3DM_H