00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef GROUP_H
00022 #define GROUP_H
00023
00024
00025
00026 #include <string>
00027 #include <schemaparser/Schema.h>
00028 #include <schemaparser/ContentModel.h>
00029 using namespace std;
00030
00031 class Group
00032 {
00033 public:
00034 Group();
00035 ~Group();
00036 Group(const Group & g);
00037 Group(const std::string & name,
00038 int min,
00039 int max);
00040 int min()const;
00041 void setMin(int m);
00042
00043 int max() const;
00044 void setMax(int m);
00045
00046 string getName()const;
00047 void setName(const string & n);
00048
00049 void setAnnotation(const string & s);
00050 ContentModel * getContents()const;
00051 void setContents(const ContentModel* cm,bool isRef=false);
00052 private:
00053 int maxOccurs_;
00054 int minOccurs_;
00055 std::string name_;
00056 std::string annotation_;
00057 ContentModel * cm_;
00058 bool ref_;
00059 };
00060
00061
00062 inline
00063 string
00064 Group::getName()const
00065 {
00066 return name_;
00067 }
00068
00069 inline
00070 void
00071 Group::setName(const string &n)
00072 {
00073 name_=n;
00074 }
00075
00076 inline
00077 void
00078 Group::setAnnotation(const string &s)
00079 {
00080 annotation_=s;
00081 }
00082
00083 inline
00084 int
00085 Group::max() const
00086 {
00087 return maxOccurs_;
00088 }
00089
00090 inline
00091 int
00092 Group::min() const
00093 {
00094 return minOccurs_;
00095 }
00096
00097 inline
00098 void
00099 Group::setMin(int m)
00100 {
00101 minOccurs_=m;
00102
00103 }
00104
00105 inline
00106 void
00107 Group::setMax(int m)
00108 {
00109 maxOccurs_=m;
00110
00111 }
00112
00113 inline
00114 ContentModel *
00115 Group::getContents()const
00116 {
00117 return cm_;
00118
00119 }
00120
00121 inline
00122 void
00123 Group::setContents(const ContentModel* cm,bool setRef)
00124 {
00125 cm_=const_cast<ContentModel*> (cm);
00126 ref_=setRef;
00127 }
00128
00129 #endif // GROUP_H