Unity Scopes API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
FilterBase.h
1 /*
2  * Copyright (C) 2013 Canonical Ltd
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License version 3 as
6  * published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Pawel Stolowski <pawel.stolowski@canonical.com>
17  */
18 
19 #ifndef UNITY_SCOPES_FILTERBASE_H
20 #define UNITY_SCOPES_FILTERBASE_H
21 
22 #include <unity/util/NonCopyable.h>
23 #include <unity/scopes/Variant.h>
24 #include <unity/util/DefinesPtrs.h>
25 #include <memory>
26 #include <list>
27 
28 namespace unity
29 {
30 
31 namespace scopes
32 {
33 
34 namespace internal
35 {
36 class FilterBaseImpl;
37 }
38 
48 {
49 public:
51  UNITY_DEFINES_PTRS(FilterBase);
52  NONCOPYABLE(FilterBase);
54 
59  std::string id() const;
60 
62  VariantMap serialize() const;
64 
69  std::string filter_type() const;
70 
72  virtual ~FilterBase();
73 
74 protected:
75  FilterBase(internal::FilterBaseImpl *pimpl);
76  std::unique_ptr<internal::FilterBaseImpl> p;
78 };
79 
83 typedef std::list<FilterBase::SCPtr> Filters;
84 
85 } // namespace scopes
86 
87 } // namespace unity
88 
89 #endif
std::string filter_type() const
Get the type name of this filter.
Definition: FilterBase.cpp:47
std::list< FilterBase::SCPtr > Filters
List of filters.
Definition: FilterBase.h:83
std::string id() const
Get the identifier of this filter.
Definition: FilterBase.cpp:42
Base class for all implementations of filters.
Definition: FilterBase.h:47
std::map< std::string, Variant > VariantMap
A dictionary of (string, Variant) pairs.
Definition: Variant.h:39