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

◆ try_add_child_buffer()

template<typename BufferType >
virtual bool MayaFlux::Buffers::RootBuffer< BufferType >::try_add_child_buffer ( std::shared_ptr< BufferType >  buffer,
std::string *  rejection_reason = nullptr 
)
inlinevirtual

Attempts to add a child buffer without throwing exceptions.

Parameters
bufferChild buffer to add to the aggregation hierarchy
rejection_reasonOptional output parameter for rejection reason
Returns
True if buffer was successfully added, false otherwise

This is a non-throwing version of add_child_buffer() that can be used when you want to handle rejection gracefully without exception handling.

Definition at line 49 of file RootBuffer.hpp.

50 {
51 if (!is_buffer_acceptable(buffer, rejection_reason)) {
52 return false;
53 }
54
55 add_child_buffer(buffer);
56 return true;
57 }
virtual void add_child_buffer(std::shared_ptr< BufferType > buffer)
Adds a tributary buffer to this root buffer.
bool is_buffer_acceptable(std::shared_ptr< BufferType > buffer, std::string *rejection_reason=nullptr) const
Validates if a buffer is acceptable based on current token enforcement strategy.