-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Serialisation functions to Label.
Renamed a member to snake_case.
- Loading branch information
1 parent
decbb40
commit 64e184d
Showing
4 changed files
with
29 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "Label.hpp" | ||
|
||
#include "Utility/Serialise.hpp" | ||
|
||
namespace Component | ||
{ | ||
void Label::serialise(std::ostream& p_out, uint16_t p_version, const Label& p_label) | ||
{ | ||
Utility::write_binary(p_out, p_version, p_label.m_name); | ||
} | ||
Label Label::deserialise(std::istream& p_in, uint16_t p_version) | ||
{ | ||
Label label(""); | ||
Utility::read_binary(p_in, p_version, label.m_name); | ||
return label; | ||
} | ||
static_assert(Utility::Is_Serializable_v<Label>, "Label is not serializable, check that the required functions are implemented."); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters