Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
None.
Inherited By:
None.
Purpose:
TImportForeignDataQuery provides a simple interface for importing foreign data. It iterates over all of the translators on the system, finds the ones which can handle specified foreign data types, and performs the translation when requested.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
TImportForeignDataQuery is intended to be used directly.
Clients can also create derived classes which handle imports of higher-level foreign data. For example, when importing a foreign clipboard a client may wish to create a class TImportClipboardQuery which can iterate through the available clipboard types and pass them to AdoptInputData.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
Other Considerations:
Since TImportForeignDataQuery is intended for use as a transient helper object in functions which need to import foreign data, it is not copyable, assignable, or streamable.
- TImportForeignDataQuery (TForeignData * adoptInputData)
- TImportForeignDataQuery ()
Interface Category:
API.
Purpose:
- Creates a TImportForeignDataQuery object for importing the single TForeignData object specified as a parameter.
- Default constructor. Creates a TImportForeignDataQuery object with no input specified. This is only useful in when followed by calls to the AdoptInputData member function.
Calling Context:
- Called
- Called to create a TImportForeignDataQuery with no foreign data source specified. Can also be called by derived class constructors.
Parameters:
- TForeignData * adoptInputData -The foreign data source to be imported. The TForeignData object is adopted. It must have been allocated on the heap, and the caller must not use or delete the object passing it to this function.
- Takes no parameters.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual ~ TImportForeignDataQuery ()
Interface Category:
API.
Purpose:
Destructor.
Calling Context:
Called to destroy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
void AdoptInputData (TForeignData * adoptInputData)
Interface Category:
API.
Purpose:
Adds an additional foreign data source to the inputs available for this query.
Calling Context:
You can call this function directly.
Parameters:
- TForeignData * adoptInputData -Specifies an additional foreign data source to be added as a possible input for this import query. The TForeignData object is adopted. It must have been allocated on the heap, and the caller must not use or delete the object passing it to this function.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
void CopyAvailableTypes (TCollectionOf < TTypeDescription > & types, TMemoryHeap * =0) const
Interface Category:
API.
Purpose:
Returns the types of the scrap items that can be created from the foreign data sources available to this query. If no scrap items can be created, an exception is thrown.
Calling Context:
You can call this function directly.
Parameters:
- TCollectionOf < TTypeDescription > & types -This collection is filled in with one TTypeDescription objects for each of scrap item that can be created from the foreign data sources available to this query. The caller is responsible for deleting the TTypeDescription objects added to the collection.
- TMemoryHeap * =0 -The memory heap in which the returned TTypeDescription objects should be created. The default parameter value of 0 will cause the objects to be created in the default heap.
Return Value:
None.
Exceptions:
Throws TForeignDataException(kNoTranslator) if there is no translator which can produce a scrap item type from the specified input data.
Passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
TScrapItem * CreateScrapItem (const TTypeDescription & desired, TMemoryHeap * =0) const
Interface Category:
API.
Purpose:
Performs a translation and returns the requested type of scrap item. The desiredType argument must be one of the types returned by CopyAvailableTypes; if not then TForeignDataException::kNoTranslator will be thrown
Calling Context:
You can call this function directly.
Parameters:
- const TTypeDescription & desired -The type of scrap item which is desired. This must be one of the types returned by CopyAvailableTypes; otherwise an exception will be thrown.
- TMemoryHeap * =0 -The memory heap in which the returned TScrapItem and all of its component objects should be created. The default parameter value of 0 will cause the objects to be created in the default heap.
Return Value:
A newly-created TScrapItem of the requested type that contains the imported data. The caller is responsible for deleting the scrap item.
Exceptions:
Throws TForeignDataException(kNoTranslator) if there is no translator which can produce the requested scrap item type from the specified input data.
Passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.