Class CProtocolExtension provides services for interactions with the LoadRunner execution environment.
More...
#include <ProtocolExtension.h>
|
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...
|
|
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.
virtual void CProtocolExtension::CreateDataPoint |
( |
const char * |
mName, |
|
|
double |
mValue |
|
) |
| |
|
pure virtual |
Creates a data point for use in analysis.
- Exceptions
-
SDK_INTERNAL_ERROR | Internal error |
- Parameters
-
mName | The data point name |
mValue | The 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_ERROR | Internal error |
- Parameters
-
mString | The input string |
mStringLen | The input string length. A value of -1 indicates a NULL terminated string. |
Returns a configuration setting value.
- Exceptions
-
SDK_INTERNAL_ERROR | Internal error |
- Parameters
-
mAttribute | The 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_ERROR | Throws internal error if the key does not exist. |
- Parameters
-
mKey | The 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_ERROR | Internal 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_ERROR | Internal error |
- Parameters
-
mLevel | The log level for which this message is output |
mBuffer | The buffer |
mBufferLength | The 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
-
mMessageID | The 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_ERROR | Internal error |
- Parameters
-
mLevel | The log level for which this notification is output |
mMessageID | The 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_ERROR | Internal error |
- Parameters
-
mLevel | The log level for which this message is output |
mMessage | The 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
-
mMessageID | The 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
-
mProtocolID | Protocol ID (up to 63 characters). |
mExtensionID | Internal structure |
mDriverData | Internal structure |
Registers an event handler for a LoadRunner execution environment event.
- Parameters
-
mEventType | The event type. |
mHandler | The event handler |
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
-
mCallbackFunction | The address of a callback routine to be invoked once every mTimeout |
mContext | The context will be passed to the callback function on invocation. |
mTimeout | The 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_ERROR | Internal error |
- Parameters
-
mValue | The value to assign to the parameter |
mParameterName | The 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_ERROR | Throws internal error if the key does not exist. |
- Parameters
-
mKey | The key of the setting |
mValue | The 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_ERROR | Internal error |
- Parameters
-
mData | Pointer to the virtual user type defined by the protocol |
The documentation for this class was generated from the following file: