HP LoadRunner Protocol SDK Test Run API Reference  12.02
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Static Public Member Functions | List of all members
CProtocolExtension Class Referenceabstract

Class CProtocolExtension provides services for interactions with the LoadRunner execution environment. More...

#include <ProtocolExtension.h>

Public Member Functions

virtual ~CProtocolExtension ()
 Destructor.
 
virtual ext_out_config * Register (const char *mProtocolID, void *mExtensionID, ext_in_config *mDriverData)=0
 Registers the protocol in the LoadRunner execution environment. More...
 
virtual void RegisterEventHandler (EVENT_TYPE mEventType, EventHandlerType mHandler)=0
 Registers an event handler for a LoadRunner execution environment event. More...
 
virtual void SetVirtualUserData (void *mData)=0
 Sets a pointer to the virtual user data in the Thread Local Storage (TLS). More...
 
virtual void * GetVirtualUserData ()=0
 Returns a pointer to the virtual user data from the Thread Local Storage (TLS). More...
 
virtual void LogErrorMessage (int mMessageID,...)=0
 Sends a formatted error message to the execution log and updates the transaction status and the step status. More...
 
virtual void LogWarningMessage (int mMessageID,...)=0
 Sends a formatted warning message to the execution log and updates the step status. More...
 
virtual void LogNotifyMessage (LOG_LEVEL mLevel, int mMessageID,...) const =0
 Sends a formatted notification message to the execution log. More...
 
virtual void LogTextMessage (LOG_LEVEL mLevel, const char *mMessage) const =0
 Sends a text message to the log. More...
 
virtual void LogBuffer (LOG_LEVEL mLevel, const char *mBuffer, unsigned int mBufferLength) const =0
 Sends a buffer to the log and handles non-printable characters. More...
 
virtual void CreateDataPoint (const char *mName, double mValue)=0
 Creates a data point for use in analysis. More...
 
virtual CEvaluatedString EvaluateString (const char *mString, int mStringLen=-1)=0
 Returns the string argument after evaluating embedded parameters. More...
 
virtual void SaveStringToParameter (const char *mValue, const char *mParameterName)=0
 Saves a null-terminated string to a parameter. More...
 
virtual const char * GetRunTimeSettingEntryValue (const char *mKey)=0
 Returns the Runtime Setting value for the specified key. More...
 
virtual void SetRunTimeSettingEntryValue (const char *mKey, const char *mValue)=0
 Sets a Runtime Setting value in the virtual user context. More...
 
virtual const char * GetConfigurationAttribute (CONFIGURATION_ATTRIBUTE mAttribute)=0
 Returns a configuration setting value. More...
 
virtual TimerHandlerType RegisterTimer (TimerCallbackType mCallbackFunction, void *mContext, long mTimeout)=0
 Creates and registers a timer for invoking the specified callback asynchronously. More...
 

Static Public Member Functions

static CProtocolExtensionInstance ()
 Returns the protocol extension instance.
 

Detailed Description

Class CProtocolExtension provides services for interactions with the LoadRunner execution environment.

The class provides services for registering the protocol, event handling, logging, data point generation, and so on. CProtocolExtension is a singleton and therefore can be accessed at any point in the protocol implementation.

Member Function Documentation

virtual void CProtocolExtension::CreateDataPoint ( const char *  mName,
double  mValue 
)
pure virtual

Creates a data point for use in analysis.

Exceptions
SDK_INTERNAL_ERRORInternal error
Parameters
mNameThe data point name
mValueThe data point value
virtual CEvaluatedString CProtocolExtension::EvaluateString ( const char *  mString,
int  mStringLen = -1 
)
pure virtual

Returns the string argument after evaluating embedded parameters.

The returned string is not necessarily null-terminated.

Exceptions
SDK_INTERNAL_ERRORInternal error
Parameters
mStringThe input string
mStringLenThe input string length. A value of -1 indicates a NULL terminated string.
virtual const char* CProtocolExtension::GetConfigurationAttribute ( CONFIGURATION_ATTRIBUTE  mAttribute)
pure virtual

Returns a configuration setting value.

Exceptions
SDK_INTERNAL_ERRORInternal error
Parameters
mAttributeThe configuration attribute identifier
virtual const char* CProtocolExtension::GetRunTimeSettingEntryValue ( const char *  mKey)
pure virtual

Returns the Runtime Setting value for the specified key.

