CODConnection Class

class CODConnection: public CObject

A connection binds together two ports and establishes a bridge between two symbols. Each port is owned by a symbol. Each connection has pointers to two ports. One port is referred to as the source port and the other port is referred to as the target port. The symbol that owns the source port is referred to as the source symbol. The symbol that owns the target port is referred to as the target symbol. The names source and target do not imply a direction; they are only used to distguish between the two ports on the connection.

Events can be passed between the two symbols through a connection. The connection acts as an event router and event queue. The class CODConnectionEvent is queued up on the connection by one of the two symbols when the symbol moves or is deleted. This communication mechanism is what allows connected symbols and links to follow one another when one or the other moves.

Defined in: OdConnection.h

See Also

CODPortComponent

Class Members

VIEWS_API CODConnection(CODPortComponent *pSourcePort = NULL, CODPortComponent* pTargetPort = NULL)

Constructor.

VIEWS_API virtual ~CODConnection()

Destructor.

ULONG m_ulRefCount

Reference count value.

CODPortComponent* m_pSourcePort

The port on the source component the link is connected to.

CODPortComponent* m_pTargetPort

The port on the target component the link is connected to.

VIEWS_API static int m_nMaxEvents

Maximum size of connection event queue.

CList<EventQueueEntry,EventQueueEntry&> m_eventQueue

List of queued events.

VIEWS_API HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void ** ppvObject)

Retrieve a pointer to an interface supported by this object.

VIEWS_API ULONG STDMETHODCALLTYPE AddRef()

Add a reference to this object.

VIEWS_API ULONG STDMETHODCALLTYPE Release()

Release a reference to this object.

VIEWS_API virtual bool RouteEvent(sfl::IEvent* pIEvent)

Routes event objects to event listeners.

VIEWS_API virtual bool AddListener(sfl::IEventListener* pIListener)

Add an event listener to the controller.

VIEWS_API virtual bool RemoveListener(sfl::IEventListener* pIListener)

Remove an event listener from the controller.

VIEWS_API virtual bool QueueEvent(sfl::IEvent* pIEvent, const UINT nPriority)

Place an event in the queue and assign it a priority.

VIEWS_API virtual bool DispatchEvent(sfl::IEventRouter* pIEventRouter)

Remove next event from the queue and send it to an event router.

VIEWS_API virtual void ClearAllEvents()

Remove all events from the queue without dispatching them.

VIEWS_API void SetMaxEvents(const int nEventCount)

Set maximum size of connection event queue.

VIEWS_API void Break()

Breaks the connection between the two ports.

VIEWS_API CODPortComponent* GetSourcePort() const

Gets a pointer to the port at the source end of the connection.

VIEWS_API void SetSourcePort(CODPortComponent *pSourcePort)

Sets the port at the source end of the connection.

VIEWS_API CODPortComponent* GetTargetPort() const

Gets a pointer to the port at the target end of the connection.

VIEWS_API void SetTargetPort(CODPortComponent* pTargetPort)

Gets a pointer to the port at the target end of the connection.

BOOL ComparePortLocations() const

Compares the location of both ports.

VIEWS_API virtual BOOL ConnectionFollows(CODPortComponent* pPort) const

Determines if the dependent symbol should follow the given port.

VIEWS_API virtual BOOL FollowsSource() const

Determines if the dependent symbol should follow the source port.

VIEWS_API virtual BOOL FollowsTarget() const

Determines if the dependent symbol should follow the target port.

VIEWS_API virtual void Serialize(CArchive& ar)

Serializes the link component.