acyclic_connector Class Template Reference

#include <comstl/util/acyclic_connector.hpp>

List of all members.


Detailed Description

template<typename MX>
class comstl::acyclic_connector< MX >

A component that allows two objects to be connected without creating cyclic dependencies.

Reference counting architectures, such as COM, rely on there being no dependency cycles. A cyclic dependency is the situation where, say, object a holds a reference to object b, and object b holds a reference to object a. Since neither will release the references it holds (held on its efferent dependents) until all references to itself (held by its afferent dependents) the circle will never be broken.

COM lore thus proscribes the use of mutual references, or prescribes rigid protocols (e.g. Connection Points) for their management.

acyclic_connector is designed to help in the case where two objects need to have knowledge of each other, but not hold references on each other. It works by acting as an intermediary that each of two objects in the relationship keep informed as to their existance.

Parameters:
MX The type of the mutex that will be used to provide exclusive access to the instance state during the Clear() and QueryPeer() methods.

Member Types

typedef MX mutex_type
typedef acyclic_connector< MX > class_type

Construction

 acyclic_connector (LPUNKNOWN leftPeer, IAcyclicSide **leftSide, LPUNKNOWN rightPeer, IAcyclicSide **rightSide)

Classes

class  side

The documentation for this class was generated from the following file:

Generated on Thu Jun 10 08:58:26 2010 for STLSoft by  doxygen 1.5.6