home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / SRCBDTO.PAK / FUNCTOR.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  837 b   |  33 lines

  1. //-----------------------------------------------------------------------------
  2. // Visual Database Tools
  3. // Copyright (c) 1996 by Borland International, All Rights Reserved
  4. //
  5. // functor.cpp
  6. // C++ Functor template implementation
  7. //
  8. // Based on Functors described in
  9. //  Rich Hickey's 'Callbacks in C++ using template functors' Feb 95 C++ Report
  10. //
  11. //-----------------------------------------------------------------------------
  12.  
  13. #include <vdbt\bdtf.h>
  14.  
  15. #pragma hdrstop
  16.  
  17. #include <memory.h>
  18.  
  19. //-----------------------------------------------------------------------------
  20. //
  21. // Functor base class constructor implentation
  22. //
  23. TFunctorBase::TFunctorBase(const void* c, const void* f, size_t sz)
  24. {
  25.   if (c) {
  26.     Callee = const_cast<void*>(c);
  27.     memcpy(MemberFunc, f, sz);
  28.   }
  29.   else {
  30.     Func = f;
  31.   }
  32. }
  33.