示例#1
0
 ~Var( void )
 {
     DimList::iterator dim = m_dims.begin();
     DimList::const_iterator last_dim = m_dims.end();
     while ( dim != last_dim )
     {
         if ( *dim ) delete *dim;
         dim++;
     }
     m_dims.clear();
 }
示例#2
0
    const Dim* dim( const std::string name ) const
    {
        DimList::const_iterator dim = m_dims.begin();
        DimList::const_iterator last = m_dims.end();
        while ( dim != last )
        {
            if ( (*dim)->name() == name ) break;
            dim++;
        }

        return( *dim );
    }
示例#3
0
    const Dim* dim( const size_t index ) const
    {
        DimList::const_iterator dim = m_dims.begin();
        DimList::const_iterator last = m_dims.end();
        size_t counter = 0;
        while ( dim != last )
        {
            if ( counter++ == index ) break;
            dim++;
        }

        return( *dim );
    }
示例#4
0
CelledBaseChunkReader::CelledBaseChunkReader(
        const Metadata& m,
        PointPool& pool,
        const arbiter::Endpoint& endpoint)
    : BaseChunkReader(m, pool)
{
    DimList dims;
    dims.push_back(DimInfo("TubeId", "unsigned", 8));
    dims.insert(dims.end(), m.schema().dims().begin(), m.schema().dims().end());
    const Schema celledSchema(dims);
    PointPool celledPool(celledSchema, m.delta());

    auto tubedCells(m.storage().deserialize(endpoint, celledPool, m_id));
    Data::PooledStack tubedData(celledPool.dataPool());

    auto dataNodes(m_pool.dataPool().acquire(tubedCells.size()));
    m_cells = m_pool.cellPool().acquire(tubedCells.size());

    const std::size_t celledPointSize(celledSchema.pointSize());
    const std::size_t tubeIdSize(sizeof(uint64_t));
    uint64_t tube(0);
    char* tPos(reinterpret_cast<char*>(&tube));

    BinaryPointTable table(m.schema());
    pdal::PointRef pointRef(table, 0);

    for (auto& cell : m_cells)
    {
        auto tubedCell(tubedCells.popOne());
        const char* src(tubedCell->uniqueData());

        Data::PooledNode data(dataNodes.popOne());

        std::copy(src, src + tubeIdSize, tPos);
        std::copy(src + tubeIdSize, src + celledPointSize, *data);

        table.setPoint(*data);
        cell.set(pointRef, std::move(data));

        m_points.at(tube).emplace_back(cell.point(), cell.uniqueData());

        tubedData.push(tubedCell->acquire());
    }
}
示例#5
0
    ~File( void )
    {
        if ( m_file ) delete m_file;

        DimList::iterator dim = m_dims.begin();
        DimList::const_iterator last_dim = m_dims.end();
        while ( dim != last_dim )
        {
            if ( *dim ) delete *dim;
            dim++;
        }
        m_dims.clear();

        VarList::iterator var = m_vars.begin();
        VarList::const_iterator last_var = m_vars.end();
        while ( var != last_var )
        {
            if ( *var ) delete *var;
            var++;
        }
        m_vars.clear();
    }