Class: TProviderOperation

Declaration: ProviderOperation.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MCollectible

Inherited By:

TBasicChallenge

Purpose:

TProviderOperation is the abstract base class that represents an operation which can be executed by the license provider. Typical operations are used to challenge the authenticity of the license provider. This can be done by defining an operation that only the license provider knows how to answer, or by asking the license provider something about the activation keys that it is serving.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

The TProviderOperation abstract base class will be derived for each provider operation.

Concurrency:

Not multithread safe.

Resource Use:

The GetOperationType and IsEqual member functions need to be overridden for a complete implementation.

Member Function: TProviderOperation::~TProviderOperation

virtual ~ TProviderOperation ()

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.

Member Function: TProviderOperation::operator>>=

TStream & operator >>=(TStream & toWhere) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself out to.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TProviderOperation::operator<<=

TStream & operator <<= (TStream & fromWhere)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself in from.

Exceptions:

Throws TInvalidVersionError if the version of the object is not recognized.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TProviderOperation::GetOperationType

virtual void GetOperationType (TStandardText & token) const

Interface Category:

API.

Purpose:

A pure virtual function that is used to identify the provider operation the object represents. Many times a license provider will be able to execute multiple operations and will need to query the object for its type before trying to execute the operation. This functionality will be replaced by RTTI when it is available.

Calling Context:

Called to get type of operation.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Implementation must be provided by all derived classes.

Member Function: TProviderOperation::SetException

virtual void SetException (const TLicenseException & except)

Interface Category:

API.

Purpose:

Enables a provider to propagate any license exceptions arising during processing of operations. Especially when the provider is executing a group of operations, the group may succeed even though individual operations fail.

Calling Context:

The provider executes groups of provider operations during the processing of TLicenseUse::Check and TLicenseUse::ExecuteOperations.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None

Member Function: TProviderOperation::GetException

const TLicenseException * GetException () const

Interface Category:

API.

Purpose:

Enables a licensed product to get the exception set by a provider, when executing operations.

Calling Context:

In TLicenseUse::AcceptOperationsResult (if the operation was provided by TLicenseUse::GetOperations) or the calling context of TLicenseUse::ExecuteOperations (the alternative method of furnishing operations to a provider) the TLicenseUse derived class can get, inspect and handle this exception. Such processing is unusual, because normally the provider inspects the results of executing the group of operations and throws an exception that would be passed via the TLicenseUse::ReportExceptions mechanism if the group had failed. Only a TLicenseUse derived class looking for unusual circumstances should need to use GetException.

Parameters:

Return Value:

A constant pointer to the exception. The returned pointer continues to be owned by TProviderOperation, and the caller should only examine the exception.

Exceptions:

Throws no exceptions, 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.