All pastes #467450 Raw Edit

Someone

public text v1 · immutable
·published 2007-05-02 14:57 UTC
rendered paste body
unit WebMap;

interface
	
	uses Template;
	
	type
		TWebCallback = procedure (const T : TTemplate);

	procedure Register (const uri : string; callback : TWebCallback);
	function Get (const uri : string) : TWebCallback;
	procedure Close;

implementation

	uses 
		contnrs;

	var
		uris : TFPHashTable;
	
	procedure Register (const uri : string; callback : TWebCallback);
	begin
		uris.Add(uri, callback);
	end;
	
	function Get (const uri : string) : TWebCallback;
	begin
		Get := TWebCallback(uris[uri]);
	end;
	
	procedure Close;
	begin
		uris.Destroy;
	end;

initialization

	uris := TFPHashTable.Create;

end.