3 #ifndef VISR_LIBRBBL_OBJECT_CHANNEL_ALLOCATOR_HPP_INCLUDED 4 #define VISR_LIBRBBL_OBJECT_CHANNEL_ALLOCATOR_HPP_INCLUDED 41 void setObjects( std::vector<objectmodel::ObjectId >
const & objectIds );
51 std::size_t numberUsedChannels( )
const;
67 std::size_t getUnusedChannel( )
69 if( mUnusedChannels.empty( ) )
71 throw std::runtime_error(
"ObjectChannelAllocator::getUnusedChannel(): Maximum channel number exceeded." );
73 std::size_t nextChannel = mUnusedChannels.back( );
74 mUnusedChannels.pop_back( );
81 void releaseChannel( std::size_t channel )
83 mUnusedChannels.push_back( channel );
89 std::size_t
const mMaxChannels;
94 using ObjectChannelLookup = std::map< objectmodel::ObjectId, std::size_t>;
99 ObjectChannelLookup mLookup;
104 std::vector<std::size_t> mUnusedChannels;
109 mutable std::vector<objectmodel::ObjectId> mSortedIds;
115 #endif // #ifndef VISR_LIBRBBL_OBJECT_CHANNEL_ALLOCATOR_HPP_INCLUDED std::size_t const numChannels
Definition: delay_vector.cpp:21
unsigned int ObjectId
Definition: object.hpp:23
Definition: options.cpp:10
Definition: object_channel_allocator.hpp:25
std::size_t maxChannels() const
Definition: object_channel_allocator.hpp:46