Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / utils / logWalker / GIOP_Buffer.h
blobc3331b917716de7176edb0fd51c8e388a39b3f6d
1 // -*- C++ -*-
3 //
5 #ifndef LOG_WALKER_GIOP_BUFFER_H
6 #define LOG_WALKER_GIOP_BUFFER_H
8 #include "ace/SString.h"
9 #include "ace/CDR_Stream.h"
11 class Invocation;
12 class Thread;
14 // Invocation holds the buffer contents for a request/response pair.
15 // This could be originating in this process, or in the peer process.
17 // The trigger for finding a new outgoing invocation is "Muxed_TMS[%d]"
18 // following that the process/thread will perform a dump_msg.
20 // The trigger for finding a new incoming invocation is
21 // "Transport[%d]::process_parsed_messages, entering (missing data == 0)"
22 // which could indicate a new request or reply, depending on the context
23 // in which the peer connection is made.
25 // It is possible that two or more threads may call dump_msg
26 // concurrently and thus have the preamble and body printed out of
27 // order. The HEXDUMP always reports a buffer size including the 12
28 // byte GIOP header. Also, the first line of the text contains header
29 // data which can be compared to the expected request ID.
31 class GIOP_Buffer
33 public:
34 static const char *size_leadin;
35 static size_t leadin_len;
36 static const size_t giop_header_len;
37 static void init_leadin (int version);
39 GIOP_Buffer (const char *text,
40 size_t offset,
41 Thread *thread,
42 Invocation *owner = 0);
43 GIOP_Buffer ();
44 ~GIOP_Buffer ();
46 void owner (Invocation *);
47 Invocation *owner ();
49 void init_buf (const char *text, size_t offset);
50 int add_octets(const char *text, size_t offset);
51 char type () const;
52 char expected_type () const;
53 bool sending () const;
54 char minor_version () const;
55 size_t reply_status () const;
56 size_t num_contexts () const;
57 bool is_oneway ();
58 bool is_full () const;
59 size_t log_posn () const;
60 Thread *thread ();
62 const ACE_Time_Value & time () const;
63 void time (const ACE_Time_Value &);
65 const ACE_CString &preamble() const;
66 size_t expected_req_id() const;
67 size_t actual_req_id();
69 size_t expected_size () const;
70 size_t buf_size () const;
71 size_t cur_size() const;
72 size_t msg_size ();
74 const char * target_oid (size_t &len);
75 const char * operation ();
76 ACE_InputCDR &payload ();
78 bool has_octets () const;
79 bool validate ();
80 bool matches (GIOP_Buffer *other) const;
82 void reset ();
83 void transfer_from (GIOP_Buffer *other);
84 void swap (GIOP_Buffer *other);
86 private:
87 bool parse_svc_contexts ();
88 bool parse_header ();
90 ACE_InputCDR *cdr_;
91 ACE_CString preamble_;
92 size_t log_offset_;
93 Thread *thr_;
94 ACE_Time_Value time_;
95 size_t expected_req_id_;
96 size_t expected_size_;
97 char expected_type_;
98 size_t buffer_size_;
99 char * wr_pos_;
100 char * octets_;
101 Invocation *owner_;
102 bool buffer_lost_;
103 bool sending_;
104 char * oid_;
105 size_t oid_len_;
106 char * opname_;
107 size_t req_id_;
108 char resp_exp_;
109 size_t reply_status_;
110 char ver_minor_;
111 size_t msg_size_;
112 size_t num_contexts_;
113 bool header_parsed_;
114 char * payload_start_;
115 size_t payload_size_;
118 #endif // LOG_WALKER_GIOP_BUFFER_H