Changeset View
Changeset View
Standalone View
Standalone View
source/network/Serialization.h
/* Copyright (C) 2015 Wildfire Games. | /* Copyright (C) 2018 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | public: | ||||
* Deserialize the object (i.e. read in data from the buffer and initialize | * Deserialize the object (i.e. read in data from the buffer and initialize | ||||
* the object's fields). Note that it is up to the deserializer to detect | * the object's fields). Note that it is up to the deserializer to detect | ||||
* errors in data format. | * errors in data format. | ||||
* | * | ||||
* @param buffer A pointer pointing to the start of the serialized data. | * @param buffer A pointer pointing to the start of the serialized data. | ||||
* @param end A pointer to the end of the message. | * @param end A pointer to the end of the message. | ||||
* | * | ||||
* @returns a pointer to the location in the buffer right after the | * @returns a pointer to the location in the buffer right after the | ||||
* serialized object, or NULL if there was a data format error | * serialized object, or nullptr if there was a data format error | ||||
*/ | */ | ||||
virtual const u8 *Deserialize(const u8 *buffer, const u8 *end) = 0; | virtual const u8 *Deserialize(const u8 *buffer, const u8 *end) = 0; | ||||
}; | }; | ||||
#endif | #endif |
Wildfire Games · Phabricator