diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /datamodel/DmElementFramework.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'datamodel/DmElementFramework.h')
| -rw-r--r-- | datamodel/DmElementFramework.h | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/datamodel/DmElementFramework.h b/datamodel/DmElementFramework.h new file mode 100644 index 0000000..6cb9098 --- /dev/null +++ b/datamodel/DmElementFramework.h @@ -0,0 +1,78 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//============================================================================= + +#ifndef DMELEMENTFRAMEWORK_H +#define DMELEMENTFRAMEWORK_H + +#ifdef _WIN32 +#pragma once +#endif + +#include "datamodel/idatamodel.h" +#include "tier1/utlvector.h" +#include "dependencygraph.h" + + +//----------------------------------------------------------------------------- +// element framework implementation +//----------------------------------------------------------------------------- +class CDmElementFramework : public IDmElementFramework +{ +public: + CDmElementFramework(); + +public: + // Methods of IAppSystem + virtual bool Connect( CreateInterfaceFn factory ); + virtual void Disconnect(); + virtual void *QueryInterface( const char *pInterfaceName ); + virtual InitReturnVal_t Init(); + virtual void Shutdown(); + + // Methods of IDmElementFramework + virtual DmPhase_t GetPhase(); + virtual void SetOperators( const CUtlVector< IDmeOperator* > &operators ); + virtual void BeginEdit(); // ends in edit phase, forces apply/resolve if from edit phase + virtual void Operate( bool bResolve ); // ends in output phase + virtual void Resolve(); + +public: + // Other public methods + void AddElementToDirtyList( DmElementHandle_t hElement ); + void RemoveCleanElementsFromDirtyList(); + + // Non-virtual methods of identical virtual functions + DmPhase_t FastGetPhase(); + + +private: + void EditApply(); + + // Invoke the resolve method + void Resolve( bool clearDirtyFlags ); + + CDependencyGraph m_dependencyGraph; + CUtlVector< DmElementHandle_t > m_dirtyElements; + DmPhase_t m_phase; +}; + + +//----------------------------------------------------------------------------- +// Singleton +//----------------------------------------------------------------------------- +extern CDmElementFramework *g_pDmElementFrameworkImp; + + +//----------------------------------------------------------------------------- +// Inline methods +//----------------------------------------------------------------------------- +inline DmPhase_t CDmElementFramework::FastGetPhase() +{ + return m_phase; +} + + +#endif // DMELEMENTFRAMEWORK_H
\ No newline at end of file |