26#include <arccore/base/FatalErrorException.h>
27#include <arccore/base/TraceInfo.h>
35using namespace Arccore;
100 Integer max_block_size = 0;
101 for (
auto it = all_blocks_sizes.begin(); it != all_blocks_sizes.end(); ++it) {
102 const Integer block_size = it.value();
103 max_block_size = (max_block_size > block_size) ? max_block_size : block_size;
148 Integer max_block_size = 0;
149 for (ValuePerBlock::const_iterator it = all_blocks_sizes.begin();
150 it != all_blocks_sizes.end(); ++it) {
151 const Integer block_size = it.value();
152 max_block_size = (max_block_size > block_size) ? max_block_size : block_size;
164 auto it =
m_internal->m_all_sizes.find(index);
167 throw FatalErrorException(A_FUNCINFO,
"index is not registered");
183std::shared_ptr<VBlock>
186 return std::make_shared<VBlock>(*
this);
const ValuePerBlock & blockSizes() const
Get the size of all blocks.
std::shared_ptr< Internal > m_internal
Actual implementation of variable blocks size.
Arccore::Integer maxBlockSize() const
Get the max size of all block size.
VBlock(ValuePerBlock &&all_blocks_sizes)
Rvalue constructor.
VMap< Arccore::Integer, Arccore::Integer > ValuePerBlock
Type of the size of each block.
std::shared_ptr< VBlock > clone() const
Copy this object.
Arccore::Integer size(Arccore::Integer index) const
Get the size of a block.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Actual implementation of variable blocks size.
ValuePerBlock m_all_sizes
Size for all blocks.
static VBlock::Internal * newVariableSizeBlock(ValuePerBlock &&all_sizes, Integer max_block_size)
Creates a new variable block size element.
Integer m_max_block_size
Maximum size amongst all blocks.