UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
project_qsql.hpp
1 /* project.hpp */
2 /* $Id$ */
3 #ifndef __hds_db_project_qsql_hpp
4 #define __hds_db_project_qsql_hpp
5 
6 #include <QSqlDatabase>
7 
8 #include <hds_db/base/project.hpp>
9 #include <hds_db/qsql/qsql_impl.hpp>
10 
12 namespace hds
13 {
15  namespace db
16  {
17  class SeismicQSql;
18 
20  class ProjectQSql : public Project, public QSqlImpl
21  {
22  friend class SeismicQSql;
23 
24  public:
25 
27  ProjectQSql(const ContextQSql &dbc);
28 
30  virtual ~ProjectQSql();
31 
32  //--- Access to data storage ---------------------------------------------------------------
33 
37  virtual ErrCode open(const std::string &name, OpenMode mode);
38 
41  virtual ErrCode close();
42 
45  virtual ErrCode flush();
46 
49  virtual std::string name(ErrCode *rc = NULL) const;
50 
53  virtual ErrCode setName(const std::string &name_str);
54 
57  virtual ErrCode remove(const std::string &name);
58 
61  virtual ErrCode getList(Names &list) const;
62 
67  virtual size_t dataSize(const std::string &name,
68  ErrCode *rc = NULL) const;
69 
72  virtual time_t creationTime(const std::string &name,
73  ErrCode *rc = NULL) const;
74 
77  virtual time_t modificationTime(const std::string &name,
78  ErrCode *rc = NULL) const;
79 
80  //--- Access to project data ---------------------------------------------------------------
81 
84  virtual ErrCode setCreator(const std::string &creator_str);
85 
88  virtual std::string creator(ErrCode *rc = NULL) const;
89 
92  virtual ErrCode setDescription(const std::string &descr_str);
93 
96  virtual std::string description(ErrCode *rc = NULL) const;
97 
98  protected:
99 
102 
106  size_t get_seis_data_size(const std::string &name,
107  ErrCode *rc) const;
108 
110  static ErrCode name2id(QSqlDatabase &db, const std::string &name, DbIndex &id);
111 
114  static ErrCode db_update_time_stamp(QSqlDatabase &db, const DbIndex &id);
115 
121  const std::string &project_name);
122 
123  private:
124 
127  ErrCode create_project(const std::string &name, DbIndex &id);
128  };
129  }; // db
130 }; // hds
131 
132 #endif /* __hds_db_project_qsql_hpp */
size_t get_seis_data_size(const std::string &name, ErrCode *rc) const
virtual ErrCode flush()
virtual ErrCode setName(const std::string &name_str)
OpenMode
Definition: defines.hpp:32
Definition: dbcontext_qsql.hpp:15
uint64_t DbIndex
Definition: defines.hpp:26
virtual ErrCode getList(Names &list) const
Definition: project_qsql.hpp:20
ErrCode
Definition: defines.hpp:46
ErrCode clear_seismics(const ContextQSql &dbc, const std::string &project_name)
virtual time_t creationTime(const std::string &name, ErrCode *rc=NULL) const
virtual ErrCode open(const std::string &name, OpenMode mode)
virtual std::string name(ErrCode *rc=NULL) const
virtual ErrCode setCreator(const std::string &creator_str)
Definition: seismic_qsql.hpp:24
virtual size_t dataSize(const std::string &name, ErrCode *rc=NULL) const
Definition: project.hpp:16
static ErrCode name2id(QSqlDatabase &db, const std::string &name, DbIndex &id)
virtual time_t modificationTime(const std::string &name, ErrCode *rc=NULL) const
Definition: qsql_impl.hpp:19
virtual ErrCode close()
virtual ErrCode setDescription(const std::string &descr_str)
ProjectQSql(const ContextQSql &dbc)
static ErrCode db_update_time_stamp(QSqlDatabase &db, const DbIndex &id)
virtual std::string description(ErrCode *rc=NULL) const
virtual std::string creator(ErrCode *rc=NULL) const
std::vector< std::string > Names
Definition: object.hpp:23
DbIndex m_cur_project_id
Definition: project_qsql.hpp:101