12#ifndef ROOT_ROOFIT_MultiProcess_Message
13#define ROOT_ROOFIT_MultiProcess_Message
22namespace MultiProcess {
37 template <
typename ForwardIt>
40 using value_t =
typename std::iterator_traits<ForwardIt>::value_type;
41 buf_.resize(
sizeof(value_t) * std::distance(first, last));
42 char *out =
buf_.data();
43 for (
ForwardIt it = first; it != last; ++it) {
44 value_t
const &
item = *it;
45 std::memcpy(out, &
item,
sizeof(value_t));
46 out +=
sizeof(value_t);
51 const void *
data()
const {
return buf_.data(); }
56 return reinterpret_cast<T *
>(
buf_.data());
61 return reinterpret_cast<const T *
>(
buf_.data());
65 std::size_t
size()
const {
return buf_.size(); }
74 return out <<
"Message(" <<
msg.size() <<
" bytes)";
A contiguous byte buffer used as the unit of interprocess communication.
std::size_t size() const
Size of the message in bytes.
Message(ForwardIt first, ForwardIt last)
Create a message by copying the bytes of the elements in the range [first, last), like the equivalent...
const void * data() const
Message(std::size_t size)
std::ostream & operator<<(std::ostream &out, const Message &msg)
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...