我现在手头有一份基于MFC架构的C++项目。
目标是:把部分功能代码移植到安卓上。
目前进展:
注:非指针类型的数据的迁移十分简单,不赘述。
1. struct 类型内成员变量指针。
例子:struct Node
{
/// it seems that the member order should be placed according to access frequency
NLinkFlowType m_nCap[NeighborhoodSize];
TLinkFlowType m_tCap; // if m_tCap > 0, then residual capacity of edge source->node is m_tCap
// if m_tCap < 0, then residual capacity of edge node->sink is -m_tCap
unsigned int m_ts; /// time stamp
unsigned int m_dist; /// distance to the terminal
unsigned int m_parent : 4;
unsigned int m_tree : 1; // 0 = source, 1 = sink (if parent!=PARENT_FREE)
unsigned int m_