DDC 0.11.0
Loading...
Searching...
No Matches
pdi.cpp
1// Copyright (C) The DDC development team, see COPYRIGHT.md file
2//
3// SPDX-License-Identifier: MIT
4
5#include <string>
6#include <utility>
7#include <vector>
8
9#include <pdi.h>
10
11#include "pdi.hpp"
12
13namespace ddc {
14
15char const* PdiEvent::store_name(std::string&& name)
16{
17 return m_names.emplace_back(std::move(name)).c_str();
18}
19
20char const* PdiEvent::store_name(std::string const& name)
21{
22 return m_names.emplace_back(name).c_str();
23}
24
25PdiEvent::PdiEvent(std::string const& event_name) : m_event_name(event_name) {}
26
27PdiEvent::~PdiEvent() noexcept
28{
29 PDI_event(m_event_name.c_str());
30 for (std::string const& one_name : m_names) {
31 PDI_reclaim(one_name.c_str());
32 }
33}
34
35} // namespace ddc
~PdiEvent() noexcept
Definition pdi.cpp:27
PdiEvent(std::string const &event_name)
Definition pdi.cpp:25
The top-level namespace of DDC.