Serializer.cpp
1 /* ************************************************************************** */ 2 /* */ 3 /* ::: :::::::: */ 4 /* Serializer.cpp :+: :+: :+: */ 5 /* +:+ +:+ +:+ */ 6 /* By: gychoi <gychoi@student.42seoul.kr> +#+ +:+ +#+ */ 7 /* +#+#+#+#+#+ +#+ */ 8 /* Created: 2023/12/17 22:25:53 by gychoi #+# #+# */ 9 /* Updated: 2023/12/18 02:50:57 by gychoi ### ########.fr */ 10 /* */ 11 /* ************************************************************************** */ 12 13 #include "Serializer.hpp" 14 15 /* ************************************************************************** */ 16 /* Constructor & Destructor */ 17 /* ************************************************************************** */ 18 19 Serializer::Serializer() 20 { 21 // nothing to do 22 } 23 24 Serializer::Serializer 25 (__attribute__((unused)) Serializer const& target) 26 { 27 // nothing to do 28 } 29 30 Serializer& Serializer::operator= 31 (__attribute((unused)) Serializer const& target) 32 { 33 return *this; 34 } 35 36 Serializer::~Serializer() 37 { 38 // nothing to do 39 } 40 41 /* ************************************************************************** */ 42 /* Static Member Functions */ 43 /* ************************************************************************** */ 44 45 uintptr_t Serializer::serialize(Data* ptr) 46 { 47 return reinterpret_cast<uintptr_t>(ptr); 48 } 49 50 Data* Serializer::deserialize(uintptr_t raw) 51 { 52 return reinterpret_cast<Data *>(raw); 53 }