fw4spl
core/fwAtomConversion/include/fwAtomConversion/mapper/factory/new.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2017.
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 __FWATOMCONVERSION_MAPPER_FACTORY_NEW_HPP__
8 #define __FWATOMCONVERSION_MAPPER_FACTORY_NEW_HPP__
9 
10 #include "fwAtomConversion/config.hpp"
11 #include "fwAtomConversion/mapper/registry/detail.hpp"
12 
13 #include <string>
14 
15 namespace fwAtomConversion
16 {
17 namespace mapper
18 {
19 
20 class Mapper;
21 
22 namespace factory
23 {
24 
25 template<class CLASSNAME > SPTR( CLASSNAME ) New();
26 
27 FWATOMCONVERSION_API SPTR(::fwAtomConversion::mapper::Base) New(
28  const ::fwAtomConversion::mapper::registry::KeyType & classname );
29 
30 template<class CLASSNAME > SPTR( CLASSNAME ) New()
31 {
32  SPTR(CLASSNAME) obj = std::make_shared< CLASSNAME >();
33  return obj;
34 }
35 
36 } // namespace mapper
37 } // namespace factory
38 } // namespace fwAtomConversion
39 
40 #endif /* __FWATOMCONVERSION_MAPPER_FACTORY_NEW_HPP__ */
41 
#define SPTR(_cls_)
This namespace contains the necessary class for fwData <-> fwAtoms conversion.
Contains fwAtomsFilter::factory utilities.
Base class of custom mapper between fwData and fwAtoms.