Comet Class Factories

Comet currently has support for Standard (non-aggregating), Aggregating and Singleton class factories. As there has been no demand for custom class factories yet, there is currently no support for them.

The different class-factories are enabled by specialising the coclass_implementation to inherit off different classes.

Standard

The trigger classes for standard class-factory are either comet::coclass, or comet::simple_object.

There is nothing much more noteworthy about this form except that it will return CLASS_E_NOAGGREGATION if aggregation is specified.

Aggregating

The trigger classes for the aggregating class-factory are comet::aggregateable_coclass or comet::aggregateable_object.

The implementation of aggregation in comet is similar to the poly-aggregateable implementations found in ATL; there is no aggregation-only coclass implementation.

The aggregating class factory will hook up aggegation if an IUnknown is supplied.

Singleton

The trigger classes for the singleton class-factory are comet::singleton_coclass or comet::singleton_object.

The singleton class-factory will cause all CreateObject calls for this class to return the same object. The life-time of the object is from first call till just before the dll/exe is unloaded.

More complex requirements are anticipated, however they have not been implemented.