1 #ifndef __CPPLUGINS__PORT__H__
2 #define __CPPLUGINS__PORT__H__
4 #include <cpPlugins/DataObject.h>
10 class cpPlugins_EXPORT Port
18 Self& operator=( DataObject* obj );
19 Self& operator=( const Self& other );
21 bool IsValid( ) const;
23 // This could be seen as a pointer to DataObject's
24 inline DataObject* GetPointer( )
25 { return( this->m_Data.GetPointer( ) ); }
26 inline const DataObject* GetPointer( ) const
27 { return( this->m_Data.GetPointer( ) ); }
28 inline DataObject* operator->( ) const
29 { return( this->m_Data.GetPointer( ) ); }
31 inline void SetPointer( DataObject* ptr )
32 { this->m_Data = ptr; }
35 cpPlugins::DataObject::Pointer m_Data;
40 class cpPlugins_EXPORT InputPort
44 typedef InputPort Self;
45 typedef Port Superclass;
48 InputPort( bool required = false );
49 virtual ~InputPort( );
50 Self& operator=( DataObject* obj );
51 Self& operator=( const Superclass& other );
53 bool IsRequired( ) const;
56 void SetRequired( bool required );
64 class cpPlugins_EXPORT OutputPort
68 typedef OutputPort Self;
69 typedef Port Superclass;
73 virtual ~OutputPort( );
74 Self& operator=( DataObject* obj );
75 Self& operator=( const Superclass& other );
80 #endif // __CPPLUGINS__PORT__H__