HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
openvdb::OPENVDB_VERSION_NAME::io::MappedFile Class Reference

Handle to control the lifetime of a memory-mapped .vdb file. More...

#include <io.h>

Public Types

using Ptr = SharedPtr< MappedFile >
 
using Notifier = std::function< void(std::string)>
 

Public Member Functions

 ~MappedFile ()
 
 MappedFile (const MappedFile &)=delete
 
MappedFileoperator= (const MappedFile &)=delete
 
std::string filename () const
 Return the filename of the mapped file. More...
 
SharedPtr< std::streambuf > createBuffer () const
 Return a new stream buffer for the mapped file. More...
 
void setNotifier (const Notifier &)
 Register a function that will be called with this file's name when the file is unmapped. More...
 
void clearNotifier ()
 Deregister the notifier. More...
 

Friends

class File
 

Detailed Description

Handle to control the lifetime of a memory-mapped .vdb file.

Definition at line 149 of file io.h.

Member Typedef Documentation

Definition at line 172 of file io.h.

Constructor & Destructor Documentation

openvdb::OPENVDB_VERSION_NAME::io::MappedFile::~MappedFile ( )
openvdb::OPENVDB_VERSION_NAME::io::MappedFile::MappedFile ( const MappedFile )
delete

Member Function Documentation

void openvdb::OPENVDB_VERSION_NAME::io::MappedFile::clearNotifier ( )

Deregister the notifier.

SharedPtr<std::streambuf> openvdb::OPENVDB_VERSION_NAME::io::MappedFile::createBuffer ( ) const

Return a new stream buffer for the mapped file.

Typical usage is

openvdb::io::MappedFile::Ptr mappedFile = ...;
auto buf = mappedFile->createBuffer();
std::istream istrm{buf.get()};
// Read from istrm...

The buffer must persist as long as the stream is open.

std::string openvdb::OPENVDB_VERSION_NAME::io::MappedFile::filename ( ) const

Return the filename of the mapped file.

MappedFile& openvdb::OPENVDB_VERSION_NAME::io::MappedFile::operator= ( const MappedFile )
delete
void openvdb::OPENVDB_VERSION_NAME::io::MappedFile::setNotifier ( const Notifier )

Register a function that will be called with this file's name when the file is unmapped.

Friends And Related Function Documentation

friend class File
friend

Definition at line 180 of file io.h.


The documentation for this class was generated from the following file: