summaryrefslogtreecommitdiff
path: root/ACE/TAO/utils/logWalker/Log.h
blob: 8b346c311474c959960e12075dfe704159b16779 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// -*- C++ -*-

// $Id$
// 

#ifndef LOG_WALKER_LOG_H
#define LOG_WALKER_LOG_H

#include "ace/Containers.h"
#include "ace/Synch.h"
#include "ace/SString.h"
#include "PeerProcess.h"
#include "HostProcess.h"

class Session;
class HostProcess;

typedef ACE_DLList<HostProcess> HostProcesses;

class Log
{
public:
  Log (Session &s);

  ~Log();

  bool init (const ACE_TCHAR *filename, const char *alias = "");

  void summarize(void);

  void dump (ostream &strm);

private:
  typedef void (* parser_func)(Log *this_, char *line, size_t offset);

  struct parse_key
  {
    const char *text;
    parser_func op;
  };

  bool get_pid_tid (long &pid, long &tid, char *line);
  HostProcess *get_host (long pid);
  void handle_msg_dump (char *line, size_t offset);
  void parse_line (char* line, size_t offset);

  static void parse_handler_open (Log *this_, char *line, size_t offset);
  static void parse_dump_msg (Log *this_, char *line, size_t offset);
  static void parse_HEXDUMP (Log *this_, char *line, size_t offset);
  static void parse_open_listener (Log *this_, char *line, size_t offset);
  static void parse_got_existing (Log *this_, char *line, size_t offset);
  static void parse_muxed_tms (Log *this_, char *line, size_t offset);
  static void parse_exclusive_tms (Log *this_, char *line, size_t offset);
  static void parse_process_parsed_msgs (Log *this_, char *line, size_t offset);
  static void parse_wait_for_event (Log *this_, char *line, size_t offset);
  static void parse_cleanup_queue (Log *this_, char *line, size_t offset);
  static void parse_close_connection (Log *this_, char *line, size_t offset);
  static void parse_begin_connection (Log *this_, char *line, size_t offset);
  static void parse_local_addr (Log *this_, char *line, size_t offset);
  static void parse_open_as_server (Log *this_, char *line, size_t offset);

  ACE_CString origin_;
  ACE_CString alias_;
  Session &session_;
  HostProcesses procs_;
  Invocation::GIOP_Buffer* dump_target_;
  ThreadList giop_waiters_;

};

#endif // LOG_WALKER_LOG_H