Exemplo n.º 1
0
/**
 * @fn Save(CFile &file, int flags)
 *
 * @brief Saves the grid and all parameters to a file
 *
 * @param file - The IO stream to write to
 *
 * @param flags - Bit-wize operation flags
 */
void CFlux2DGrid::Save(CFile &file, int flags) const
{
    file.Save(flags);
    file.Save(m_Globals);
    file.Save(m_ParamsBase);
    file.Save(m_PrevSurfaceIdx);

    GetCurrentSurface().Save(file);
    GetPastSurface().Save(file);
    m_bottom.Save(file);
    
    file.Save(m_InnerMaskFlag);
    m_InnerMaskData.Save(file);

    if ((flags & SAVE_ACTIONS) != 0)
    {
        CActionManager am;
        int i;
        // Save the number of actions
        uint32_t size = 0;
        size += m_SyncActions.Size();
        file.Save(size);
        // Save them all
        for (i = 0; i < m_SyncActions.Size(); i++)
        {
            am.Save(file,m_SyncActions[i]);
        }
    }
}
/**
 * @fn Save(CFile &file, CFlux2DAction* pAction)
 *
 * @brief Saves the action to the CFile
 *
 * @param file - The file to save the action to
 *
 * @param pAction - Pointer to the action to save
 */
void CActionManager::Save(CFile &file, CFlux2DAction* pAction)
{
    int i;
    for (i = 0; i < m_pTypes.Size(); i++)
    {
        if(m_pTypes[i].creatorFunc == pAction->GetCreateFunction())
        { 
            // Found! save with this name
            file.Save(m_pTypes[i].rawTypeName);
            pAction->SaveData(file);
            break;
        }
    }
}