Hammer  1.0.0
Helicity Amplitude Module for Matrix Element Reweighting
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HammerSerial.cc
Go to the documentation of this file.
1 ///
2 /// @file HammerSerial.cc
3 /// @brief Serialization related typedefs and includes
4 ///
5 
6 //**** This file is a part of the HAMMER library
7 //**** Copyright (C) 2016 - 2020 The HAMMER Collaboration
8 //**** HAMMER is licensed under version 3 of the GPL; see COPYING for details
9 //**** Please note the MCnet academic guidelines; see GUIDELINES for details
10 
11 // -*- C++ -*-
13 
14 using namespace std;
15 
16 namespace Hammer {
17 
18  namespace Serial {
19 
20  void DetachedBuffers::add(flatbuffers::DetachedBuffer&& elem, char kind) {
21  _data.push_back(move(elem));
22  _types.push_back(kind);
23  }
24 
25  size_t DetachedBuffers::size() const {
26  return _data.size();
27  }
28 
29  void DetachedBuffers::clear() {
30  _data.clear();
31  _types.clear();
32  }
33 
34  const flatbuffers::DetachedBuffer& DetachedBuffers::buffer(size_t pos) const {
35  return _data.at(pos);
36  }
37 
38  char DetachedBuffers::bufferType(size_t pos) const {
39  return _types.at(pos);
40  }
41 
42  } // namespace Serial
43 
44 } // namespace Hammer
Serialization related typedefs and includes.