OpenStructure
Loading...
Searching...
No Matches
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-2020 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
26#include <ost/mol/query.hh>
27
28namespace ost { namespace mol {
29
34public:
35 explicit QueryViewWrapper(const EntityHandle& entity_handle);
36 explicit QueryViewWrapper(const EntityView& entity_view);
38 QueryViewWrapper(const Query& query, const EntityHandle& handle);
39 QueryViewWrapper(const Query& query, const EntityView& view = mol::EntityView());
40 QueryViewWrapper(const Query& query, QueryFlags flags, const EntityHandle& handle);
41 QueryViewWrapper(const Query& query, QueryFlags flags, const EntityView& view = mol::EntityView());
42
44 bool DependsOnQuery() const;
45 bool IsDataValid() const;
46
49
51 void SetQuery(const Query& query);
53 const Query& GetQuery() const;
54
56 void SetFlags(QueryFlags flags);
59
61 EntityHandle GetEntity() const {return view_set_ ? entity_view_.GetHandle() : entity_handle_;}
62
63private:
64 bool view_set_;
65 EntityHandle entity_handle_;
66 EntityView entity_view_;
67 Query query_;
68 QueryFlags flags_;
69};
70
71} } // ns
72
73#endif
Protein or molecule.
EntityHandle GetHandle() const
get this handle
definition of EntityView
Selection Query.
Definition query.hh:74
EntityView GetEntityView() const
regenerates current view based on internal state
QueryViewWrapper(const Query &query, QueryFlags flags, const EntityHandle &handle)
QueryViewWrapper(const EntityHandle &entity_handle)
QueryFlags GetFlags() const
returns internally used query flags
void SetQuery(const Query &query)
explicitely sets current query
QueryViewWrapper(const Query &query, const EntityHandle &handle)
EntityHandle GetEntity() const
return underlying handle
QueryViewWrapper(const EntityView &entity_view)
bool DependsOnQuery() const
returns true if view will be recalculated from query
QueryViewWrapper(const Query &query, const EntityView &view=mol::EntityView())
void SetFlags(QueryFlags flags)
set query flags to be used internally for the Select statement
const Query & GetQuery() const
retrieve current query
QueryViewWrapper(const Query &query, QueryFlags flags, const EntityView &view=mol::EntityView())
#define DLLEXPORT_OST_MOL
uint QueryFlags
Definition query.hh:69
Definition base.dox:1