X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FDataObject.h;fp=lib%2FcpPlugins%2FDataObject.h;h=935274bf3f6f75534b6c5d51dc68690f8e5b51b7;hb=2e142df11d6f312a2a2b5097b8da73571ed523e8;hp=0000000000000000000000000000000000000000;hpb=61b3659afe961ed248f30e26f9ca8f28fcfafddc;p=cpPlugins.git diff --git a/lib/cpPlugins/DataObject.h b/lib/cpPlugins/DataObject.h new file mode 100644 index 0000000..935274b --- /dev/null +++ b/lib/cpPlugins/DataObject.h @@ -0,0 +1,58 @@ +// ========================================================================= +// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co) +// ========================================================================= +#ifndef __cpPlugins__DataObject__h__ +#define __cpPlugins__DataObject__h__ + +#include + +namespace cpPlugins +{ + class ProcessObject; + + /*! \brief Base class for all data objects. + * + * This class is intended to be the base for all data objects. It + * inherits from cpPlugins::Object and it serves as inputs or + * outputs in cpPlugins::ProcessObject objects. Think of it as edges + * in a graph. + */ + class CPPLUGINS_EXPORT DataObject + : public Object + { + cpPluginsTypeMacro( DataObject, Object ); + cpPluginsNewMacro( ); + + public: + virtual bool IsUpdated( + const TTimeStamp& d = TTimeRep::now( ) + ) const override; + + /*! @defgroup m_Source + * This object's source. This soft association (i.e. it could be + * NULL) allows navigation over pipeline's (graph) edges. + * @{ + */ + void DisconnectPipeline( ); + void SetSource( ProcessObject* source ); + void Update( ); + //! @} + + protected: + /*! In order to correctly handle memory with std::shared_pointer<>, + * constructors and destructor should be "invisible" to the user. + * @{ + */ + DataObject( ); + virtual ~DataObject( ); + //! @} + + protected: + //! @ingroup m_Source + std::weak_ptr< ProcessObject > m_Source; + }; // end class +} // end namespace + +#endif // __cpPlugins__DataObject__h__ + +// eof - $RCSfile$