目录

Search

  1. 前言
  2. 使用转换
  3. 汇总器转换
  4. 自定义转换
  5. 自定义转换函数
  6. 数据屏蔽转换
  7. 数据屏蔽示例
  8. 表达式转换
  9. 外部过程转换
  10. 筛选器转换
  11. HTTP 转换
  12. Identity Resolution 转换
  13. Java 转换
  14. Java 转换 API 引用
  15. Java 表达式
  16. Java 转换示例
  17. 联接器转换
  18. 查找转换
  19. 查找缓存
  20. 动态查找缓存
  21. 规范器转换
  22. 等级转换
  23. 路由器转换
  24. 序列生成器转换
  25. 排序器转换
  26. 源限定符转换
  27. SQL 转换
  28. 在映射中使用 SQL 转换
  29. 存储过程转换
  30. 事务控制转换
  31. 联合转换
  32. 非结构化数据转换
  33. 更新策略转换
  34. XML 转换

转换指南

转换指南

步骤 3。使用实施填充方法存根

步骤 3。使用实施填充方法存根

最后一步是对过程编码。
  1. 打开为过程生成的
    <Procedure_Name>
    .cpp 存根文件。
    在 BankSoft 示例中,打开 fv.cpp 以对 TxINF_BankSoft::FV 过程编码。
  2. 为过程输入 C++ 代码。
    以下代码实施 FV 过程:
    INF_RESULT TxINF_BankSoft::FV() {   // Input port values are mapped to the m_pInParamVector array in   // the InitParams method. Use m_pInParamVector[i].IsValid() to check   // if they are valid. Use m_pInParamVector[i].GetLong or GetDouble,   // etc. to get their value. Generate output data into m_pOutParamVector.   //  TODO: Fill in implementation of the FV method here.     ostrstream ss;     char* s;     INF_BOOLEAN bVal;     double v;     TINFParam* Rate = &m_pInParamVector[0];     TINFParam* nPeriods = &m_pInParamVector[1];     TINFParam* Payment = &m_pInParamVector[2];     TINFParam* PresentValue = &m_pInParamVector[3];     TINFParam* PaymentType = &m_pInParamVector[4];     TINFParam* FV = &m_pOutParamVector[0];     bVal =       INF_BOOLEAN(         Rate->IsValid() &&         nPeriods->IsValid() &&         Payment->IsValid() &&         PresentValue->IsValid() &&         PaymentType->IsValid()       );     if (bVal == INF_FALSE)     {       FV->SetIndicator(INF_SQL_DATA_NULL);       return INF_SUCCESS;     }     v = pow((1 + Rate->GetDouble()), (double)nPeriods->GetLong());     FV->SetDouble(       -(          (PresentValue->GetDouble() * v) +          (Payment->GetDouble() *            (1 + (Rate->GetDouble() * PaymentType->GetLong()))) *          ((v - 1) / Rate->GetDouble())       )     );     ss << "The calculated future value is: " << FV->GetDouble() <<ends;     s = ss.str();     (*m_pfnMessageCallback)(E_MSG_TYPE_LOG, 0, s);     (*m_pfnMessageCallback)(E_MSG_TYPE_ERR, 0, s);     delete [] s;     return INF_SUCCESS; }
    Designer 会生成函数配置文件,包括参数和返回值。需要在函数内输入实际代码,如注释中所示。由于您已引用 POW 函数并定义了
    ostrstream
    变量,因此还必须包含以下预处理器语句:
    在 Windows 中:
    #include <math.h> #include <strstream> using namespace std;
    在 UNIX 中,包含语句如下:
    #include <math.h> #include <strstream.h>
  3. 保存修改的文件。