<commit_before>/*************************************************************************
 *
 * TIGHTDB CONFIDENTIAL
 * __________________
 *
 *  [2011] - [2012] TightDB Inc
 *  All Rights Reserved.
 *
 * NOTICE:  All information contained herein is, and remains
 * the property of TightDB Incorporated and its suppliers,
 * if any.  The intellectual and technical concepts contained
 * herein are proprietary to TightDB Incorporated
 * and its suppliers and may be covered by U.S. and Foreign Patents,
 * patents in process, and are protected by trade secret or copyright law.
 * Dissemination of this information or reproduction of this material
 * is strictly forbidden unless prior written permission is obtained
 * from TightDB Incorporated.
 *
 **************************************************************************/

namespace tightdb {

inline ColumnMixed::ColumnMixed(): m_data(0)
{
    create(Allocator::get_default(), 0, 0);
}

inline ColumnMixed::ColumnMixed(Allocator& alloc, const Table* table, std::size_t column_ndx):
    m_data(0)
{
    create(alloc, table, column_ndx);
}

inline ColumnMixed::ColumnMixed(Allocator& alloc, const Table* table, std::size_t column_ndx,
                                ArrayParent* parent, std::size_t ndx_in_parent, ref_type ref):
    m_data(0)
{
    create(alloc, table, column_ndx, parent, ndx_in_parent, ref);
}

inline ref_type ColumnMixed::get_subtable_ref(std::size_t row_idx) const TIGHTDB_NOEXCEPT
{
    TIGHTDB_ASSERT(row_idx < m_types->size());
    if (m_types->get(row_idx) != type_Table) return 0;
    return m_refs->get_as_ref(row_idx);
}

inline std::size_t ColumnMixed::get_subtable_size(std::size_t row_idx) const TIGHTDB_NOEXCEPT
{
    // FIXME: If the table object is cached, it is possible to get the
    // size from it. Maybe it is faster in general to check for the
    // the presence of the cached object and use it when available.
    ref_type top_ref = get_subtable_ref(row_idx);
    if (!top_ref) return 0;
    ref_type columns_ref = Array(top_ref, 0, 0, m_refs->get_alloc()).get_as_ref(1);
    Array columns(columns_ref, 0, 0, m_refs->get_alloc());
    if (columns.is_empty()) return 0;
    ref_type first_col_ref = columns.get_as_ref(0);
    return get_size_from_ref(first_col_ref, m_refs->get_alloc());
}

inline Table* ColumnMixed::get_subtable_ptr(std::size_t row_idx) const
{
    TIGHTDB_ASSERT(row_idx < m_types->size());
    if (m_types->get(row_idx) != type_Table)
        return 0;
    return m_refs->get_subtable_ptr(row_idx);
}

inline void ColumnMixed::detach_subtable_accessors() TIGHTDB_NOEXCEPT
{
    m_refs->detach_subtable_accessors();
}

inline void ColumnMixed::detach_subtable_accessors_virtual() TIGHTDB_NOEXCEPT
{
    detach_subtable_accessors();
}

inline ref_type ColumnMixed::create(std::size_t size, Allocator& alloc)
{
    ColumnMixed c(alloc, 0, 0);
    c.fill(size);
    return c.get_ref();
}


//
// Getters
//

#define TIGHTDB_BIT63 0x8000000000000000

inline int64_t ColumnMixed::get_value(std::size_t ndx) const TIGHTDB_NOEXCEPT
{
    TIGHTDB_ASSERT(ndx < m_types->size());<commit_msg>fixed a warning on 32-bit platforms<commit_after>/*************************************************************************
 *
 * TIGHTDB CONFIDENTIAL
 * __________________
 *
 *  [2011] - [2012] TightDB Inc
 *  All Rights Reserved.
 *
 * NOTICE:  All information contained herein is, and remains
 * the property of TightDB Incorporated and its suppliers,
 * if any.  The intellectual and technical concepts contained
 * herein are proprietary to TightDB Incorporated
 * and its suppliers and may be covered by U.S. and Foreign Patents,
 * patents in process, and are protected by trade secret or copyright law.
 * Dissemination of this information or reproduction of this material
 * is strictly forbidden unless prior written permission is obtained
 * from TightDB Incorporated.
 *
 **************************************************************************/

namespace tightdb {

inline ColumnMixed::ColumnMixed(): m_data(0)
{
    create(Allocator::get_default(), 0, 0);
}

inline ColumnMixed::ColumnMixed(Allocator& alloc, const Table* table, std::size_t column_ndx):
    m_data(0)
{
    create(alloc, table, column_ndx);
}

inline ColumnMixed::ColumnMixed(Allocator& alloc, const Table* table, std::size_t column_ndx,
                                ArrayParent* parent, std::size_t ndx_in_parent, ref_type ref):
    m_data(0)
{
    create(alloc, table, column_ndx, parent, ndx_in_parent, ref);
}

inline ref_type ColumnMixed::get_subtable_ref(std::size_t row_idx) const TIGHTDB_NOEXCEPT
{
    TIGHTDB_ASSERT(row_idx < m_types->size());
    if (m_types->get(row_idx) != type_Table) return 0;
    return m_refs->get_as_ref(row_idx);
}

inline std::size_t ColumnMixed::get_subtable_size(std::size_t row_idx) const TIGHTDB_NOEXCEPT
{
    // FIXME: If the table object is cached, it is possible to get the
    // size from it. Maybe it is faster in general to check for the
    // the presence of the cached object and use it when available.
    ref_type top_ref = get_subtable_ref(row_idx);
    if (!top_ref) return 0;
    ref_type columns_ref = Array(top_ref, 0, 0, m_refs->get_alloc()).get_as_ref(1);
    Array columns(columns_ref, 0, 0, m_refs->get_alloc());
    if (columns.is_empty()) return 0;
    ref_type first_col_ref = columns.get_as_ref(0);
    return get_size_from_ref(first_col_ref, m_refs->get_alloc());
}

inline Table* ColumnMixed::get_subtable_ptr(std::size_t row_idx) const
{
    TIGHTDB_ASSERT(row_idx < m_types->size());
    if (m_types->get(row_idx) != type_Table)
        return 0;
    return m_refs->get_subtable_ptr(row_idx);
}

inline void ColumnMixed::detach_subtable_accessors() TIGHTDB_NOEXCEPT
{
    m_refs->detach_subtable_accessors();
}

inline void ColumnMixed::detach_subtable_accessors_virtual() TIGHTDB_NOEXCEPT
{
    detach_subtable_accessors();
}

inline ref_type ColumnMixed::create(std::size_t size, Allocator& alloc)
{
    ColumnMixed c(alloc, 0, 0);
    c.fill(size);
    return c.get_ref();
}


//
// Getters
//

#define TIGHTDB_BIT63 0x8000000000000000ull

inline int64_t ColumnMixed::get_value(std::size_t ndx) const TIGHTDB_NOEXCEPT
{
    TIGHTDB_ASSERT(ndx < m_types->size());
{'fraction_non_alphanumeric': 0.14478547324441587, 'fraction_numerical': 0.01510525470030532, 'mean_word_length': 4.757631822386679, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7637960', 'n_tokens_mistral': 2139, 'n_tokens_neox': 2004, 'n_words': 526}