mirror of
https://bitbucket.org/theswgsource/src-1.2.git
synced 2026-07-28 23:16:15 -04:00
32 lines
580 B
C++
Executable File
32 lines
580 B
C++
Executable File
#ifndef UDPLIBRARY_UDPHELPER_H
|
|
#define UDPLIBRARY_UDPHELPER_H
|
|
|
|
// Copyright 2004 Sony Online Entertainment, all rights reserved.
|
|
// Author: Jeff Petersen
|
|
|
|
namespace UdpLibrary
|
|
{
|
|
|
|
class UdpGuard
|
|
{
|
|
public:
|
|
UdpGuard(UdpPlatformGuardObject *obj) { mObj = obj; mObj->Enter(); }
|
|
~UdpGuard() { mObj->Leave(); }
|
|
protected:
|
|
UdpPlatformGuardObject *mObj;
|
|
};
|
|
|
|
class UdpRef
|
|
{
|
|
public:
|
|
UdpRef(UdpRefCount *obj) { mObj = obj; mObj->AddRef(); }
|
|
~UdpRef() { mObj->Release(); }
|
|
|
|
private:
|
|
UdpRefCount *mObj;
|
|
};
|
|
|
|
} // namespace
|
|
|
|
#endif
|