Exceptions
SDK_INTERNAL_ERRORThrows internal error if the key does not exist.
Parameters
mKeyThe key of the setting to return
virtual void* CProtocolExtension::GetVirtualUserData ( )
pure virtual

Returns a pointer to the virtual user data from the Thread Local Storage (TLS).

Exceptions
SDK_INTERNAL_ERRORInternal error
virtual void CProtocolExtension::LogBuffer ( LOG_LEVEL  mLevel,
const char *  mBuffer,
unsigned int  mBufferLength 
) const
pure virtual

Sends a buffer to the log and handles non-printable characters.

Can be used for printing network buffers.

Exceptions
SDK_INTERNAL_ERRORInternal error
Parameters
mLevelThe log level for which this message is output
mBufferThe buffer
mBufferLengthThe buffer length
virtual void CProtocolExtension::LogErrorMessage ( int  mMessageID,
  ... 
)
pure virtual

Sends a formatted error message to the execution log and updates the transaction status and the step status.

Parameters
mMessageIDThe message ID in the text resource file
virtual void CProtocolExtension::LogNotifyMessage ( LOG_LEVEL  mLevel,
int  mMessageID,
  ... 
) const
pure virtual

Sends a formatted notification message to the execution log.

Exceptions
SDK_INTERNAL_ERRORInternal error
Parameters
mLevelThe log level for which this notification is output
mMessageIDThe message ID in the text resource file
virtual void CProtocolExtension::LogTextMessage ( LOG_LEVEL  mLevel,
const char *  mMessage 
) const
pure virtual

Sends a text message to the log.

Exceptions
SDK_INTERNAL_ERRORInternal error
Parameters
mLevelThe log level for which this message is output
mMessageThe null-terminated message text
virtual void CProtocolExtension::LogWarningMessage ( int  mMessageID,
  ... 
)
pure virtual

Sends a formatted warning message to the execution log and updates the step status.

Parameters
mMessageIDThe message ID in the text resource file
virtual ext_out_config* CProtocolExtension::Register ( const char *  mProtocolID,
void *  mExtensionID,
ext_in_config *  mDriverData 
)
pure virtual

Registers the protocol in the LoadRunner execution environment.

Returns
A pointer to the protocol configuration object
Parameters
mProtocolIDProtocol ID (up to 63 characters).
mExtensionIDInternal structure
mDriverDataInternal structure
virtual void CProtocolExtension::RegisterEventHandler ( EVENT_TYPE  mEventType,
EventHandlerType  mHandler 
)
pure virtual

Registers an event handler for a LoadRunner execution environment event.

Parameters
mEventTypeThe event type.
mHandlerThe event handler
virtual TimerHandlerType CProtocolExtension::RegisterTimer ( TimerCallbackType  mCallbackFunction,
void *  mContext,
long  mTimeout 
)
pure virtual

Creates and registers a timer for invoking the specified callback asynchronously.

The callback is invoked every mTimeout milliseconds.

Note
You must unregister each timer using UnregisterTimer before exiting from the extension.
Returns
A reference to the timer. Store the return value for use in UnregisterTimer.
Parameters
mCallbackFunctionThe address of a callback routine to be invoked once every mTimeout
mContextThe context will be passed to the callback function on invocation.
mTimeoutThe wait time in milliseconds
virtual void CProtocolExtension::SaveStringToParameter ( const char *  mValue,
const char *  mParameterName 
)
pure virtual

Saves a null-terminated string to a parameter.

Exceptions
SDK_INTERNAL_ERRORInternal error
Parameters
mValueThe value to assign to the parameter
mParameterNameThe name of the parameter
virtual void CProtocolExtension::SetRunTimeSettingEntryValue ( const char *  mKey,
const char *  mValue 
)
pure virtual

Sets a Runtime Setting value in the virtual user context.

Exceptions
SDK_INTERNAL_ERRORThrows internal error if the key does not exist.
Parameters
mKeyThe key of the setting
mValueThe value
virtual void CProtocolExtension::SetVirtualUserData ( void *  mData)
pure virtual

Sets a pointer to the virtual user data in the Thread Local Storage (TLS).

Exceptions
SDK_INTERNAL_ERRORInternal error
Parameters
mDataPointer to the virtual user type defined by the protocol

The documentation for this class was generated from the following file:


Send documentation feedback to HP.


© 1995-2015 Hewlett-Packard Development Company, L.P.