自定义插件调用DolphinDB函数可以参考如下文档的1.4节
内置函数分为运算符函数以及系统函数
step1
目前有两个函数可以区分系统函数还是运算符函数函数
inline bool isSystemFunction() const {return defType_ == SYSFUNC;}
inline FUNCTIONDEF_TYPE getFunctionDefType() const {return defType_;}
step2 系统函数与运算符函数
createPartitionedTable 是系统函数
vector<ConstantSP> args{dbHandle, load(MySQLTableName_or_query, schema, 0, 1), new String(tableName), partitionColumns};
ret = heap->currentSession()->getFunctionDef("createPartitionedTable")->call(heap, args);
cumsum是运算符函数
ConstantSP v = Util::createIndexVector(1, 100); v->setTemporary(false); //v 的值可能在内置函数调用时被修改。如果不希望它被修改,应先调用 setTemporary(false) FunctionDefSP cumsum = heap->currentSession()->getFunctionDef("cumsum"); ConstantSP result = cumsum->call(heap, v, new Void()); // 相当于 cumsum(v),这里的 new Void() 是一个占位符,没有实际用途