diff options
author | bala <balanatarajan@users.noreply.github.com> | 2001-07-06 04:41:00 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2001-07-06 04:41:00 +0000 |
commit | a13a1180fc884a9ccb22299f29b4285879739028 (patch) | |
tree | 3874c3e46e81a1a1c5a6c459720e1c17cab62da2 /TAO/tao/Resume_Handle.h | |
parent | f808d5a4f39c81e8f0c90723d2b710c09e07b049 (diff) | |
download | ATCD-a13a1180fc884a9ccb22299f29b4285879739028.tar.gz |
ChangeLogTag: Thu Jul 5 23:30:07 2001 Balachandran Natarajan <bala@cs.wustl.edu>
Diffstat (limited to 'TAO/tao/Resume_Handle.h')
-rw-r--r-- | TAO/tao/Resume_Handle.h | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/TAO/tao/Resume_Handle.h b/TAO/tao/Resume_Handle.h new file mode 100644 index 00000000000..36449fad030 --- /dev/null +++ b/TAO/tao/Resume_Handle.h @@ -0,0 +1,90 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Resume_Handle.h + * + * $Id$ + * + * @author Balachandran Natarajan <bala@cs.wustl.edu> + */ +//============================================================================= + +#ifndef TAO_RESUME_HANDLE_H +#define TAO_RESUME_HANDLE_H +#include "ace/pre.h" + +#include "TAO_Export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +class TAO_ORB_Core; + + +/** + * @class TAO_Resume_Handle + * + * @brief A utility class that helps in resuming handlers if TAO uses + * a TP Reactor from ACE. + * + * Please read the documentation in the bugzilla #575 in the bugzilla + * database what we mean by handler resumption. + * + * When TAO uses a TP reactor, it takes care of resuming the handler + * once it makes sure that it has read the whole message out of the + * socket. During the process of reading the transport object would + * have to deal with errors in 'read' from the socket, or errors in + * the messages that has been received. Instead of calling + * resume_handler () on the reactor at every point in the code, we + * use this utility class to take care of the resumption. + */ + +class TAO_Export TAO_Resume_Handle +{ + +public: + + /// Ctor. + TAO_Resume_Handle (TAO_ORB_Core *orb_core = 0, + ACE_HANDLE h = ACE_INVALID_HANDLE); + /// Dtor + ~TAO_Resume_Handle (void); + + enum TAO_Handle_Resume_Flag + { + TAO_HANDLE_RESUMABLE = 0, + TAO_HANDLE_ALREADY_RESUMED, + TAO_HANDLE_LEAVE_SUSPENDED + }; + + /// Allow the users of this class to change the underlying flag. + void set_flag (TAO_Handle_Resume_Flag fl); + + /// Equal to operator.. + TAO_Resume_Handle &operator= (const TAO_Resume_Handle &rhs); + + /// Resume the handle in the reactor only if the ORB uses a TP + /// reactor. Else we dont resume the handle. + void resume_handle (void); + +private: + + /// Our ORB Core. + TAO_ORB_Core *orb_core_; + + /// The actual handle that needs resumption.. + ACE_HANDLE handle_; + + /// Th flag for indicating whether the handle has been resumed or + /// not. A value of '0' indicates that the handle needs resumption. + TAO_Handle_Resume_Flag flag_; +}; + +#if defined (__ACE_INLINE__) +# include "Resume_Handle.inl" +#endif /* __ACE_INLINE__ */ + +#include "ace/pre.h" +#endif /*TAO_RESUME_HANDLE*/ |