diff options
author | cdgill <cdgill@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-10-07 14:28:32 +0000 |
---|---|---|
committer | cdgill <cdgill@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-10-07 14:28:32 +0000 |
commit | 046cdb59ca429e55ac2a09500b0a471be35a96c9 (patch) | |
tree | 52bd8018782fe78f31837d97009d6462775c2866 /ace/Functor_T.cpp | |
parent | a989c05e953ddd084f84341f1f3ffa1279c2f096 (diff) | |
download | ATCD-046cdb59ca429e55ac2a09500b0a471be35a96c9.tar.gz |
Added ACE_Command_Base and ACE_Command_Callback, added deferred callbacks to ACE_Thread_Timer_Queue_Adapter
Diffstat (limited to 'ace/Functor_T.cpp')
-rw-r--r-- | ace/Functor_T.cpp | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/ace/Functor_T.cpp b/ace/Functor_T.cpp new file mode 100644 index 00000000000..98758932b5d --- /dev/null +++ b/ace/Functor_T.cpp @@ -0,0 +1,63 @@ +/* -*- C++ -*- */ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// ace +// +// = FILENAME +// Functor_T.cpp +// +// = DESCRIPTION +// Non-inlinable method definitions for templatized classes +// implementing the GOF Command Pattern, also known as functors +// or function objects. +// +// = AUTHOR +// Chris Gill <cdgill@cs.wustl.edu> +// +// Based on Command Pattern implementations originally done by +// +// Carlos O'Ryan <coryan@cs.wustl.edu> and +// Douglas C. Schmidt <schmidt@cs.wustl.edu> and +// Sergio Flores-Gaitan <sergio@cs.wustl.edu> +// +// ============================================================================ + +#if !defined (ACE_FUNCTOR_T_C) +#define ACE_FUNCTOR_T_C + +#define ACE_BUILD_DLL +#include "ace/Functor_T.h" + +#if !defined (__ACE_INLINE__) +#include "ace/Functor_T.i" +#endif /* __ACE_INLINE__ */ + +ACE_RCSID(ace, Functor_T, "$Id$") + +ACE_ALLOC_HOOK_DEFINE(ACE_Command_Callback) + +// Constructor. + +template <class RECEIVER, class ACTION> +ACE_Command_Callback<RECEIVER, ACTION>::ACE_Command_Callback (RECEIVER &recvr, + ACTION action) + : receiver_ (recvr), + action_ (action) +{ +} + +// Invokes an operation. + +template <class RECEIVER, class ACTION> int +ACE_Command_Callback<RECEIVER, ACTION>::execute (void *arg) +{ + return (receiver_.*action_) (arg); +} + + +#endif /* ACE_FUNCTOR_T_C */ + +// EOF |