Logo Search packages:      
Sourcecode: libgdf version File versions  Download package

template<typename T >
void gdf::Channel::fillRaw ( const T  value,
size_t  num 
)

Fill a number of samples with the same raw value.

value is converted to the channel's data type but otherwise remains unmodified

Definition at line 263 of file Channel.cpp.

    {
        using boost::numeric_cast;

        switch( m_signalheader->get_datatype( ) )
        {
        case INT8: m_data->fill( numeric_cast<int8>(rawval), num ); break;
        case UINT8: m_data->fill( numeric_cast<uint8>(rawval), num ); break;
        case INT16: m_data->fill( numeric_cast<int16>(rawval), num ); break;
        case UINT16: m_data->fill( numeric_cast<uint16>(rawval), num ); break;
        case INT32: m_data->fill( numeric_cast<int32>(rawval), num ); break;
        case UINT32: m_data->fill( numeric_cast<uint32>(rawval), num ); break;
        case INT64: m_data->fill( numeric_cast<int64>(rawval), num ); break;
        case UINT64: m_data->fill( numeric_cast<uint64>(rawval), num ); break;
        case FLOAT32: m_data->fill( numeric_cast<float32>(rawval), num ); break;
        case FLOAT64: m_data->fill( numeric_cast<float64>(rawval), num ); break;
        default: throw exception::invalid_type_id( boost::lexical_cast<std::string>(m_signalheader->get_datatype( )) ); break;
        };
    }

Generated by  Doxygen 1.6.0   Back to index