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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
|
// **********************************************************************
//
// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
#ifndef ICEPACK_DESCRIPTOR_VISITOR_H
#define ICEPACK_DESCRIPTOR_VISITOR_H
namespace IcePack
{
class ApplicationWrapper;
class ServerWrapper;
class ServiceWrapper;
class AdapterWrapper;
class ObjectWrapper;
class DbEnvWrapper;
class DescriptorVisitor
{
public:
virtual ~DescriptorVisitor() { }
virtual bool visitApplicationStart(const ApplicationWrapper&, const ApplicationDescriptorPtr&) { return true; }
virtual void visitApplicationEnd(const ApplicationWrapper&, const ApplicationDescriptorPtr&) { }
virtual bool visitServerStart(const ServerWrapper&, const ServerDescriptorPtr&) { return true; }
virtual void visitServerEnd(const ServerWrapper&, const ServerDescriptorPtr&) { }
virtual bool visitServiceStart(const ServiceWrapper&, const ServiceDescriptorPtr&) { return true; }
virtual void visitServiceEnd(const ServiceWrapper&, const ServiceDescriptorPtr&) { }
virtual bool visitAdapterStart(const AdapterWrapper&, const AdapterDescriptor&) { return true; }
virtual void visitAdapterEnd(const AdapterWrapper&, const AdapterDescriptor&) { }
virtual void visitDbEnv(const DbEnvWrapper&, const DbEnvDescriptor&) { }
virtual void visitObject(const ObjectWrapper&, const ObjectDescriptor&) { }
};
class ApplicationWrapper
{
public:
ApplicationWrapper(const ApplicationDescriptorPtr&);
void visit(DescriptorVisitor&);
const ApplicationDescriptorPtr& getDescriptor() const;
private:
const ApplicationDescriptorPtr _descriptor;
};
class ComponentWrapper
{
public:
ComponentWrapper(const ComponentDescriptorPtr&);
void visit(DescriptorVisitor&);
private:
ComponentDescriptorPtr _descriptor;
};
class ServerWrapper : public ComponentWrapper
{
public:
ServerWrapper(const ServerDescriptorPtr&);
void visit(DescriptorVisitor&);
const ServerDescriptorPtr& getDescriptor() const;
private:
ServerDescriptorPtr _descriptor;
};
class ServiceWrapper : public ComponentWrapper
{
public:
ServiceWrapper(const ServerWrapper&, const ServiceDescriptorPtr&);
void visit(DescriptorVisitor&);
const ServiceDescriptorPtr& getDescriptor() const;
private:
const ServerWrapper& _server;
ServiceDescriptorPtr _descriptor;
};
class DbEnvWrapper
{
public:
DbEnvWrapper(const ComponentWrapper&, const DbEnvDescriptor&);
void visit(DescriptorVisitor&);
const DbEnvDescriptor& getDescriptor() const;
private:
const ComponentWrapper& _component;
const DbEnvDescriptor& _descriptor;
};
class AdapterWrapper
{
public:
AdapterWrapper(const ComponentWrapper&, const AdapterDescriptor&);
void visit(DescriptorVisitor&);
const AdapterDescriptor& getDescriptor() const;
private:
const ComponentWrapper& _component;
const AdapterDescriptor& _descriptor;
};
class ObjectWrapper
{
public:
ObjectWrapper(const AdapterWrapper&, const ObjectDescriptor&);
void visit(DescriptorVisitor&);
const ObjectDescriptor& getDescriptor() const;
private:
const AdapterWrapper& _adapter;
const ObjectDescriptor& _descriptor;
};
}
#endif
|