RamDiskInterface Class Reference

#include <ramdisk.h>

Detailed Description

A RamDisk provides a complete in-memory file system. It supports a Clone method to efficiently duplicate a whole file system.

Public Member Functions

MAXON_METHOD Result< UrlGetRoot ()
 
MAXON_METHOD Result< RamDiskRef > Clone () const
 

Static Public Member Functions

static MAXON_METHOD Result< RamDiskInterface * > Alloc (MAXON_SOURCE_LOCATION_DECLARATION)
 

Private Member Functions

 MAXON_INTERFACE_NONVIRTUAL (RamDiskInterface, MAXON_REFERENCE_NORMAL, "net.maxon.misc.interface.ramdisk")
 

Member Function Documentation

◆ MAXON_INTERFACE_NONVIRTUAL()

MAXON_INTERFACE_NONVIRTUAL ( RamDiskInterface  ,
MAXON_REFERENCE_NORMAL  ,
"net.maxon.misc.interface.ramdisk"   
)
private

◆ Alloc()

Creates a new empty RAM disk. The RAM disk will use a unique identifier for its root. As long as the RAM disk is alive, it can be found with a Url with the ramdisk scheme and the unique identifier as authority.

Parameters
[in]allocLocationPass MAXON_SOURCE_LOCATION(_NAME) to add the current source line and file.
Returns
New RAM disk.

◆ GetRoot()

MAXON_METHOD Result<Url> GetRoot ( )

Returns the Url of the root directory of this RAM disk. The Url has the ramdisk scheme and uses the unique identifier of the RAM disk as authority. Also the returned Url contains a strong reference on this RAM disk, so it suffices to keep the Url alive to keep this RAM disk alive. Likewise all Urls which are derived from the returned Url will contain a strong reference.

Returns
The Url of this RAM disk's root directory.

◆ Clone()

MAXON_METHOD Result<RamDiskRef> Clone ( ) const

Returns a clone of this RAM disk. This is a cheap operation because as much as possible is shared between the original and the clone.

Returns
Clone of this RAM disk.