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

Generated on Sun Oct 16 10:11:52 2005 for wsdlpull by  doxygen 1.3.9.1