generator_new/field.h

Go to the documentation of this file.
00001 /* $Id:field.h $ */
00002 /*
00003    Copyright (C) 2007 by Jurjen Stellingwerff <jurjen@stwerff.xs4all.nl>
00004    Part of the Moros Project http://moros.sourceforge.net/
00005 
00006    This program is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License version 3.
00008    This program is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY.
00010 
00011    See the COPYING file for more details.
00012 */
00013 
00014 #ifndef __FIELD_H
00015 #define __FIELD_H
00016 
00017 #include <string>
00018 #include <map>
00019 #include <list>
00020 using namespace std;
00021 
00022 #include "value.h"
00023 
00024 #define loopFieldValue(r,v) loopSingle((r)->listValue(),v,class value,list)
00025 
00026 class field {
00027     int nr;
00028     string name;
00029     int type;
00030     class record *related;
00031     map<string,class value> value;
00032     int maxValue;
00033     string description;
00034     string abbreviation;
00035 public:
00036     field();
00037 
00038     // Field : nr
00039     const int getNr() const;
00040     void setNr(const int v);
00041     int operator<(const field &ck) const;
00042 
00043     // Field : name
00044     const string getName() const;
00045     void setName(const string v);
00046 
00047     // Field : type
00048     enum type_enum{type_number,type_float,type_enumerate,type_position,type_string,type_relation,type_parent,type_children,type_boolean};
00049     const int getType() const;
00050     const string showType() const;
00051     void setType(const int v);
00052     void setType(const string v);
00053 
00054     // Field : related
00055     class record& getRelated() const;
00056     void setRelated(class record &v);
00057 
00058     // Field : value
00059     class value& getValue(const string v);
00060     list<class value>& listValue();
00061     void setValue(class value &v);
00062     void delValue(const string v);
00063     const bool isValue(const string v) const;
00064 
00065     // Field : description
00066     const string getDescription() const;
00067     void setDescription(const string v);
00068 
00069     // Field : abbreviation
00070     const string getAbbreviation() const;
00071     void setAbbreviation(const string v);
00072 
00073     void xml(ofstream &f, int l=0, int r=0);
00074 };
00075 
00076 #endif // __FIELD_H


Generated on Tue Jan 1 17:30:00 2008 for generator_new/field.h Source File by  doxygen   Visit the project page on SourceForge.net Logo