2
0

Quick.Mapper.Intf.pas 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. { ***************************************************************************
  2. Copyright (c) 2016-2020 Kike Pérez
  3. Unit : Quick.Mapper.Intf
  4. Description : Quick Mapper Interface
  5. Author : Kike Pérez
  6. Version : 1.8
  7. Created : 07/02/2020
  8. Modified : 14/02/2020
  9. This file is part of QuickLib: https://github.com/exilon/QuickLib
  10. ***************************************************************************
  11. Licensed under the Apache License, Version 2.0 (the "License");
  12. you may not use this file except in compliance with the License.
  13. You may obtain a copy of the License at
  14. http://www.apache.org/licenses/LICENSE-2.0
  15. Unless required by applicable law or agreed to in writing, software
  16. distributed under the License is distributed on an "AS IS" BASIS,
  17. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18. See the License for the specific language governing permissions and
  19. limitations under the License.
  20. *************************************************************************** }
  21. unit Quick.Mapper.Intf;
  22. {$i QuickLib.inc}
  23. interface
  24. type
  25. TMapTarget = record
  26. private
  27. fSrcObj : TObject;
  28. public
  29. constructor Create(aSrcObj : TObject);
  30. function AsType<T : class, constructor> : T;
  31. end;
  32. IMapper = interface
  33. ['{A4EBC4BC-94D0-4F32-98FD-4888E1EF199A}']
  34. procedure Map(aSrcObj, aTgtObj : TObject); overload;
  35. function Map(aSrcObj : TObject) : TMapTarget; overload;
  36. end;
  37. implementation
  38. end.