84 lines
2.9 KiB
ObjectPascal
84 lines
2.9 KiB
ObjectPascal
unit dpglib.ExceptionHandler;
|
|
|
|
interface
|
|
uses
|
|
dpgrtl.types,
|
|
dpglib.types;
|
|
|
|
type
|
|
// =========================================================================
|
|
// Class TExceptionHandler declaration
|
|
// =========================================================================
|
|
TExceptionHandler = class( TInterfacedObject,
|
|
IExceptionHandler)
|
|
// ---------------------------------------------------------------
|
|
// Members
|
|
// ---------------------------------------------------------------
|
|
protected
|
|
fTypeAndName : IToken;
|
|
fAction : IToken;
|
|
|
|
// ---------------------------------------------------------------
|
|
// Constructor/destructor
|
|
// ---------------------------------------------------------------
|
|
public
|
|
constructor Create( pTypeAndName : IToken;
|
|
pAction : IToken);
|
|
destructor Destroy; override;
|
|
|
|
// ---------------------------------------------------------------
|
|
// IExceptionHandler methods
|
|
// ---------------------------------------------------------------
|
|
protected
|
|
function GetTypeAndName : IToken;
|
|
function GetAction : IToken;
|
|
end;
|
|
|
|
implementation
|
|
// ****************************************************************************
|
|
// Constructor/destructor
|
|
// ****************************************************************************
|
|
// ============================================================================
|
|
// Constructor
|
|
// ============================================================================
|
|
constructor TExceptionHandler.Create( pTypeAndName : IToken;
|
|
pAction : IToken);
|
|
begin
|
|
inherited Create;
|
|
|
|
fTypeAndName := pTypeAndName;
|
|
fAction := pAction;
|
|
end;
|
|
|
|
// ============================================================================
|
|
// Destructor
|
|
// ============================================================================
|
|
destructor TExceptionHandler.Destroy;
|
|
begin
|
|
fTypeAndName := nil;
|
|
fAction := nil;
|
|
|
|
inherited;
|
|
end;
|
|
|
|
// ****************************************************************************
|
|
// IExceptionHandler implementation
|
|
// ****************************************************************************
|
|
// ============================================================================
|
|
// GetTypeAndName
|
|
// ============================================================================
|
|
function TExceptionHandler.GetTypeAndName: IToken;
|
|
begin
|
|
result := fTypeAndName;
|
|
end;
|
|
|
|
// ============================================================================
|
|
// GetAction
|
|
// ============================================================================
|
|
function TExceptionHandler.GetAction: IToken;
|
|
begin
|
|
result := fAction;
|
|
end;
|
|
|
|
end.
|