DbStruct Pile   version 0.0.1
This pile contains classes that can be used to
dbobject.h
Go to the documentation of this file.
1 
10 #ifndef GUARD_DBOBJECT_H_INCLUDE
11 #define GUARD_DBOBJECT_H_INCLUDE
12 
13 #include <dbstruct/dbstruct-config.h>
14 
15 #include <QString>
16 #include <QStringList>
17 #include <QDate>
18 #include <QTime>
19 #include <QDateTime>
20 
21 class DbStructMeta;
22 class DbColumn;
23 class DbRecord;
24 class DbTable;
25 class DbView;
26 
28 class DBSTRUCT_EXPORT DbObject {
29 
30 public:
31 
33  enum Type {
34  DBO_INVALID = -1,
35 
44  DBO_MAX
45  };
46 
48  DbObject ();
49 
51  virtual ~DbObject();
52 
54  virtual Type
55  type () const {
56  return DBO_CUSTOM;
57  }
58 
60  DbStructMeta * asStruct ();
61 
63  DbColumn * asColumn ();
64 
66  DbRecord * asRecord ();
67 
69  DbTable * asTable ();
70 
72  DbView * asView ();
73 
75  inline bool isStruct () {
76  return type() == DBO_STRUCT;
77  }
78 
80  inline bool isColumn () {
81  return type() == DBO_COLUMN;
82  }
83 
85  inline bool isRecord () {
86  return type() == DBO_RECORD;
87  }
88 
90  inline bool isTable () {
91  return type() == DBO_TABLE;
92  }
93 
95  inline bool isView () {
96  return (type() == DBO_SUBSET) || (type() == DBO_CPLX_VIEW);
97  }
98 
100  inline bool isCustom () {
101  return type() == DBO_CUSTOM;
102  }
103 
104 
105 
106 protected:
107 
108 private:
109 
110 };
111 
112 #endif // GUARD_DBOBJECT_H_INCLUDE
virtual Type type() const
The type of this object.
Definition: dbobject.h:55
Definition: dbobject.h:36
bool isStruct()
Tell if this instance is a DbStruct.
Definition: dbobject.h:75
A record in a database.
Definition: dbrecord.h:34
Definition: dbobject.h:38
bool isView()
Tell if this instance is a DbView.
Definition: dbobject.h:95
The structure of a database.
Definition: dbstruct.h:23
bool isTable()
Tell if this instance is a DbTable.
Definition: dbobject.h:90
bool isColumn()
Tell if this instance is a DbColumn.
Definition: dbobject.h:80
Definition: dbobject.h:40
A table in a database.
Definition: dbtable.h:22
Definition: dbobject.h:42
Type
The types of objects that use this class as a base.
Definition: dbobject.h:33
bool isRecord()
Tell if this instance is a DbRecord.
Definition: dbobject.h:85
The columnure of a database.
Definition: dbcolumn.h:27
bool isCustom()
Tell if this instance is a custom one.
Definition: dbobject.h:100
A view in a database.
Definition: dbview.h:17
Definition: dbobject.h:39
Definition: dbobject.h:37
The objecture of a database.
Definition: dbobject.h:28
Definition: dbobject.h:41