Root serialization functions for Logics.
| 447 | |
| 448 | // Root serialization functions for Logics. |
| 449 | void logic_serialize(Logic*& logic, SecObject* obj, Stream* stream) |
| 450 | { |
| 451 | LogicType type; |
| 452 | if (serialization_getMode() == SMODE_WRITE) |
| 453 | { |
| 454 | type = logic->type; |
| 455 | } |
| 456 | |
| 457 | SERIALIZE(ObjState_InitVersion, type, LOGIC_UNKNOWN); |
| 458 | const u32 index = type < LOGIC_UNKNOWN ? type : LOGIC_UNKNOWN; |
| 459 | |
| 460 | if (c_serializeFn[index]) |
| 461 | { |
| 462 | c_serializeFn[index](logic, obj, stream); |
| 463 | if (logic) { logic->type = type; } |
| 464 | } |
| 465 | else |
| 466 | { |
| 467 | TFE_System::logWrite(LOG_ERROR, "Logic", "Serialize - invalid logic type: %d.", type); |
| 468 | if (logic) { logic->type = LOGIC_UNKNOWN; } |
| 469 | assert(0); |
| 470 | } |
| 471 | } |
| 472 | |
| 473 | |
| 474 | /////////////////////////////////////////////////// |
no test coverage detected