kyleliu/mili

add safety policy in bstream

GoogleCodeExporter opened this issue · 7 comments

Bostream should have a template policy, Bostream<SafetyPolicy=Safe>

Safe: checks all custom objects should have operator<< overloaded
Unsafe: custom objects could use default operator<<

Original issue reported on code.google.com by hugo.arregui on 19 Jan 2012 at 3:27

  • Blocking: #61
[deleted comment]
[deleted comment]
[deleted comment]

Original comment by hugo.arregui on 19 Jan 2012 at 1:57

Original comment by hugo.arregui on 21 Feb 2012 at 8:33

Safety policy should apply to integral types as well:
  in safe mode, serialization of integral types should be disallowed (due to bits size), so a manipulator should be used (otherwise: compiler error):
  bos << Serialize32bits(anInt)  //or better name
  bos << Serialize64bits(anInt)
  bis >> Serialize32bits(anInt)
  etc

This should be optional in non-safe mode.

Original comment by daniel.g...@fudepan.org.ar on 10 Mar 2012 at 8:12

Note: safety should apply equally to both binstreams and bostreams.

Original comment by daniel.g...@fudepan.org.ar on 10 Mar 2012 at 8:13