Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / ACE / apps / JAWS3 / jaws3 / Event_Result.h
blob095a557ee3616037e1d7d5c14565453ea0dcbb04
1 /* -*- c++ -*- */
2 #ifndef JAWS_EVENT_RESULT_H
3 #define JAWS_EVENT_RESULT_H
5 #include "ace/OS_NS_errno.h"
6 #include "ace/os_include/os_stddef.h" /* Needed for size_t */
8 #include "jaws3/Export.h"
10 class JAWS_Event_Result;
12 class JAWS_Export JAWS_Event_Result
14 public:
15 enum JE_STATUS
16 { JE_IDLE
17 , JE_OK
18 , JE_PENDING
19 , JE_CANCEL
20 , JE_ERROR
23 enum JE_REASON
24 { JE_NO_REASON
25 , JE_ACCEPT_OK
26 , JE_ACCEPT_PENDING
27 , JE_ACCEPT_TIMEOUT
28 , JE_ACCEPT_FAIL
29 , JE_CONNECT_OK
30 , JE_CONNECT_PENDING
31 , JE_CONNECT_TIMEOUT
32 , JE_CONNECT_FAIL
33 , JE_SEND_OK
34 , JE_SEND_PENDING
35 , JE_SEND_BLOCKED
36 , JE_SEND_SHORT
37 , JE_SEND_TIMEOUT
38 , JE_SEND_FAIL
39 , JE_RECV_OK
40 , JE_RECV_PENDING
41 , JE_RECV_BLOCKED
42 , JE_RECV_SHORT
43 , JE_RECV_TIMEOUT
44 , JE_RECV_FAIL
45 , JE_TRANSMIT_OK
46 , JE_TRANSMIT_PENDING
47 , JE_TRANSMIT_BLOCKED
48 , JE_TRANSMIT_SHORT
49 , JE_TRANSMIT_TIMEOUT
50 , JE_TRANSMIT_FAIL
51 , JE_TIMER_OK
52 , JE_TIMER_CANCEL
53 , JE_TIMER_PENDING
54 , JE_TIMER_FAIL
55 , JE_LAMBDA_OK
56 , JE_LAMBDA_CANCEL
57 , JE_LAMBDA_PENDING
58 , JE_LAMBDA_SHORT
59 , JE_LAMBDA_TIMEOUT
60 , JE_LAMBDA_FAIL
63 JAWS_Event_Result ( size_t bytes = 0
64 , JE_STATUS status = JE_IDLE
65 , JE_REASON reason = JE_NO_REASON
66 , int error_number = -1
67 , void * data = 0
69 : bytes_ (bytes)
70 , status_ (status)
71 , reason_ (reason)
72 , error_number_ (error_number)
73 , data_ (data)
75 if (this->error_number_ == -1)
76 this->error_number_ = errno;
79 size_t bytes () const { return this->bytes_; }
81 int status () const { return this->status_; }
82 int reason () const { return this->reason_; }
84 int error_number () const { return (errno = this->error_number_); }
86 void * data () const { return this->data_; }
88 private:
89 size_t bytes_;
91 JE_STATUS status_;
92 JE_REASON reason_;
94 int error_number_;
96 void *data_;
99 #endif /* JAWS_EVENT_RESULT_H */