libabigail/include/abg-sptr-utils.h
Matthias Maennich c458e00db9 Drop unneccessary includes of abg-cxx-compat.h
Remove the unneccessary includes of abg-cxx-compat.h as users have been
migrated to use the corresponding standard includes.

	* include/abg-comparison.h: Remove include of abg-cxx-compat.h.
	* include/abg-diff-utils.h: Likewise.
	* include/abg-fwd.h: Likewise.
	* include/abg-ini.h: Likewise.
	* include/abg-interned-str.h: Likewise.
	* include/abg-ir.h: Likewise.
	* include/abg-libxml-utils.h: Likewise.
	* include/abg-libzip-utils.h: Likewise.
	* include/abg-regex.h: Likewise.
	* include/abg-reporter.h: Likewise.
	* include/abg-sptr-utils.h: Likewise.
	* include/abg-suppression.h: Likewise.
	* include/abg-tools-utils.h: Likewise.
	* include/abg-workers.h: Likewise.
	* src/abg-comp-filter.cc: Likewise.
	* src/abg-comparison-priv.h: Likewise.
	* src/abg-corpus.cc: Likewise.
	* src/abg-dwarf-reader.cc: Likewise.
	* src/abg-hash.cc: Likewise.
	* src/abg-ir.cc: Likewise.
	* src/abg-reader.cc: Likewise.
	* src/abg-suppression.cc: Likewise.
	* src/abg-tools-utils.cc: Likewise.
	* src/abg-writer.cc: Likewise.
	* tests/test-diff-suppr.cc: Likewise.
	* tests/test-read-write.cc: Likewise.
	* tools/abicompat.cc: Likewise.
	* tools/abidw.cc: Likewise.
	* tools/abilint.cc: Likewise.
	* tools/abipkgdiff.cc: Likewise.

Signed-off-by: Matthias Maennich <maennich@google.com>
2020-12-15 09:23:44 +01:00

65 lines
1.3 KiB
C++

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// -*- mode: C++ -*-
//
// Copyright (C) 2013-2020 Red Hat, Inc.
/// @file
///
/// Utilities to ease the wrapping of C types into std::shared_ptr
#ifndef __ABG_SPTR_UTILS_H__
#define __ABG_SPTR_UTILS_H__
#include <regex.h>
#include <memory>
namespace abigail
{
/// Namespace for the utilities to wrap C types into std::shared_ptr.
namespace sptr_utils
{
using std::shared_ptr;
/// This is to be specialized for the diverse C types that needs
/// wrapping in shared_ptr.
///
/// @tparam T the type of the C type to wrap in a shared_ptr.
///
/// @param p a pointer to wrap in a shared_ptr.
///
/// @return then newly created shared_ptr<T>
template<class T>
shared_ptr<T>
build_sptr(T* p);
/// This is to be specialized for the diverse C types that needs
/// wrapping in shared_ptr.
///
/// This variant creates a pointer to T and wraps it into a
/// shared_ptr<T>.
///
/// @tparam T the type of the C type to wrap in a shared_ptr.
///
/// @return then newly created shared_ptr<T>
template<class T>
shared_ptr<T>
build_sptr();
/// A deleter for shared pointers that ... doesn't delete the object
/// managed by the shared pointer.
struct noop_deleter
{
template<typename T>
void
operator()(const T*)
{}
};
}// end namespace sptr_utils
}// end namespace abigail
#endif //__ABG_SPTR_UTILS_H__