Logo Search packages:      
Sourcecode: qt-gstreamer version File versions  Download package

void QGlib::Value::getData ( Type  dataType,
void *  data 
) const [private]

Retrieves the data from this Value and places it into the memory position pointed to by data. dataType indicates the actual data type of data and is used, among others, to cast data back to the actual C++ type that it points to and assign it.

Note:
This method should only be accessed from ValueImpl.
See also:
Value Design

Definition at line 295 of file value.cpp.

References getData(), init(), and isValid().

Referenced by getData().

{
    if (!isValid()) {
        throw Private::InvalidValueException();
    } else if (g_value_type_compatible(type(), dataType)) {
        ValueVTable vtable = s_dispatcher()->getVTable(dataType);
        if (vtable.get != NULL) {
            vtable.get(*this, data);
        } else {
            throw Private::UnregisteredTypeException(dataType.name().toStdString());
        }
    } else if (dataType.isValueType() && g_value_type_transformable(type(), dataType)) {
        Value v;
        v.init(dataType);

        if (!g_value_transform(d->value(), v.d->value())) {
            throw Private::TransformationFailedException(type().name().toStdString(),
                                                         dataType.name().toStdString());
        }

        v.getData(dataType, data);
    } else {
        throw Private::InvalidTypeException(dataType.name().toStdString(),
                                            type().name().toStdString());
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index