Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.3 KiB

  1. //====== Copyright � 1996-2004, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef DMELEMENTFRAMEWORK_H
  7. #define DMELEMENTFRAMEWORK_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "datamodel/idatamodel.h"
  12. #include "tier1/utlvector.h"
  13. #include "dependencygraph.h"
  14. //-----------------------------------------------------------------------------
  15. // element framework implementation
  16. //-----------------------------------------------------------------------------
  17. class CDmElementFramework : public CBaseAppSystem< IDmElementFramework >
  18. {
  19. public:
  20. CDmElementFramework();
  21. public:
  22. // Methods of IAppSystem
  23. virtual bool Connect( CreateInterfaceFn factory );
  24. virtual void Disconnect();
  25. virtual void *QueryInterface( const char *pInterfaceName );
  26. virtual InitReturnVal_t Init();
  27. virtual void Shutdown();
  28. // Methods of IDmElementFramework
  29. virtual DmPhase_t GetPhase();
  30. virtual void SetOperators( const CUtlVector< IDmeOperator* > &operators );
  31. virtual void BeginEdit(); // ends in edit phase, forces apply/resolve if from edit phase
  32. virtual void Operate( bool bResolve ); // ends in output phase
  33. virtual void Resolve();
  34. // Get the sorted operators in their current order, does not perform sort.
  35. virtual const CUtlVector< IDmeOperator* > &GetSortedOperators() const;
  36. public:
  37. // Other public methods
  38. void AddElementToDirtyList( DmElementHandle_t hElement );
  39. void RemoveCleanElementsFromDirtyList();
  40. // Non-virtual methods of identical virtual functions
  41. DmPhase_t FastGetPhase();
  42. private:
  43. void EditApply();
  44. // Invoke the resolve method
  45. void Resolve( bool clearDirtyFlags );
  46. CDependencyGraph m_dependencyGraph;
  47. CUtlVector< DmElementHandle_t > m_dirtyElements;
  48. DmPhase_t m_phase;
  49. };
  50. //-----------------------------------------------------------------------------
  51. // Singleton
  52. //-----------------------------------------------------------------------------
  53. extern CDmElementFramework *g_pDmElementFrameworkImp;
  54. //-----------------------------------------------------------------------------
  55. // Inline methods
  56. //-----------------------------------------------------------------------------
  57. inline DmPhase_t CDmElementFramework::FastGetPhase()
  58. {
  59. return m_phase;
  60. }
  61. #endif // DMELEMENTFRAMEWORK_H