5 #ifndef LOG_WALKER_PEER_PROCESS_H
6 #define LOG_WALKER_PEER_PROCESS_H
8 #include "ace/SString.h"
10 #include "ace/RB_Tree.h"
11 #include "ace/Functor.h"
12 #include "ace/Containers.h"
13 #include "ace/streams.h"
32 Endpoint (const Endpoint
&other
);
33 Endpoint (const char *addr
, EndpointRole role
= ER_UNKNOWN
);
34 void assign (const char *addr
, EndpointRole role
= ER_UNKNOWN
);
35 Endpoint
& operator = (const Endpoint
&other
);
36 bool operator == (const Endpoint
&other
) const;
37 bool operator < (const Endpoint
&other
) const;
38 bool is_client () const;
50 Transport (const char *addr
, bool is_client
, size_t offset
, const ACE_CString
&time
);
51 void close (size_t offset
, const ACE_CString
&time
);
54 Endpoint client_endpoint_
;
56 ACE_CString open_time_
;
58 ACE_CString close_time_
;
62 typedef ACE_RB_Tree
<u_long
, PeerObject
*, ACE_Less_Than
<u_long
>, ACE_Null_Mutex
> PeerObjectTable
;
63 typedef ACE_RB_Tree
<long, PeerObject
*, ACE_Less_Than
<long>, ACE_Null_Mutex
> ObjectByIndex
;
64 typedef ACE_DLList
<Invocation
> InvocationList
;
65 typedef ACE_DLList
<Transport
> TransportList
;
70 static char *nextIdent(bool is_server
);
71 PeerProcess (size_t offset
, const ACE_CString
&time
, bool is_server
);
73 virtual ~PeerProcess ();
75 const char * id () const;
76 void split_filename (char *buffer
, size_t len
) const;
78 void set_owner (HostProcess
*host
);
79 HostProcess
*owner ();
81 void match_hosts (Session
*session
);
82 void set_server_addr (const ACE_CString
&addr
);
83 const Endpoint
&server_addr () const;
84 const Endpoint
&last_client_addr () const;
86 bool is_server () const;
87 size_t offset () const;
88 void ssl (bool is_ssl
);
89 void add_transport (Transport
*t
);
90 Transport
*last_transport ();
91 Transport
*find_transport (long handle
);
93 bool match_local (const char *addr
) const;
94 bool match_server_addr (const Endpoint
&addr
) const;
96 Invocation
*new_invocation (size_t req_id
, Thread
*thr
);
97 Invocation
*find_invocation (size_t req_id
, long handle
);
98 Invocation
*find_invocation_size (size_t len
);
100 PeerObject
*object_for(const char *oid
, size_t len
);
102 virtual void dump_summary (ostream
&strm
);
103 virtual void dump_object_detail (ostream
&strm
);
104 virtual void dump_invocation_detail (ostream
&strm
);
110 HostProcess
*remote_
;
112 TransportList transports_
;
113 Transport
*last_transport_
;
114 bool is_server_role_
;
116 size_t origin_offset_
;
117 PeerObjectTable objects_
;
118 InvocationList invocations_
;
119 ObjectByIndex object_by_index_
;
120 ACE_CString first_time_
;
124 #endif // LOG_WALKER_PEER_PROCESS_H