Objective Toolkit : Chapter 28 The APP ATL Object : Objective Toolkit APP ATL Object Classes
Objective Toolkit APP ATL Object Classes
The ATL Object Wizard inserts the following classes into your project when you insert an Objective Toolkit APP ATL Object.
SECPlugProt
This class contains the core implementation of IInternetProtocol and IInternetProtocolInfo. It uses ATL COM to implement IUnknown and other required interfaces.
It contains an instance of and delegates all of its function calls to SECPlugProtImp.
SECPlugProtImp
This implementation class parses and validates the URL and spawns a new worker thread to perform the fetch operation asynchronously. It also contains code to abort the worker thread gracefully. The Worker Thread and the implementation object share a FileDownloadInfo object through which they share the asynchronous data download information.
You should derive a class from SECPlugProtImp to customize the default behavior and hook it into the SECPlugProt implementation.
FileDownloadInfo
This object, shared between the Worker Thread and the SECPlugProtImp object, allows access to information stored in its members regarding the data fetched so far, remaining data to be fetched and the actual fetched data, all in a thread-safe manner.
SECWorkerThreadFetchObject
The actual data fetch operation in a worker thread is performed within an instance of this interface. The interface for this class is designed to facilitate the worker thread’s logic of fetching the data in blocks and transferring control intermittently to the main thread using Switch/Continue.
The wizard-inserted Worker Thread code should be completed by hooking in a custom instance of SECWorkerThreadFetchObject with the worker thread.
WorkerThreadMain
This class is the default worker thread control function. It initializes an instance of SECWorkerThreadFetchObject and instructs it to fetch data in blocks.
It also communicates with the main thread to transfer control intermittently (using Switch/Continue), to inform it regarding the thread completion, and to check if it should abort the operation before completion.