fw4spl
core/fwServices/include/fwServices/factory/new.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 __FWSERVICES_FACTORY_NEW_HPP__
8 #define __FWSERVICES_FACTORY_NEW_HPP__
9 
10 #include <string>
11 
12 #include "fwServices/config.hpp"
13 
14 #include <fwCore/base.hpp>
15 
16 namespace fwServices
17 {
18 
19 class IService;
20 
21 namespace factory
22 {
23 
24 template<class CLASSNAME > SPTR( CLASSNAME ) New()
25 {
26  SPTR(CLASSNAME) srv = std::make_shared< CLASSNAME >();
27 
28  return srv;
29 }
30 
31 } // namespace factory
32 
33 } // namespace fwServices
34 
35 #endif /* __FWSERVICES_FACTORY_NEW_HPP__ */
36 
37 
38 
#define SPTR(_cls_)
STL namespace.
Namespace fwServices is dedicated to (mimic) the dynamic affectation of methods to (pure data) object...
Contains fwAtomsFilter::factory utilities.