Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
In this context, an archetype is a theoretical class that supplies a collection of methods, data members, static functions, typedefs, or other features. The archetype also includes a description of the semantics necessary to create or use the class to represent a particular concept. Classes that mimic the archetype by providing the same features embody the same concept and can be used wherever the archetype can be used.
Archetypes are useful in C++ for describing the features of valid values for template parameters. The designer of the template has a clear idea of the necessary and sufficient features of the template parameter, and the compiler will enforce the syntactic requirements at build time, but the user of a template needs documentation to describe the semantics and to allow the relationships between archetypes and classes to be clearly spelled out.
Examples of archetypes in the Standard C++ Library are the different types of iterator and container. These archetypes are described in the topics Iterator Conventions and STL Containers.
ATL Server defines the following archetypes:
Name |
Description |
---|---|
Classes that conform to the worker archetype provide the code to process work items queued on a thread pool. |