MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ write_metadata()

bool MayaFlux::IO::SpatialCache::write_metadata ( const std::string & stream_name,
const std::unordered_map< std::string, std::string > & tags )

Queue object-level metadata tags for a named stream.

Must be called before that stream_name's first write() call: Alembic MetaData is fixed at object creation and cannot be changed afterward. A call arriving after the stream's object already exists is logged and has no effect.

Parameters
stream_nameStream these tags apply to.
tagsKey-value pairs, e.g. run parameters (gravity, bounds, rule shader name).
Returns
True if queued. False only if the stream's object was already created before this call.

Definition at line 405 of file SpatialCache.cpp.

408{
409 std::lock_guard lock(m_impl->mutex);
410
411 if (m_impl->vertex_streams.contains(stream_name) || m_impl->curves_streams.contains(stream_name)) {
412 set_error("write_metadata: stream '" + stream_name
413 + "' already created; call write_metadata before its first write() call");
415 return false;
416 }
417
418 auto& md = m_impl->pending_metadata[stream_name];
419 for (const auto& [key, value] : tags) {
420 md.set(key, value);
421 }
422 return true;
423}
#define MF_ERROR(comp, ctx,...)
std::unique_ptr< Impl > m_impl
std::string get_last_error() const
void set_error(std::string msg) const
@ FileIO
Filesystem I/O operations.
@ IO
Networking, file handling, streaming.

References MayaFlux::Journal::FileIO, get_last_error(), MayaFlux::Journal::IO, m_impl, MF_ERROR, and set_error().

Referenced by operator=().

Here is the call graph for this function:
Here is the caller graph for this function: