commit | 49a30d0c19155654a24ec9b47834661c60f21571 | [log] [tgz] |
---|---|---|
author | Alexander Afanasyev <alexander.afanasyev@ucla.edu> | Mon Jan 21 21:38:48 2013 -0800 |
committer | Alexander Afanasyev <alexander.afanasyev@ucla.edu> | Mon Jan 21 21:38:48 2013 -0800 |
tree | b303e6cc03c9b7d03535415ccd5a2582a6f4c59f | |
parent | c507ac272ea1812d658351ef9c0348fce2449347 [diff] [blame] |
"Small" reorganization and cleaning
diff --git a/ccnx/ccnx-common.h b/ccnx/ccnx-common.h index 41d7814..985965c 100644 --- a/ccnx/ccnx-common.h +++ b/ccnx/ccnx-common.h
@@ -86,6 +86,16 @@ return BytesPtr (); } +template<class Msg> +inline BytesPtr +serializeMsg(const Msg &msg) +{ + int size = msg->ByteSize (); + BytesPtr bytes (new Bytes (size)); + msg->SerializeToArray (head(*bytes), size); + return bytes; +} + // --- Bytes operations end --- // Exceptions