Example #1
0
ConstField ConstTransformation::execute(
    MemoryPool pool,
    ConstField input
) const
{
    const ib_field_t* result;
    throw_if_error(ib_tfn_execute(
        pool.ib(),
        ib(),
        input.ib(),
        &result
    ));

    return ConstField(result);
}
Example #2
0
int ConstOperatorInstance::execute(
    Transaction tx,
    ConstField input,
    Field capture
) const
{
    ib_num_t result;
    throw_if_error(
        ib_operator_inst_execute(
            ib(),
            tx.ib(),
            input.ib(),
            capture.ib(),
            &result
        )
    );

    return static_cast<int>(result);
}
Example #3
0
static ib_status_t ibpp_transformation_translator(
    ib_mpool_t* mp,
    const ib_field_t* fin,
    const ib_field_t** fout,
    void *cbdata
)
{
    try {
        ConstTransformation::transformation_t transformation =
            data_to_value<ConstTransformation::transformation_t>(cbdata);

        ConstField result = transformation(MemoryPool(mp), ConstField(fin));

        *fout = result.ib();
    }
    catch (...) {
        return convert_exception();
    }

    return IB_OK;
}
Example #4
0
// See api documentation for discussion of const_cast.
Field Field::remove_const(const ConstField& field)
{
    return Field(const_cast<ib_field_t*>(field.ib()));
}
Example #5
0
void set(Context ctx, ConstField value)
{
    throw_if_error(ib_module_constant_set(ctx.ib(), value.ib()));
}