fw4spl
SrcLib/core/fwAtomsPatch/include/fwAtomsPatch/helper/Object.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 __FWATOMSPATCH_HELPER_OBJECT_HPP__
8 #define __FWATOMSPATCH_HELPER_OBJECT_HPP__
9 
10 #include <fwAtoms/Object.hpp>
11 
12 #include "fwAtomsPatch/conditions/Abstract.hpp"
13 #include "fwAtomsPatch/config.hpp"
14 
15 namespace fwAtomsPatch
16 {
17 namespace helper
18 {
19 
20 namespace conditions = ::fwAtomsPatch::conditions;
21 
26 class FWATOMSPATCH_CLASS_API Object
27 {
28 public:
29 
31  FWATOMSPATCH_API Object(::fwAtoms::Object::sptr metaObject );
32 
34  FWATOMSPATCH_API ~Object();
35 
37  FWATOMSPATCH_API void addAttribute(const std::string& name,
38  ::fwAtoms::Base::sptr value,
39  conditions::Abstract::sptr condition = conditions::Abstract::New());
40 
42  FWATOMSPATCH_API void addOrReplaceAttribute(const std::string& name,
43  ::fwAtoms::Base::sptr value,
44  conditions::Abstract::sptr condition = conditions::Abstract::New());
45 
47  FWATOMSPATCH_API void removeAttribute(const std::string& name,
48  conditions::Abstract::sptr condition = conditions::Abstract::New());
49 
51  FWATOMSPATCH_API void replaceAttribute(const std::string& name,
52  ::fwAtoms::Base::sptr newValue,
53  conditions::Abstract::sptr condition = conditions::Abstract::New());
54 
56  FWATOMSPATCH_API void renameAttribute(const std::string& name, const std::string& newName,
57  conditions::Abstract::sptr condition = conditions::Abstract::New()
58  );
59 
61  FWATOMSPATCH_API ::fwAtoms::Object::sptr getObject() const;
62 
63 private:
64 
66  ::fwAtoms::Object::sptr m_object;
67 };
68 
69 } //helper
70 } //fwAtomHelper
71 
72 #endif /* __FWATOMSPATCH_HELPER_OBJECT_HPP__ */
Contains functions used to control patching process by defining conditions on objects.
Definition: Abstract.hpp:18
Contains base functionalities used to transform objects from a version to another.
Definition: Abstract.hpp:16