00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef DCCLASS_H
00020 #define DCCLASS_H
00021
00022 #include "dcbase.h"
00023 #include "dcField.h"
00024
00025 class HashGenerator;
00026
00027
00028
00029
00030
00031
00032 class EXPCL_DIRECT DCClass {
00033 PUBLISHED:
00034 int get_number() const;
00035 string get_name() const;
00036
00037 bool has_parent() const;
00038 DCClass *get_parent() const;
00039
00040 int get_num_fields();
00041 DCField *get_field(int n);
00042 DCField *get_field_by_name(const string &name);
00043
00044 int get_num_inherited_fields();
00045 DCField *get_inherited_field(int n);
00046
00047 public:
00048 DCClass();
00049 ~DCClass();
00050
00051 void write(ostream &out, int indent_level = 0) const;
00052 void generate_hash(HashGenerator &hash) const;
00053
00054 bool add_field(DCField *field);
00055
00056 public:
00057
00058
00059 int _number;
00060 string _name;
00061
00062 typedef pvector<DCClass *> Parents;
00063 Parents _parents;
00064
00065 typedef pvector<DCField *> Fields;
00066 Fields _fields;
00067
00068 public:
00069
00070
00071 typedef pmap<string, DCField *> FieldsByName;
00072 FieldsByName _fields_by_name;
00073 };
00074
00075 #endif