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
Class Members
CODConnection(CODPortComponent *pSourcePort = NULL, CODPortComponent* pTargetPort = NULL)
Constructor.
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.
static int m_nMaxEvents
Maximum size of connection event queue.
CList<EventQueueEntry,EventQueueEntry&> m_eventQueue
List of queued events.
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void ** ppvObject)
Retrieve a pointer to an interface supported by this object.
ULONG STDMETHODCALLTYPE AddRef()
Add a reference to this object.
ULONG STDMETHODCALLTYPE Release()
Release a reference to this object.
virtual bool RouteEvent(sfl::IEvent* pIEvent)
Routes event objects to event listeners.
virtual bool AddListener(sfl::IEventListener* pIListener)
Add an event listener to the controller.
virtual bool RemoveListener(sfl::IEventListener* pIListener)
Remove an event listener from the controller.
virtual bool QueueEvent(sfl::IEvent* pIEvent, const UINT nPriority)
Place an event in the queue and assign it a priority.
virtual bool DispatchEvent(sfl::IEventRouter* pIEventRouter)
Remove next event from the queue and send it to an event router.
virtual void ClearAllEvents()
Remove all events from the queue without dispatching them.
void SetMaxEvents(const int nEventCount)
Set maximum size of connection event queue.
void Break()
Breaks the connection between the two ports.
CODPortComponent* GetSourcePort() const
Gets a pointer to the port at the source end of the connection.
void SetSourcePort(CODPortComponent *pSourcePort)
Sets the port at the source end of the connection.
CODPortComponent* GetTargetPort() const
Gets a pointer to the port at the target end of the connection.
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.
virtual BOOL ConnectionFollows(CODPortComponent* pPort) const
Determines if the dependent symbol should follow the given port.
virtual BOOL FollowsSource() const
Determines if the dependent symbol should follow the source port.
virtual BOOL FollowsTarget() const
Determines if the dependent symbol should follow the target port.
virtual void Serialize(CArchive& ar)
Serializes the link component.