Belle II Software development
TimeoutException.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#include "daq/slc/base/TimeoutException.h"
9
10#include <cstdarg>
11#include <cstdio>
12
13using namespace Belle2;
14
15TimeoutException::TimeoutException(const std::string& format, ...)
16{
17 va_list ap;
18 char ss[1024 * 100];
19 // cppcheck-suppress va_start_referencePassed ; the format is taken by const reference throughout this API
20 va_start(ap, format);
21 vsnprintf(ss, sizeof(ss), format.c_str(), ap);
22 va_end(ap);
23 m_comment = ss;
24}
25
26TimeoutException::TimeoutException(int err, const std::string& format, ...)
27{
28 m_err = err;
29 va_list ap;
30 char ss[1024 * 100];
31 // cppcheck-suppress va_start_referencePassed ; the format is taken by const reference throughout this API
32 va_start(ap, format);
33 vsnprintf(ss, sizeof(ss), format.c_str(), ap);
34 va_end(ap);
35 m_comment = ss;
36}
37
Abstract base class for different kinds of events.