fw4spl
UserObject.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 __FWCAMP_USEROBJECT_HPP__
8 #define __FWCAMP_USEROBJECT_HPP__
9 
10 #include <camp/userobject.hpp>
11 
12 #include <fwCore/macros.hpp>
13 
14 #include "fwCamp/factory/new.hpp"
15 #include "fwCamp/registry/detail.hpp"
16 
17 namespace fwCamp
18 {
19 
23 template<typename T>
25 {
29  UserObjectRegistrar( const std::string &name )
30  {
31  ::fwCamp::registry::get()->addFactory(name, &::fwCamp::factory::New<T>);
32  }
33 };
34 
35 }
36 
37 #endif //__FWCAMP_USEROBJECT_HPP__
38 
Helper to register and manage the conversion between an fwData::Object and a camp::userObject.
Definition: UserObject.hpp:24
This file defines fwCore base macros.
UserObjectRegistrar(const std::string &name)
Register an object of type name in factory.
Definition: UserObject.hpp:29
All necessary for camp binding with simple types.