fw4spl
Edge.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 __FWDATA_EDGE_HPP__
8 #define __FWDATA_EDGE_HPP__
9 
10 #include "fwData/config.hpp"
11 #include "fwData/factory/new.hpp"
12 #include "fwData/Object.hpp"
13 
14 #include <utility>
15 
16 fwCampAutoDeclareDataMacro((fwData)(Edge), FWDATA_API);
17 
18 namespace fwData
19 {
25 class FWDATA_CLASS_API Edge : public ::fwData::Object
26 {
27 public:
28  fwCoreClassDefinitionsWithFactoryMacro( (Edge)(::fwData::Object), (()), ::fwData::factory::New< Edge >);
29  fwCampMakeFriendDataMacro((fwData)(Edge));
30 
31  FWDATA_API static std::string NATURE_FLOW;
32  FWDATA_API static std::string NATURE_DATA;
33 
38  FWDATA_API Edge( ::fwData::Object::Key key );
40  FWDATA_API virtual ~Edge();
41 
43  FWDATA_API void shallowCopy( const Object::csptr& _source ) override;
44 
46  FWDATA_API void cachedDeepCopy(const Object::csptr& _source, DeepCopyCacheType& cache) override;
47 
53  FWDATA_API void setIdentifiers(const std::string& _fromPortIndentifier, const std::string& _toPortIndentifier);
54 
60  FWDATA_API std::pair<std::string, std::string> getIdentifiers() const;
61 
63  FWDATA_API std::string getFromPortID() const;
64 
66  FWDATA_API std::string getToPortID() const;
67 
69  FWDATA_API std::string getPortID(bool upStream) const;
70 
72  FWDATA_API void setNature(std::string nature);
73 
75  FWDATA_API const std::string& getNature() const;
76 
77 protected:
78 
79  std::string m_fromPortIdentifier; // "ID_SIZEX" , ...
80  std::string m_toPortIdentifier; // "ID_SIZEX" , ...
81  std::string m_nature; // "FLOW" , "FWDATA"
82 };
83 
84 } // namespace fwData
85 
86 #endif // __FWDATA_EDGE_HPP__
87 
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
Base class for each data object.
Contains the representation of the data objects used in the framework.
This class defines an edge object.
Definition: Edge.hpp:25