fw4spl
core/fwMemory/include/fwMemory/policy/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 __FWMEMORY_POLICY_FACTORY_NEW_HPP__
8 #define __FWMEMORY_POLICY_FACTORY_NEW_HPP__
9 
10 #include "fwMemory/config.hpp"
11 #include "fwMemory/policy/registry/detail.hpp"
12 
13 #include <string>
14 
15 namespace fwMemory
16 {
17 
18 class GuiBaseObject;
19 
20 namespace policy
21 {
22 namespace factory
23 {
24 
25 template<class CLASSNAME > SPTR( CLASSNAME ) New();
26 
27 FWMEMORY_API SPTR( ::fwMemory::IPolicy ) New( const ::fwMemory::policy::registry::KeyType & classname );
28 
29 template<class CLASSNAME > SPTR( CLASSNAME ) New()
30 {
31  SPTR(CLASSNAME) policy = std::make_shared< CLASSNAME >();
32  return policy;
33 }
34 
35 } // namespace factory
36 } // namespace policy
37 } // namespace fwMemory
38 
39 #endif /* __FWMEMORY_POLICY_FACTORY_NEW_HPP__ */
40 
#define SPTR(_cls_)
Contains fwAtomsFilter::registry details.
The namespace fwMemory contains tools to manage memory. Use for dump.
Definition: SReader.hpp:20
STL namespace.
Contains fwAtomsFilter::factory utilities.