Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

Service.h

Go to the documentation of this file.
00001 /* 
00002  * wsdlpull - A C++ parser  for WSDL  (Web services description language)
00003  * Copyright (C) 2005-2007 Vivek Krishna
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Library General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2 of the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Library General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Library General Public
00016  * License along with this library; if not, write to the Free
00017  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018  *
00019  *
00020  */
00021 
00022 #ifndef _SERVICEH
00023 #define  _SERVICEH
00024 
00025 #include "wsdlparser/WsdlElement.h"
00026 
00027 namespace WsdlPull {
00028 class Binding;
00029 
00030 class WSDLPULL_EXPORT Service :public WsdlElement {
00031   
00032 public:  
00033   Service(WsdlParser & w);
00034   
00037    
00038   void addPort(const std::string& name,const Binding* bn,int serviceExtId);
00039  
00040   int getPortExtension(const std::string& name);
00041   const Binding* getPortBinding(const std::string& name);
00043 private:
00044    
00045   typedef struct {
00046     std::string name_;
00047     const Binding* binding_;
00048     int serviceExtId_;
00049   }ServicePort;
00050   std::list<ServicePort> ports_;
00051 };
00052 
00053   
00054 inline
00055 Service::Service(WsdlParser& w)
00056   :WsdlElement(w)
00057 {
00058 }
00059 inline
00060 void
00061 Service::addPort(const std::string& n,const Binding* bn,int serviceExtId)
00062 {
00063   ServicePort sp;
00064   sp.name_=n;
00065   sp.binding_ = bn;
00066   sp.serviceExtId_ = serviceExtId;
00067 }
00068 
00069 inline
00070 int
00071 Service::getPortExtension(const std::string & name)
00072 {
00073   for(std::list<ServicePort>::iterator it = ports_.begin();
00074       it != ports_.end();
00075       it++){
00076     if(it->name_ == name)
00077       return it->serviceExtId_;
00078   }
00079   return 0;
00080 }
00081 
00082 inline 
00083 const Binding*
00084 Service::getPortBinding(const std::string & name)
00085 {
00086   for(std::list<ServicePort>::iterator it = ports_.begin();
00087       it != ports_.end();
00088       it++){
00089     if(it->name_ == name)
00090       return it->binding_;
00091   }
00092   return 0;
00093 }
00094 }
00095 #endif
00096 

Generated on Mon Feb 6 23:02:42 2006 for wsdlpull by  doxygen 1.3.9.1