]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/Interface/ProcessObjectPort.h
MAC compilation issues solved... Now some tests please
[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     protected:
34       cpPlugins::Interface::DataObject::Pointer m_Data;
35     };
36
37     /**
38      */
39     class cpPlugins_Interface_EXPORT InputProcessObjectPort
40       : public ProcessObjectPort
41     {
42     public:
43       typedef InputProcessObjectPort Self;
44       typedef ProcessObjectPort      Superclass;
45
46     public:
47       InputProcessObjectPort( bool required = false );
48       virtual ~InputProcessObjectPort( );
49       Self& operator=( DataObject* obj );
50       Self& operator=( const Superclass& other );
51
52       bool IsRequired( ) const;
53       void RequiredOn( );
54       void RequiredOff( );
55       void SetRequired( bool required );
56
57     protected:
58       bool m_Required;
59     };
60
61     /**
62      */
63     class cpPlugins_Interface_EXPORT OutputProcessObjectPort
64       : public ProcessObjectPort
65     {
66     public:
67       typedef OutputProcessObjectPort Self;
68       typedef ProcessObjectPort       Superclass;
69
70     public:
71       OutputProcessObjectPort( );
72       virtual ~OutputProcessObjectPort( );
73       Self& operator=( DataObject* obj );
74       Self& operator=( const Superclass& other );
75     };
76
77   } // ecapseman
78
79 } // ecapseman
80
81 #endif // __CPPLUGINS__INTERFACE__PROCESSOBJECTPORT__H__
82
83 // eof - $RCSfile$