wsdlpull 1.23
Loading...
Searching...
No Matches
Service.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
22#ifndef _SERVICEH
23#define _SERVICEH
24
27
28namespace WsdlPull {
29class Binding;
30
32public:
33 typedef struct {
34 std::string name_;
38 typedef std::list<ServicePort>::const_iterator cServicePortIterator;
39
40public:
42
45
46 void addPort(const std::string& name,const Binding* bn,int serviceExtId);
47
48 int getPortExtension(const std::string& name)const;
49 const Binding* getPortBinding(const std::string& name)const;
50 void getPortBindings(cServicePortIterator &from, cServicePortIterator &to)const;
51 std::list<std::string> getPorts()const;
53private:
54
55 std::list<ServicePort> ports_;
56};
57
58
59inline
61 :WsdlElement(w)
62{
63}
64inline
65void
66Service::addPort(const std::string& n,const Binding* bn,int serviceExtId)
67{
68 ServicePort sp;
69 sp.name_=n;
70 sp.binding_ = bn;
71 sp.serviceExtId_ = serviceExtId;
72 ports_.push_back(sp);
73}
74
75inline
76int
77Service::getPortExtension(const std::string & name)const
78{
79 for(std::list<ServicePort>::const_iterator it = ports_.begin();
80 it != ports_.end();
81 it++){
82 if(it->name_ == name)
83 return it->serviceExtId_;
84 }
85 return 0;
86}
87
88inline
89const Binding*
90Service::getPortBinding(const std::string & name)const
91{
92 for(std::list<ServicePort>::const_iterator it = ports_.begin();
93 it != ports_.end();
94 it++){
95 if(it->name_ == name)
96 return it->binding_;
97 }
98 return 0;
99}
100
101inline
102void
104 cServicePortIterator &to)const
105{
106 if (ports_.size()> 0)
107 {
108 from = ports_.begin();
109 to = ports_.end();
110 }
111}
112
113inline
114std::list<std::string>
116{
117 std::list<std::string> names;
118 for(std::list<ServicePort>::const_iterator it = ports_.begin();
119 it != ports_.end();
120 it++){
121 names.push_back(it->name_);
122 }
123 return names;
124}
125}
126#endif
127
void getPortBindings(cServicePortIterator &from, cServicePortIterator &to) const
Definition Service.h:103
std::list< ServicePort >::const_iterator cServicePortIterator
Definition Service.h:38
std::list< std::string > getPorts() const
Definition Service.h:115
const Binding * getPortBinding(const std::string &name) const
Definition Service.h:90
int getPortExtension(const std::string &name) const
Definition Service.h:77
void addPort(const std::string &name, const Binding *bn, int serviceExtId)
Definition Service.h:66
Service(WsdlParser &w)
Definition Service.h:60
const Binding * binding_
Definition Service.h:35
#define WSDLPULL_EXPORT