Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / utils / logWalker / Session.h
blob95f02dc6993b768d224f797b5cf056fad00f5c17
1 // -*- C++ -*-
3 //
5 #ifndef LOG_WALKER_SESSION_H
6 #define LOG_WALKER_SESSION_H
8 #include "ace/Hash_Map_Manager.h"
9 #include "ace/RB_Tree.h"
10 #include "ace/Functor.h"
11 #include "ace/SString.h"
12 #include "ace/Synch.h"
14 class Log;
15 class HostProcess;
16 class Endpoint;
18 typedef ACE_RB_Tree<long, HostProcess *, ACE_Less_Than<long>, ACE_Null_Mutex> Processes;
19 typedef ACE_RB_Tree<ACE_CString, HostProcess *, ACE_Less_Than<ACE_CString>, ACE_Null_Mutex> Procs_By_Name;
20 typedef ACE_Hash_Map_Manager<const ACE_CString, ACE_CString, ACE_Null_Mutex> AltAddresses;
22 class Session
24 public:
25 Session ();
27 ~Session (void);
29 void add_process (HostProcess *proc);
30 HostProcess *find_process (long pid);
31 HostProcess *find_host (const Endpoint &endpoint, bool server);
32 void reconcile (void);
34 static bool set_tao_version (ACE_TCHAR *str);
35 static long tao_version (void);
36 static void alternate_address (const char *string);
37 static bool is_equivalent (const ACE_CString &primary,
38 const ACE_CString &alternate);
39 void default_service (const char *string);
41 void make_dir (const char * ,bool );
42 void outfile (const char * );
44 bool has_dir (void);
45 bool has_outfile (void);
47 void dump ();
48 ostream * stream_for (ostream *old,
49 HostProcess *hp = 0,
50 const char *sub = 0,
51 const char *detail = 0);
53 private:
54 HostProcess *find_host_i (const Endpoint &endpoint, bool server);
56 Processes processes_;
57 Procs_By_Name procs_by_name_;
58 ACE_CString base_dir_;
59 ACE_CString outfile_;
60 bool split_details_;
61 static long tao_version_;
62 static AltAddresses alt_addrs_;
65 #endif // LOG_WALKER_SESSION_H