Inheritance diagram for Resource:
Public Member Functions | |
protected void | closure () |
this () | |
~this () | |
Object | getLock () |
void | setLock (Object lock) |
void | acquire () |
bool | acquireIfOpen () |
void | close () |
Protected Attributes | |
Object | _lock |
Private Attributes | |
int | usage |
Definition at line 49 of file Resource.d.
|
Make a reasonable attempt to clean up Definition at line 85 of file Resource.d. |
|
Subclasses must implement closure mechanics. This is invoked when the number of close() invocations match that of aquire() -- the latter is typically called immediately following the successful construction of an IResource implementation; one should expect close to be required at least once. Reimplemented from IResource. Reimplemented in Conduit, FileConduit, and Socket. Referenced by close(). |
|
Set the default lock to be this object Reimplemented in DatagramSocket, and SocketConduit. Definition at line 74 of file Resource.d. References _lock. |
|
Return the lock used by this resource Reimplemented from IResource. Definition at line 101 of file Resource.d. References _lock. |
|
Set an alternate lock. Typically one would use this to synchronize multiple different Resource via a common object. Reimplemented from IResource. Definition at line 115 of file Resource.d. |
|
hold a reference to this resource. The caller is now responsible for invoking close() upon this resource; Reimplemented from IResource. Definition at line 130 of file Resource.d. Referenced by Socket::set(), Socket::this(), and FileConduit::this(). |
|
If this resource is still open, acquire it and return true. This is a threadsafe test-and-set mechanism that fails only if the resource is already closed, or was never opened. Note that you are responsible for invoking close() whenever this method returns true. Reimplemented from IResource. Definition at line 149 of file Resource.d. |
|
release a reference to this resource Reimplemented from IResource. Definition at line 168 of file Resource.d. References _lock, closure(), and usage. Referenced by ~this(), and FileConduit::VersionWin32::Win32MappedBuffer::~this(). |
|
Definition at line 51 of file Resource.d. Referenced by acquire(), acquireIfOpen(), close(), getLock(), and this(). |
|
Definition at line 52 of file Resource.d. Referenced by acquire(), acquireIfOpen(), and close(). |