FunctionHandler::SetUrn

Contents

FunctionHandler::SetUrn#

inline FunctionHandler<F> &YR::FunctionHandler::SetUrn(const std::string &urn)#

Set the URN for the current function invocation, which can be used in conjunction with CppFunction or JavaFunction.

int main(void) {
    YR::Config conf;
    YR::Init(conf);

    auto r1 =
    YR::CppFunction<int>("PlusOne").
    SetUrn("sn:cn:yrk:default:function:0-opc-opc:$latest").Invoke(2);
    YR::Get(r1);
    return 0;
}

Template Parameters:

F – the function type.

Parameters:

urn – the function URN, which should match the tenant ID configured in the config.

Returns:

FunctionHandler<F>&: a reference to the function handler object, facilitating direct invocation of the Invoke interface.