Skip to content
Snippets Groups Projects
Commit 4a5f5407 authored by Federico's avatar Federico
Browse files

Improved comments

parent 50f4faa1
No related branches found
No related tags found
No related merge requests found
......@@ -10,13 +10,13 @@ using namespace tscpp;
int main()
{
//Serialize to buffer
//Serialize to stream
Point3d p1(1,2,3);
stringstream ss;
OutputArchive oa(ss);
oa<<p1;
//Unserialize from buffer
//Unserialize from stream
Point3d p2;
InputArchive ia(ss);
ia>>p2;
......
......@@ -34,13 +34,13 @@ int main()
assert(t==md);
});
//Serialize to buffer
//Serialize to stream
stringstream ss;
OutputArchive oa(ss);
oa<<p2d<<p3d<<md;
//Unserialize from buffer
//Unserialize from stream
UnknownInputArchive ia(ss,tp);
ia.unserialize();
ia.unserialize();
......
......@@ -38,7 +38,8 @@ namespace tscpp {
void TypePoolStream::unserializeUnknownImpl(const string& name, istream& is, streampos pos) const
{
auto it=types.find(name);
if(it==types.end()) {
if(it==types.end())
{
is.seekg(pos);
throw TscppException("unknown type",name);
}
......
......@@ -187,7 +187,7 @@ class InputArchive
public:
/**
* Constructor
* \param os ostream where srialized types will be written
* \param is istream where srialized types will be read
*/
InputArchive(std::istream& is) : is(is) {}
......@@ -235,7 +235,9 @@ class UnknownInputArchive
public:
/**
* Constructor
* \param os ostream where srialized types will be written
* \param is istream where srialized types will be read
* \param tp TypePool containing the registered types and callbacks that
* will be called as types are unserialized
*/
UnknownInputArchive(std::istream& is, const TypePoolStream& tp) : is(is), tp(tp) {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment