00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef ACE_PRIORITY_REACTOR_H
00014 #define ACE_PRIORITY_REACTOR_H
00015 #include "ace/pre.h"
00016
00017 #include "ace/ACE_export.h"
00018
00019 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00020 # pragma once
00021 #endif
00022
00023 #include "ace/Select_Reactor.h"
00024 #include "ace/Unbounded_Queue.h"
00025
00026 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 class ACE_Export ACE_Priority_Reactor : public ACE_Select_Reactor
00038 {
00039 public:
00040
00041
00042
00043 ACE_Priority_Reactor (ACE_Sig_Handler * = 0,
00044 ACE_Timer_Queue * = 0);
00045
00046
00047 ACE_Priority_Reactor (size_t size,
00048 int restart = 0,
00049 ACE_Sig_Handler * = 0,
00050 ACE_Timer_Queue * = 0);
00051
00052
00053 virtual ~ACE_Priority_Reactor (void);
00054
00055
00056 void dump (void) const;
00057
00058
00059 ACE_ALLOC_HOOK_DECLARE;
00060
00061 protected:
00062
00063
00064
00065
00066 virtual int dispatch_io_set (int number_of_active_handles,
00067 int &number_dispatched,
00068 int mask,
00069 ACE_Handle_Set &dispatch_mask,
00070 ACE_Handle_Set &ready_mask,
00071 ACE_EH_PTMF callback);
00072
00073 private:
00074
00075 void init_bucket (void);
00076
00077
00078
00079 int build_bucket (ACE_Handle_Set& dispatch_mask,
00080 int &min_priority,
00081 int &max_priority);
00082
00083
00084
00085 typedef ACE_Unbounded_Queue<ACE_Event_Tuple> QUEUE;
00086 QUEUE** bucket_;
00087
00088
00089
00090 ACE_Allocator* tuple_allocator_;
00091
00092
00093 ACE_Priority_Reactor (const ACE_Priority_Reactor &);
00094 ACE_Priority_Reactor &operator = (const ACE_Priority_Reactor &);
00095 };
00096
00097 ACE_END_VERSIONED_NAMESPACE_DECL
00098
00099 #include "ace/post.h"
00100 #endif