fw4spl
Object.hxx
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 __FWATOMS_OBJECT_HXX__
8 #define __FWATOMS_OBJECT_HXX__
9 
10 #include "fwAtoms/config.hpp"
11 #include "fwAtoms/Base.hpp"
12 #include "fwAtoms/factory/new.hpp"
13 
14 #ifndef __FWATOMS_OBJECT_HPP__
15 #error fwAtoms/Object.hpp not included
16 #endif
17 
18 namespace fwAtoms
19 {
20 
21 template < typename OBJECT_TYPE >
22 SPTR(OBJECT_TYPE) Object::getAttribute(const std::string& key) const
23 {
24  ::fwAtoms::Base::sptr base = this->getAttribute(key);
25  return std::dynamic_pointer_cast< OBJECT_TYPE >(base);
26 }
27 
28 }
29 
30 #endif /* __FWATOMS_OBJECT_HXX__ */
31 
#define SPTR(_cls_)
fwAtoms contains basic objects to represent any other kind of object
STL namespace.
Class represented a fwData::Object.