#pragma once #using <mscorlib.dll> #include "StdAfx.h" #include <vcclr.h> template < typename T > // T is a managed class here struct auto_dispose : gcroot< T * > // gcroot<> is an unmanaged class that wraps a pointer to a managed class { explicit auto_dispose( T * inner ) : base_type( inner ) {} ~auto_dispose() { ( *this )->Dispose(); } }; namespace p4dn { enum ErrorSeverity { Empty, Info, Warning, Failed, Fatal }; __gc public class Error : public System::IDisposable { public: Error( void ); ~Error(); void Dispose(); // : System::IDisposable::Dispose(); void Clear(); bool Test(); bool IsInfo(); bool IsWarning(); bool IsFatal(); System::String* Fmt(); __property p4dn::ErrorSeverity get_Severity() { return static_cast< p4dn::ErrorSeverity >( _err->GetSeverity() ); } private: ::Error* _err; bool _requiresFree; bool _Disposed; System::String* _Instance; void CleanUp(); public private: Error( ::Error* e ); __property ::Error* get_InternalError(); }; } // end namespace
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#3 | 5826 | Shawn Hladky | PerforceDotNet is now obsolete | ||
#2 | 4545 | Shawn Hladky |
Several Fixes: Updated solution to Visual Studio 2003 Implemented InputData Implemented OutPutBinary Changed ClientAPI and Error objects to implement the IDisposable interface to improve Garbage Collection Changed header files so you don't need to add #pragma once to the p4 api headers. Refactored the ClientUserDelagate class Fixed a few minor memory leaks |
||
#1 | 4328 | Shawn Hladky | Branching from //guest/jacob_gladish/PerforceDotNet/... | ||
//guest/jacob_gladish/PerforceDotNet/p4dn/Error_m.h | |||||
#1 | 3787 | Jacob Gladish | initial code submission |