summaryrefslogtreecommitdiff
path: root/TAO/examples/Simulator/DOVEMIB/PrintVisitor.h
blob: b2b2a6f28a0a2904cf2ebe7bc2f42b0dcd962a1d (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
// $Id$
// ============================================================================
//
// = LIBRARY
//
// = FILENAME
//    PrintVisitor.h
//
// = AUTHOR
//    Michael Kircher
//
// = DESCRIPTION
//    This file descibes the PrintVisitor used by the any evaluator.
//
// ============================================================================

#include "tao/corba.h"
#include "NodeVisitor.h"
#include "Node.h"

#ifndef PRINT_VISITOR_H
#define PRINT_VISITOR_H


// This is a concrete Visitor using the Visitor design pattern
class PrintVisitor : public NodeVisitor {
public:

  PrintVisitor (const char *file_name);
  virtual ~PrintVisitor ();

  void printTimeStamp (ACE_hrtime_t creation,
                       ACE_hrtime_t ec_recv,
                       ACE_hrtime_t ec_send);
  // Print the time stamp

  void close ();

  void visitStructNode (StructNode *structNode);
  void visitDoubleNode (DoubleNode *doubleNode);
  void visitLongNode (LongNode *longNode);
  void visitULongNode (ULongNode *uLongNode);
  void visitStringNode (StringNode *stringNode);
private:
  void printPadding (unsigned int recursion_level);
  void printSecNanoSec (ACE_hrtime_t total_nanoseconds);

  FILE *output_;
};

#endif // PRINT_VISITOR_H