OpenVDB: MappedFile Class Reference

OpenVDB 3.2.0

Public Types | Public Member Functions | Friends | List of all members
MappedFile Class Reference

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

`#include <io.h>`

## Public Types
typedef boost::shared_ptr< MappedFile > | Ptr
typedef boost::function< void(std::string)> | Notifier

## Public Member Functions
| ~MappedFile ()
std::string | filename () const
| Return the filename of the mapped file. More...
boost::shared_ptr< 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.

## Member Typedef Documentation

## ◆ Notifier

typedef boost::function<void(std::string )> Notifier

## ◆ Ptr

typedef boost::shared_ptr<MappedFile> Ptr

## Constructor & Destructor Documentation

## ◆ ~MappedFile()

~MappedFile | ( |  | ) |

## Member Function Documentation

## ◆ clearNotifier()

void clearNotifier | ( |  | ) |

Deregister the notifier.

## ◆ createBuffer()

boost::shared_ptr<std::streambuf> createBuffer | ( |  | ) | const

Return a new stream buffer for the mapped file.

Typical usage is

openvdb::io::MappedFile::Ptr mappedFile = ...;
boost::shared_ptr<std::streambuf> buf = mappedFile->createBuffer();
std::istream istrm(buf.get());
// Read from istrm...

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

## ◆ filename()

std::string filename | ( |  | ) | const

Return the filename of the mapped file.

## ◆ setNotifier()

void 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

## ◆ File

friend class File
| friend

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

- io.h