home *** CD-ROM | disk | FTP | other *** search
- {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- TechInsite Pty. Ltd.
- PO Box 429, Abbotsford, Melbourne. 3067 Australia
- Phone: +61 3 9419 6456
- Fax: +61 3 9419 1682
- Web: www.techinsite.com.au
- EMail: peter_hinrichsen@techinsite.com.au
-
- Created: 01/06/1999
-
- Notes: Concrete report factory. The TFactoryAbstract is descended from with
- the additional function CreateInstanceExt being added. This function
- calls the concrete factory's CreateInstance and adds some type casting.
-
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
-
- unit FactoryConcreteReport;
-
- interface
- uses
- FactoryAbstract,
- FReportAbstract
- ;
-
- type
-
- // The report factory
- //----------------------------------------------------------------------------
- TFactoryConcreteReport = class( TFactoryAbstract )
- private
- public
- Function CreateInstanceExt( const pStrClassID : string ) :
- TFormReportAbstract ;
-
- end ;
-
- // A function with application wide visibility to surfact the unit wide
- // variable uFactoryConcreteReport
- function gFactoryConcreteReport : TFactoryConcreteReport ;
-
- implementation
- var
- // Hold a single instance of our report factory
- uFactoryConcreteReport : TFactoryConcreteReport ;
-
- // Make sure there is always an report factory available
- //------------------------------------------------------------------------------
- function gFactoryConcreteReport : TFactoryConcreteReport ;
- begin
- if uFactoryConcreteReport = nil then
- uFactoryConcreteReport := TFactoryConcreteReport.Create ;
- result := uFactoryConcreteReport ;
- end ;
-
- // Create an instance of the required class, but add some type casting
- //------------------------------------------------------------------------------
- function TFactoryConcreteReport.CreateInstanceExt(
- const pStrClassID: string): TFormReportAbstract;
- begin
- result := TFormReportAbstract(
- CreateInstance( pStrClassID )) ;
- end;
-
- initialization
- gFactoryConcreteReport ;
-
- finalization
- uFactoryConcreteReport.Free ;
-
- end.
-