OpenStructure
query_view_wrapper.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // This file is part of the OpenStructure project <www.openstructure.org>
3 //
4 // Copyright (C) 2008-2011 by the OpenStructure authors
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License as published by the Free
8 // Software Foundation; either version 3.0 of the License, or (at your option)
9 // any later version.
10 // This library is distributed in the hope that it will be useful, but WITHOUT
11 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 // details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this library; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 //------------------------------------------------------------------------------
19 #ifndef OST_QUERY_VIEW_WRAPPER_HH
20 #define OST_QUERY_VIEW_WRAPPER_HH
21 
22 #include <ost/mol/view_type_fw.hh>
23 #include <ost/mol/module_config.hh>
24 #include <ost/mol/entity_view.hh>
25 #include <ost/mol/entity_handle.hh>
26 #include <ost/mol/query.hh>
27 
28 namespace ost { namespace mol {
29 
31 public:
32  explicit QueryViewWrapper(const EntityHandle& entity_handle);
33  explicit QueryViewWrapper(const EntityView& entity_view);
35  QueryViewWrapper(const Query& query, const EntityHandle& handle);
36  QueryViewWrapper(const Query& query, const EntityView& view = mol::EntityView());
37  QueryViewWrapper(const Query& query, QueryFlags flags, const EntityHandle& handle);
38  QueryViewWrapper(const Query& query, QueryFlags flags, const EntityView& view = mol::EntityView());
39  EntityView GetEntityView() const;
40  bool DependsOnQuery() const;
41  bool IsDataValid() const;
42 
43  void SetQuery(const Query& query);
44  const Query& GetQuery() const;
45 
46  void SetFlags(QueryFlags flags);
47  QueryFlags GetFlags() const;
48 
49 private:
50  bool view_set_;
51  EntityHandle entity_handle_;
52  EntityView entity_view_;
53  Query query_;
54  QueryFlags flags_;
55 };
56 
57 } } // ns
58 
59 #endif