summaryrefslogtreecommitdiff
path: root/ace/Functor.h
diff options
context:
space:
mode:
authorcdgill <cdgill@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-10-07 14:28:32 +0000
committercdgill <cdgill@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-10-07 14:28:32 +0000
commit046cdb59ca429e55ac2a09500b0a471be35a96c9 (patch)
tree52bd8018782fe78f31837d97009d6462775c2866 /ace/Functor.h
parenta989c05e953ddd084f84341f1f3ffa1279c2f096 (diff)
downloadATCD-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.h')
-rw-r--r--ace/Functor.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/ace/Functor.h b/ace/Functor.h
new file mode 100644
index 00000000000..6095dc18742
--- /dev/null
+++ b/ace/Functor.h
@@ -0,0 +1,69 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// ace
+//
+// = FILENAME
+// Functor.h
+//
+// = DESCRIPTION
+// Non-templatized classes for 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_H)
+#define ACE_FUNCTOR_H
+
+#include "ace/OS.h"
+
+class ACE_Command_Base
+{
+ // = TITLE
+ // Defines an abstract class that allows us to invoke commands
+ // without knowing anything about the implementation.
+ //
+ // = DESCRIPTION
+ // This class declares an interface to execute a command
+ // independent of the effect of the command, or the objects used
+ // to implement it.
+public:
+
+ ACE_Command_Base (void) {}
+ // Default constructor.
+
+ virtual ~ACE_Command_Base (void) {}
+ // Virtaul destructor.
+
+ virtual int execute (void *arg = 0) = 0;
+ // Invokes the method encapsulated by the command, passing along the
+ // passed argument (if any). Users of classes derived from this
+ // class must ensure that the resulting invocation can tolerate
+ // a null void pointer being passed, or otherwise ensure that
+ // this will never occur.
+};
+
+
+#if defined (__ACE_INLINE__)
+#include "ace/Functor.i"
+#endif /* __ACE_INLINE__ */
+
+// Include the templates here.
+#include "ace/Functor_T.h"
+
+
+#endif /* ACE_FUNCTOR_H */
+
+// EOF