libabigail
Classes | Functions
abigail::sptr_utils Namespace Reference

Namespace for the utilities to wrap C types into std::shared_ptr. More...

Classes

struct  noop_deleter
 A deleter for shared pointers that ... doesn't delete the object managed by the shared pointer. More...
 

Functions

template<class T >
shared_ptr< T > build_sptr ()
 This is to be specialized for the diverse C types that needs wrapping in shared_ptr. More...
 
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. More...
 
template<>
regex::regex_t_sptr build_sptr< regex_t > ()
 Specialization of sptr_utils::build_sptr for regex_t. More...
 
template<>
regex::regex_t_sptr build_sptr< regex_t > (regex_t *p)
 Specialization of sptr_utils::build_sptr for regex_t. More...
 
template<>
shared_ptr< xmlChar > build_sptr< xmlChar > (xmlChar *p)
 Build and return a shared_ptr for a pointer to xmlChar. More...
 
template<>
shared_ptr< xmlTextReader > build_sptr< xmlTextReader > (::xmlTextReader *p)
 Build and return a shared_ptr for a pointer to xmlTextReader. More...
 
template<>
xml::reader_sptr build_sptr< xmlTextReader > (xmlTextReader *p)
 Specialization of sptr_utils::build_sptr for xmlTextReader. More...
 

Detailed Description

Namespace for the utilities to wrap C types into std::shared_ptr.

Function Documentation

◆ build_sptr() [1/2]

shared_ptr<T> abigail::sptr_utils::build_sptr ( )

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>.

Template Parameters
Tthe type of the C type to wrap in a shared_ptr.
Returns
then newly created shared_ptr<T>

◆ build_sptr() [2/2]

shared_ptr<T> abigail::sptr_utils::build_sptr ( T *  p)

This is to be specialized for the diverse C types that needs wrapping in shared_ptr.

Template Parameters
Tthe type of the C type to wrap in a shared_ptr.
Parameters
pa pointer to wrap in a shared_ptr.
Returns
then newly created shared_ptr<T>

◆ build_sptr< regex_t >() [1/2]

Specialization of sptr_utils::build_sptr for regex_t.

This creates a pointer to regex_t and wraps it into a shared_ptr<regex_t>.

Returns
the shared_ptr<regex_t> wrapping the newly created regex_t*

Definition at line 49 of file abg-regex.cc.

◆ build_sptr< regex_t >() [2/2]

regex::regex_t_sptr build_sptr< regex_t > ( regex_t *  p)

Specialization of sptr_utils::build_sptr for regex_t.

This is used to wrap a pointer to regex_t into a shared_ptr<regex_t>.

Parameters
pthe bare pointer to regex_t to wrap into a shared_ptr<regex_t>.
Returns
the shared_ptr<regex_t> that wraps p.

Definition at line 39 of file abg-regex.cc.

◆ build_sptr< xmlChar >()

xml::xml_char_sptr build_sptr< xmlChar > ( xmlChar *  p)

Build and return a shared_ptr for a pointer to xmlChar.

Specialization of build_str for xmlChar.

Definition at line 17 of file abg-libxml-utils.cc.

◆ build_sptr< xmlTextReader >() [1/2]

shared_ptr<xmlTextReader> abigail::sptr_utils::build_sptr< xmlTextReader > ( ::xmlTextReader *  p)

Build and return a shared_ptr for a pointer to xmlTextReader.

Definition at line 17 of file abg-libxml-utils.cc.

◆ build_sptr< xmlTextReader >() [2/2]

xml::reader_sptr abigail::sptr_utils::build_sptr< xmlTextReader > ( xmlTextReader *  p)

Specialization of sptr_utils::build_sptr for xmlTextReader.