summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be_include/be_visitor_factory.h
blob: 2061b51bb0466ea01f8b935d560f1209ba4941f0 (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
// $Id$

/* -*- c++ -*- */
// ============================================================================
//
// = LIBRARY
//    TAO IDL Backend
//
// = FILENAME
//    be_visitor_factory.h
//
// = DESCRIPTION
//    Define an abstract visitor Factory and a bunch of concrete visitor
//    factories (whcih are singletons).
//
// = AUTHOR
//    Aniruddha Gokhale
//
// ============================================================================

#ifndef TAO_BE_VISITOR_FACTORY_H
#define TAO_BE_VISITOR_FACTORY_H

class TAO_Visitor_Factory
{
  // =TITLE
  //   TAO_Visitor_Factory
  //
  // =DESCRIPTION
  //   An abstract visitor factory class

public:

  TAO_Visitor_Factory (void);
  // constructor

  virtual ~TAO_Visitor_Factory (void);
  // destructor

  virtual be_visitor *make_visitor (be_visitor_context *) = 0;
  // make a visitor
};

class TAO_Common_Visitor_Factory : public TAO_Visitor_Factory
{
  // =TITLE
  //   TAO_Common_Visitor_Factory
  //
  // =DESCRIPTION
  //   A concrete visitor factory for generating the visitors irrsepective of
  //   whether we use compiled or interpretive marshaling

public:

  TAO_Common_Visitor_Factory (void);
  // constructor

  virtual ~TAO_Common_Visitor_Factory (void);
  // destructor

  virtual be_visitor *make_visitor (be_visitor_context *);
  // make the right visitor based on the context and code generation state
};

class TAO_Interpretive_Visitor_Factory : public TAO_Visitor_Factory
{
  // =TITLE
  //   TAO_Interpretive_Visitor_Factory
  //
  // =DESCRIPTION
  //   A concrete visitor factory for generating the visitors for stubs and
  //   skeletons using interpretive marshaling.

public:

  TAO_Interpretive_Visitor_Factory (void);
  // constructor

  virtual ~TAO_Interpretive_Visitor_Factory (void);
  // destructor

  virtual be_visitor *make_visitor (be_visitor_context *);
  // make the right visitor based on the context and code generation state
};

class TAO_Compiled_Visitor_Factory : public TAO_Visitor_Factory
{
  // =TITLE
  //   TAO_Compiled_Visitor_Factory
  //
  // =DESCRIPTION
  //   A concrete visitor factory for generating the visitors for stubs and
  //   skeletons using compiled marshaling.

public:

  TAO_Compiled_Visitor_Factory (void);
  // constructor

  virtual ~TAO_Compiled_Visitor_Factory (void);
  // destructor

  virtual be_visitor *make_visitor (be_visitor_context *);
  // make the right visitor based on the context and code generation state
};

// Singleton instance of the BE Visitor Factory
typedef ACE_Singleton<TAO_Common_Visitor_Factory, ACE_SYNCH_RECURSIVE_MUTEX> TAO_COMMON_VISITOR_FACTORY;
typedef ACE_Singleton<TAO_Interpretive_Visitor_Factory, ACE_SYNCH_RECURSIVE_MUTEX> TAO_INTERPRETIVE_VISITOR_FACTORY;
typedef ACE_Singleton<TAO_Compiled_Visitor_Factory, ACE_SYNCH_RECURSIVE_MUTEX> TAO_COMPILED_VISITOR_FACTORY;

#endif /* if !defined _TAO_BE_VISITOR_FACTORY_H_ */