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

Constraint.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 #ifndef CONSTRAINT_H
00022 #define CONSTRAINT_H
00023 // *********************************************************************
00024 // Include files:
00025 // *********************************************************************
00026 #include <string>
00027 #include <list>
00028 #include "xmlpull/wsdlpull_export.h"
00029 #include "schemaparser/Schema.h"
00030 
00031 namespace Schema {
00032 class WSDLPULL_EXPORT Constraint
00033 {
00034 public:
00035   Constraint(Schema::Constraints c);
00036   
00037   std::string getName()const;
00038   void setName(const std::string & n);
00039   Schema::Constraints * getConstraintType();
00040   void setSelector(const std::string & xpath);
00041   void addField(const std::string &xpath);
00042   std::string selector()const;
00043   const std::list<std::string>& fields();
00044 
00045   void setAnnotation(const std::string & s);
00046     
00047 private:
00048   Schema::Constraints m_constraints;
00049   std::string m_name,m_annotation;
00050   std::string m_selector;
00051   std::list<std::string> m_fields;
00052 };
00053 
00054 inline
00055 Constraint::Constraint(Schema::Constraints c)
00056   :m_constraints(c)
00057 {
00058   m_fields.clear();
00059 }
00060 
00061 inline
00062 void
00063 Constraint::setSelector(const std::string & xpath)
00064 {
00065   m_selector=xpath;
00066 }
00067 
00068 inline
00069 std::string
00070 Constraint::selector()const
00071 {
00072   return m_selector;
00073 }
00074 
00075 inline
00076 const std::list<std::string>&
00077 Constraint::fields()
00078 {
00079   return m_fields;
00080 }
00081 
00082 inline
00083 void
00084 Constraint::addField(const std::string & xpath)
00085 {
00086   m_fields.push_back(xpath);
00087 }
00088 
00089 inline
00090 std::string 
00091 Constraint::getName()const
00092 {
00093   return m_name;
00094 }
00095 
00096 inline
00097 void
00098 Constraint::setName(const std::string &n)
00099 {
00100   m_name=n;
00101 }
00102 
00103 inline
00104 void
00105 Constraint::setAnnotation(const std::string &s)
00106 {
00107   m_annotation=s;
00108 }
00109 }
00110 #endif // GROUP_H

Generated on Wed Apr 12 18:51:55 2006 for wsdlpull by  doxygen 1.3.9.1