version 1.1, 2006/08/29 17:48:56
|
version 1.2, 2006/09/01 17:51:30
|
|
|
| |
| |
/** | /** |
Encapsulates the incrementing/decrementing of the _currentOperations |
Encapsulates the calling of operationBegin() and operationEnd() for a |
for a ProviderMessageHandler so it won't be unloaded during operations. |
ProviderMessageHandler to help ensure an accurate count of provider |
|
operations. |
*/ | */ |
class ProviderOperationCounter |
class PEGASUS_DEFPM_LINKAGE ProviderOperationCounter |
{ | { |
public: | public: |
ProviderOperationCounter(ProviderMessageHandler* p) | ProviderOperationCounter(ProviderMessageHandler* p) |
: _provider(p) | : _provider(p) |
{ | { |
PEGASUS_ASSERT(_provider != 0); | PEGASUS_ASSERT(_provider != 0); |
_provider->status._currentOperations++; |
_provider->status.operationBegin(); |
} | } |
| |
ProviderOperationCounter(const ProviderOperationCounter& p) | ProviderOperationCounter(const ProviderOperationCounter& p) |
: _provider(p._provider) | : _provider(p._provider) |
{ | { |
PEGASUS_ASSERT(_provider != 0); | PEGASUS_ASSERT(_provider != 0); |
_provider->status._currentOperations++; |
_provider->status.operationBegin(); |
} | } |
| |
~ProviderOperationCounter() | ~ProviderOperationCounter() |
{ | { |
_provider->status._currentOperations--; |
_provider->status.operationEnd(); |
} | } |
| |
ProviderMessageHandler& GetProvider() | ProviderMessageHandler& GetProvider() |