fw4spl
core/fwAtomsFilter/include/fwAtomsFilter/IFilter.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2015.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #ifndef __FWATOMSFILTER_IFILTER_HPP__
8 #define __FWATOMSFILTER_IFILTER_HPP__
9 
10 #include <string>
11 #include <map>
12 
13 #include <fwCore/base.hpp>
14 #include <fwAtoms/Object.hpp>
15 
16 #include "fwAtomsFilter/registry/detail.hpp"
17 #include "fwAtomsFilter/factory/new.hpp"
18 #include "fwAtomsFilter/config.hpp"
19 
20 namespace fwAtoms
21 {
22 class Object;
23 }
24 
25 namespace fwAtomsFilter
26 {
27 
32 class FWATOMSFILTER_CLASS_API IFilter : public ::fwCore::BaseObject
33 {
34 
35 public:
37  typedef ::fwAtomsFilter::factory::Key Key;
38 
45  template <typename T>
46  class Registrar
47  {
48  public:
49  Registrar(std::string functorKey)
50  {
51  ::fwAtomsFilter::registry::get()->addFactory(functorKey, &::fwAtomsFilter::factory::New<T>);
52  }
53  };
54 
55 
58 
60  FWATOMSFILTER_API IFilter();
61 
63  FWATOMSFILTER_API virtual ~IFilter();
64 
66  FWATOMSFILTER_API virtual void apply(const SPTR(::fwAtoms::Object)& object) = 0;
67 
68 };
69 
70 
71 } //fwAtomsFilter
72 
73 #endif /* __FWATOMSFILTER_IFILTER_HPP__ */
74 
#define SPTR(_cls_)
#define fwCoreNonInstanciableClassDefinitionsMacro(_classinfo_)
Generate common code for Non Instanciable classes (Interfaces, Abstract classes, ...)
fwAtoms contains basic objects to represent any other kind of object
Base class for all FW4SPL&#39;s classes.
Definition: BaseObject.hpp:22
Class represented a fwData::Object.
::fwAtomsFilter::factory::Key Key
Factory key used by IFilter implementations.
Class used to register a class factory in factory registry. This class defines also the object factor...
#define fwCoreAllowSharedFromThis()
Generate getSptr and getConstSptr methods.
Removes atom attributes which are not managed by a context.