Go to the documentation of this file.
7 #ifndef OPENVDB_IO_QUEUE_HAS_BEEN_INCLUDED
8 #define OPENVDB_IO_QUEUE_HAS_BEEN_INCLUDED
208 template<
typename Gr
idPtrContainer>
209 Id write(
const GridPtrContainer& grids,
const Archive& archive,
220 std::unique_ptr<Impl> mImpl;
224 template<
typename Gr
idPtrContainer>
226 Queue::write(
const GridPtrContainer& container,
230 std::copy(container.begin(), container.end(), std::back_inserter(grids));
231 return this->writeGridVec(grids, archive, metadata);
237 Queue::write<GridCPtrVec>(
const GridCPtrVec& grids,
240 return this->writeGridVec(grids, archive, metadata);
247 #endif // OPENVDB_IO_QUEUE_HAS_BEEN_INCLUDED
Index32 size() const
Return the number of tasks currently in the queue.
void setTimeout(Index32 seconds=DEFAULT_TIMEOUT)
Set the maximum number of seconds to wait to queue a task when the queue is full.
void removeNotifier(Id)
Deregister the notifier with the given ID.
void setCapacity(Index32)
Set the maximum number of tasks allowed in the queue.
Index32 Id
ID number of a queued task or of a registered notification callback.
Definition: Queue.h:110
uint32_t Index32
Definition: openvdb/Types.h:30
Grid serializer/unserializer.
Definition: Archive.h:33
Id addNotifier(Notifier)
Register a function that will be called with a task's ID and status when that task completes,...
Status
Status of a queued task.
Definition: Queue.h:113
Index32 timeout() const
Return the maximum number of seconds to wait to queue a task when the queue is full.
Queue for asynchronous output of grids to files or streams.
Definition: Queue.h:101
Index32 capacity() const
Return the maximum number of tasks allowed in the queue.
~Queue()
Block until all queued tasks complete (successfully or unsuccessfully).
Id writeGrid(GridBase::ConstPtr grid, const Archive &archive, const MetaMap &fileMetadata=MetaMap())
Queue a single grid for output to a file or stream.
Status status(Id) const
Return the status of the task with the given ID.
bool empty() const
Return true if the queue is empty.
std::vector< GridBase::ConstPtr > GridCPtrVec
Definition: Grid.h:519
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:153
Queue(Index32 capacity=DEFAULT_CAPACITY)
Construct a queue with the given capacity.
void clearNotifiers()
Deregister all notifiers.
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h:101
SharedPtr< const GridBase > ConstPtr
Definition: Grid.h:81
std::function< void(Id, Status)> Notifier
Definition: Queue.h:144
Definition: openvdb/Exceptions.h:13
@ UNKNOWN
Definition: Queue.h:113