]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/DataObject.h
Moved to version 1.0
[cpPlugins.git] / lib / cpPlugins / DataObject.h
1 // =========================================================================
2 // @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
3 // =========================================================================
4 #ifndef __cpPlugins__DataObject__h__
5 #define __cpPlugins__DataObject__h__
6
7 #include <cpPlugins/Object.h>
8
9 namespace cpPlugins
10 {
11   class ProcessObject;
12
13   /*! \brief Base class for all data objects.
14    *
15    * This class is intended to be the base for all data objects. It
16    * inherits from cpPlugins::Object and it serves as inputs or
17    * outputs in cpPlugins::ProcessObject objects. Think of it as edges
18    * in a graph.
19    */
20   class CPPLUGINS_EXPORT DataObject
21     : public Object
22   {
23     cpPluginsTypeMacro( DataObject, Object );
24     cpPluginsNewMacro( );
25
26   public:
27     virtual bool IsUpdated(
28       const TTimeStamp& d = TTimeRep::now( )
29       ) const override;
30
31     /*! @defgroup m_Source
32      * This object's source. This soft association (i.e. it could be
33      * NULL) allows navigation over pipeline's (graph) edges.
34      * @{
35      */
36     void DisconnectPipeline( );
37     void SetSource( ProcessObject* source );
38     void Update( );
39     //! @}
40
41   protected:
42     /*! In order to correctly handle memory with std::shared_pointer<>,
43      *  constructors and destructor should be "invisible" to the user.
44      * @{
45      */
46     DataObject( );
47     virtual ~DataObject( );
48     //! @}
49
50   protected:
51     //! @ingroup m_Source
52     std::weak_ptr< ProcessObject > m_Source;
53   }; // end class
54 } // end namespace
55
56 #endif // __cpPlugins__DataObject__h__
57
58 // eof - $RCSfile$