wsdlpull
1.23
Toggle main menu visibility
Loading...
Searching...
No Matches
src
wsdlparser
PortType.h
Go to the documentation of this file.
1
/*
2
* wsdlpull - A C++ parser for WSDL (Web services description language)
3
* Copyright (C) 2005-2007 Vivek Krishna
4
*
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Library General Public
7
* License as published by the Free Software Foundation; either
8
* version 2 of the License, or (at your option) any later version.
9
*
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Library General Public License for more details.
14
*
15
* You should have received a copy of the GNU Library General Public
16
* License along with this library; if not, write to the Free
17
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
*
19
*
20
*/
21
#ifndef _PORTTYPEH
22
#define _PORTTYPEH
23
24
#include "
wsdlparser/Operation.h
"
25
#include "
wsdlparser/Binding.h
"
26
#include "
xmlpull/wsdlpull_export.h
"
27
28
namespace
WsdlPull
{
29
//This class implements a port type of WSDL .
30
class
WSDLPULL_EXPORT
PortType
:
public
WsdlElement
31
{
32
public
:
33
typedef
std::list<PortType*>::iterator
PortTypeIterator
;
34
typedef
std::list<PortType*>::const_iterator
cPortTypeIterator
;
35
36
PortType
(
WsdlParser
& w);
37
~PortType
();
40
41
int
getNumOps
(
void
)
const
;
42
48
const
Operation
*
getOperation
(
int
index)
const
;
49
55
const
Operation
*
getOperation
(
const
Qname
& name)
const
;
56
int
getOperationIndex
(
const
Qname
& name)
const
;
57
63
bool
getOperations
(
Operation::cOpIterator
& start ,
Operation::cOpIterator
& finish)
const
;
64
71
72
const
Binding
*
binding
(
const
std::string & nsp)
const
;
73
75
78
void
addOp
(
Operation
* op);
79
void
setBinding
(
Binding
* bn);
81
private
:
82
std::vector<Operation *> ops_;
83
std::vector<const Binding *> bindings_;
84
};
85
86
inline
87
PortType::PortType
(
WsdlParser
& w)
88
:
WsdlElement
(w)
89
{
90
ops_.clear() ;
91
}
92
inline
93
PortType::~PortType
()
94
{
95
for
(
size_t
i = 0; i < ops_.size(); i++)
96
delete
ops_[i];
97
98
}
99
100
inline
101
int
102
PortType::getNumOps
(
void
)
const
103
{
104
return
ops_.size();
105
}
106
107
inline
108
const
Operation
*
109
PortType::getOperation
(
int
index)
const
110
{
111
return
ops_[index];
112
}
113
114
inline
115
int
116
PortType::getOperationIndex
(
const
Qname
& name)
const
117
{
118
for
(
size_t
i = 0; i < ops_.size(); i++)
119
{
120
if
(ops_[i]->
getName
() == name.
getLocalName
())
121
return
i;
122
}
123
return
0;
124
}
125
126
inline
127
const
Operation
*
128
PortType::getOperation
(
const
Qname
& name)
const
129
{
130
for
(
size_t
i = 0; i < ops_.size(); i++)
131
{
132
if
(ops_[i]->
getName
() == name.
getLocalName
())
133
return
ops_[i];
134
}
135
return
0;
136
}
137
138
inline
139
bool
140
PortType::getOperations
(
Operation::cOpIterator
& start ,
141
Operation::cOpIterator
& finish)
const
142
{
143
start=ops_.begin();
144
finish=ops_.end();
145
return
true
;
146
}
147
148
149
inline
150
void
151
PortType::addOp
(
Operation
* op)
152
{
153
ops_.push_back(op);
154
}
155
156
inline
157
void
158
PortType::setBinding
(
Binding
* bn)
159
{
160
bindings_.push_back(bn);
161
}
162
163
inline
164
const
Binding
*
165
PortType::binding
(
const
std::string & nsp)
const
166
{
167
for
(
unsigned
int
i = 0; i<bindings_.size();i++){
168
if
(bindings_[i]->getBindingMethod() == nsp)
169
return
bindings_[i];
170
}
171
return
0;
172
}
173
}
174
#endif
/* */
Binding.h
Operation.h
Qname
Definition
Qname.h:31
Qname::getLocalName
std::string getLocalName(void) const
Definition
Qname.h:76
WsdlPull::Binding
Definition
Binding.h:33
WsdlPull::Operation
Definition
Operation.h:54
WsdlPull::Operation::cOpIterator
std::vector< Operation * >::const_iterator cOpIterator
Definition
Operation.h:57
WsdlPull::PortType::binding
const Binding * binding(const std::string &nsp) const
Definition
PortType.h:165
WsdlPull::PortType::PortTypeIterator
std::list< PortType * >::iterator PortTypeIterator
Definition
PortType.h:33
WsdlPull::PortType::PortType
PortType(WsdlParser &w)
Definition
PortType.h:87
WsdlPull::PortType::getOperation
const Operation * getOperation(int index) const
Definition
PortType.h:109
WsdlPull::PortType::getOperationIndex
int getOperationIndex(const Qname &name) const
Definition
PortType.h:116
WsdlPull::PortType::addOp
void addOp(Operation *op)
Definition
PortType.h:151
WsdlPull::PortType::~PortType
~PortType()
Definition
PortType.h:93
WsdlPull::PortType::cPortTypeIterator
std::list< PortType * >::const_iterator cPortTypeIterator
Definition
PortType.h:34
WsdlPull::PortType::getOperations
bool getOperations(Operation::cOpIterator &start, Operation::cOpIterator &finish) const
Definition
PortType.h:140
WsdlPull::PortType::getNumOps
int getNumOps(void) const
Definition
PortType.h:102
WsdlPull::PortType::setBinding
void setBinding(Binding *bn)
Definition
PortType.h:158
WsdlPull::WsdlElement::getName
std::string getName() const
Definition
WsdlElement.h:110
WsdlPull::WsdlElement::WsdlElement
WsdlElement(WsdlParser &w)
Definition
WsdlElement.h:95
WsdlPull::WsdlParser
Definition
WsdlParser.h:44
WsdlPull
Definition
Binding.h:27
wsdlpull_export.h
WSDLPULL_EXPORT
#define WSDLPULL_EXPORT
Definition
wsdlpull_export.h:30
Generated by
1.17.0