]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/Interface/ProcessObjectPort.h
48cb07a9f8dae6dff58f4c780724ba1e6859137a
[cpPlugins.git] / lib / cpPlugins / Interface / ProcessObjectPort.h
1 #ifndef __CPPLUGINS__INTERFACE__PROCESSOBJECTPORT__H__
2 #define __CPPLUGINS__INTERFACE__PROCESSOBJECTPORT__H__
3
4 #include <cpPlugins/Interface/DataObject.h>
5
6 namespace cpPlugins
7 {
8   namespace Interface
9   {
10     /**
11      */
12     class cpPlugins_Interface_EXPORT ProcessObjectPort
13     {
14     public:
15       typedef ProcessObjectPort Self;
16
17     public:
18       ProcessObjectPort( );
19       virtual ~ProcessObjectPort( );
20       Self& operator=( DataObject* obj );
21       Self& operator=( const Self& other );
22
23       bool IsValid( ) const;
24
25       // This could be seen as a pointer to DataObject's
26       inline DataObject* GetPointer( )
27       { return( this->m_Data.GetPointer( ) ); }
28       inline const DataObject* GetPointer( ) const
29       { return( this->m_Data.GetPointer( ) ); }
30       inline DataObject* operator->( ) const
31       { return( this->m_Data.GetPointer( ) ); }
32
33       inline void SetPointer( DataObject* ptr )
34       { this->m_Data = ptr; }
35
36     protected:
37       cpPlugins::Interface::DataObject::Pointer m_Data;
38     };
39
40     /**
41      */
42     class cpPlugins_Interface_EXPORT InputProcessObjectPort
43       : public ProcessObjectPort
44     {
45     public:
46       typedef InputProcessObjectPort Self;
47       typedef ProcessObjectPort      Superclass;
48
49     public:
50       InputProcessObjectPort( bool required = false );
51       virtual ~InputProcessObjectPort( );
52       Self& operator=( DataObject* obj );
53       Self& operator=( const Superclass& other );
54
55       bool IsRequired( ) const;
56       void RequiredOn( );
57       void RequiredOff( );
58       void SetRequired( bool required );
59
60     protected:
61       bool m_Required;
62     };
63
64     /**
65      */
66     class cpPlugins_Interface_EXPORT OutputProcessObjectPort
67       : public ProcessObjectPort
68     {
69     public:
70       typedef OutputProcessObjectPort Self;
71       typedef ProcessObjectPort       Superclass;
72
73     public:
74       OutputProcessObjectPort( );
75       virtual ~OutputProcessObjectPort( );
76       Self& operator=( DataObject* obj );
77       Self& operator=( const Superclass& other );
78     };
79
80   } // ecapseman
81
82 } // ecapseman
83
84 #endif // __CPPLUGINS__INTERFACE__PROCESSOBJECTPORT__H__
85
86 // eof - $RCSfile$