fw4spl
IStructuralCreator.cpp
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 #include <fwTools/UUID.hpp>
8 
9 #include <fwAtoms/Map.hpp>
10 
11 #include <fwAtomsPatch/types.hpp>
12 
13 #include "fwAtomsPatch/IStructuralCreator.hpp"
14 #include "fwAtomsPatch/helper/functions.hpp"
15 
16 namespace fwAtomsPatch
17 {
18 
20 {
21 }
22 
23 // ----------------------------------------------------------------------------
24 
26 {
27 }
28 
29 // ----------------------------------------------------------------------------
30 
32 {
35 }
36 
37 // ----------------------------------------------------------------------------
38 
39 const std::string& IStructuralCreator::getObjectVersion() const
40 {
41  return m_version;
42 }
43 
44 // ----------------------------------------------------------------------------
45 
46 const std::string& IStructuralCreator::getObjectClassname() const
47 {
48  return m_classname;
49 }
50 
51 // ----------------------------------------------------------------------------
52 
53 ::fwAtoms::Object::sptr IStructuralCreator::createObjBase() const
54 {
55  ::fwAtoms::Object::sptr obj = ::fwAtoms::Object::New();
56 
57  ::fwAtomsPatch::helper::setClassname(obj, m_classname);
58  ::fwAtomsPatch::helper::setVersion(obj, m_version);
59  ::fwAtomsPatch::helper::generateID( obj );
60 
61  // All data objects has a parameter fields
63 
64  return obj;
65 }
66 
67 // ----------------------------------------------------------------------------
68 
69 } //fwAtomsPatch
Base class of all structural creators. Creates a new atom object with the default values correspondin...
FWATOMSPATCH_API void cleanFields(const ::fwAtoms::Object::sptr &obj)
Cleans object fields (also creates them if they are missing)
std::string m_version
Object version.
virtual FWATOMSPATCH_API ~IStructuralCreator()
Destructor.
Contains base functionalities used to transform objects from a version to another.
Definition: Abstract.hpp:16
virtual FWATOMSPATCH_API const std::string & getObjectClassname() const
Returns the classname of the object.
virtual FWATOMSPATCH_API const std::string & getObjectVersion() const
Returns the version of the object.
FWATOMSPATCH_API::fwAtoms::Object::sptr createObjBase() const
Create the object base : create meta infos : classname, version and id.
FWATOMSPATCH_API IStructuralCreator()
Constructor.
std::string m_classname
Object classname.