ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
Garbage< C > Class Template Reference

Garbage container (automatically deletes pointers when destroyed) More...

#include <Garbage.h>

Public Member Functions

void add (C *item)
 Puts an item in the trash. More...
 
void remove (C *item)
 Removes an item from the trash. More...
 
void destroy (C *item)
 To manually delete an item already in the trash. More...
 
 ~Garbage ()
 Destructor. More...
 

Public Attributes

std::unordered_set< C * > m_items
 Items to delete. More...
 

Detailed Description

template<typename C>
class Garbage< C >

Garbage container (automatically deletes pointers when destroyed)

Definition at line 15 of file Garbage.h.

Constructor & Destructor Documentation

◆ ~Garbage()

template<typename C >
Garbage< C >::~Garbage ( )
inline

Destructor.

Automatically deletes all items

Definition at line 40 of file Garbage.h.

References Garbage< C >::m_items.

Member Function Documentation

◆ add()

template<typename C >
void Garbage< C >::add ( C *  item)
inline

Puts an item in the trash.

Definition at line 18 of file Garbage.h.

References Garbage< C >::m_items.

Referenced by ccRegistrationTools::ICP(), and cloudViewer::ICPRegistrationTools::Register().

◆ destroy()

template<typename C >
void Garbage< C >::destroy ( C *  item)
inline

To manually delete an item already in the trash.

Definition at line 32 of file Garbage.h.

References Garbage< C >::m_items.

Referenced by cloudViewer::ICPRegistrationTools::Register().

◆ remove()

template<typename C >
void Garbage< C >::remove ( C *  item)
inline

Removes an item from the trash.

Warning
The item won't be destroyed!

Definition at line 29 of file Garbage.h.

References Garbage< C >::m_items.

Member Data Documentation

◆ m_items

template<typename C >
std::unordered_set<C*> Garbage< C >::m_items

Items to delete.

Definition at line 47 of file Garbage.h.

Referenced by Garbage< C >::add(), Garbage< C >::destroy(), Garbage< C >::remove(), and Garbage< C >::~Garbage().


The documentation for this class was generated from the following file: