libabigail
Loading...
Searching...
No Matches
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.
 
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.
 
template<>
regex::regex_t_sptr build_sptr< regex_t > ()
 Specialization of sptr_utils::build_sptr for regex_t.
 
template<>
regex::regex_t_sptr build_sptr< regex_t > (regex_t *p)
 Specialization of sptr_utils::build_sptr for regex_t.
 
template<>
xml::xml_char_sptr build_sptr< xmlChar > (xmlChar *p)
 Specialization of build_str for xmlChar.
 
template<>
shared_ptr< xmlChar > build_sptr< xmlChar > (xmlChar *p)
 Build and return a shared_ptr for a pointer to xmlChar.
 
template<>
shared_ptr< xmlTextReader > build_sptr< xmlTextReader > (::xmlTextReader *p)
 Build and return a shared_ptr for a pointer to xmlTextReader.
 
template<>
xml::reader_sptr build_sptr< xmlTextReader > (xmlTextReader *p)
 Specialization of sptr_utils::build_sptr for xmlTextReader.
 

Detailed Description

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

Function Documentation

◆ build_sptr() [1/2]

template<class T >
shared_ptr< T > 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]

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.

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]

template<>
regex::regex_t_sptr build_sptr< regex_t > ( )

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*

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

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

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

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

Specialization of build_str for xmlChar.

Specialization of build_str for xmlChar.

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

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

template<>
shared_ptr< xmlChar > 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]

template<>
shared_ptr< xmlTextReader > 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]

template<>
xml::reader_sptr build_sptr< xmlTextReader > ( xmlTextReader * p)

Specialization of sptr_utils::build_sptr for xmlTextReader.