pstats_serialize.h 1023 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef __PSTATS_SERIALIZE_H
  2. #define __PSTATS_SERIALIZE_H
  3. namespace serialize {
  4. template <>
  5. struct reader<pstats::stat_t> {
  6. void read(Source& s, pstats::stat_t& sp) {
  7. serialize::read(s, sp.val);
  8. }
  9. };
  10. template <>
  11. struct writer<pstats::stat_t> {
  12. void write(Sink& s, const pstats::stat_t& sp) {
  13. serialize::write(s, sp.val);
  14. }
  15. };
  16. template <>
  17. struct reader<pstats::count_t> {
  18. void read(Source& s, pstats::count_t& sp) {
  19. serialize::read(s, sp.val);
  20. }
  21. };
  22. template <>
  23. struct writer<pstats::count_t> {
  24. void write(Sink& s, const pstats::count_t& sp) {
  25. serialize::write(s, sp.val);
  26. }
  27. };
  28. template <>
  29. struct reader<pstats::stats_t> {
  30. void read(Source& s, pstats::stats_t& sp) {
  31. serialize::read(s, sp.stats);
  32. serialize::read(s, sp.counts);
  33. }
  34. };
  35. template <>
  36. struct writer<pstats::stats_t> {
  37. void write(Sink& s, const pstats::stats_t& sp) {
  38. serialize::write(s, sp.stats);
  39. serialize::write(s, sp.counts);
  40. }
  41. };
  42. }
  43. #endif