CFEL - ASG Software Suite  2.5.0
CASS
lucassview/id_list.cpp
Go to the documentation of this file.
1 // Copyright (C) 2010, 2015 Lutz Foucar
2 
3 /**
4  * @file lucassview/id_list.cpp contains the classes that can
5  * serialize the key list
6  *
7  * @author Stephan Kassemeyer
8  */
9 
10 
11 #include "id_list.h"
12 
13 using namespace cass;
14 
16 {
18  writeVersion(out);
19  out.add(_size);
21  for (names_t::const_iterator it=_list.begin(); it!=_list.end(); it++)
22  out.add(*it);
23 }
24 
26 {
27  _list.clear();
28  //check whether the version fits//
30  checkVersion(in);
31  _size = in.retrieve<size_t>();
32  if (!in.endChecksumGroupForRead())
33  return false;
34  for(size_t ii=0; ii<_size; ++ii)
35  _list.push_back(in.retrieve<std::string>());
36  return true;
37 }
38 
Processor::names_t _list
a list of all processor keys
void startChecksumGroupForWrite()
control checksum for writing to stream
Definition: serializer.hpp:135
virtual void writeVersion(SerializerBackend &out) const
write the version to the stream
void serialize(SerializerBackend &out) const
serialize the list to the serializer
size_t _size
the size of the processor keys list
void startChecksumGroupForRead()
control checksum calculation for the next values added
Definition: serializer.hpp:106
virtual void checkVersion(SerializerBackend &in) const
check the version
bool deserialize(SerializerBackend &in)
deserialize the list from the serializer
Type retrieve()
read arbitrary value from stream
Definition: serializer.hpp:169
contains the classes that can serialize the key list
void add(const Type &value)
add arbitrary value to the stream
Definition: serializer.hpp:158