Container which destroys itself when the last copy is destroyed.  
 More...
#include <modm/container/smart_pointer.hpp>
 | 
| 
  | SmartPointer () | 
|   | default constructor with empty payload 
  | 
|   | 
|   | SmartPointer (uint16_t size) | 
|   | Allocates memory from the given size.  More...
  | 
|   | 
| 
template<typename T >  | 
|   | SmartPointer (const T *data) | 
|   | 
| 
  | SmartPointer (const SmartPointer &other) | 
|   | 
| 
const uint8_t *  | getPointer () const | 
|   | 
| 
uint8_t *  | getPointer () | 
|   | 
| 
uint16_t  | getSize () const | 
|   | 
| template<typename T >  | 
| const T &  | get () const | 
|   | 
| template<typename T >  | 
| bool  | get (T &value) const | 
|   | 
| 
bool  | operator== (const SmartPointer &other) | 
|   | 
| 
SmartPointer &  | operator= (const SmartPointer &other) | 
|   | 
Container which destroys itself when the last copy is destroyed. 
This container saves a copy of the given data on the heap. It provides the functionality of a shared pointer => pointer object records when it is copied - when the last copy is destroyed the memory is released. 
 
      
        
          | modm::SmartPointer::SmartPointer  | 
          ( | 
          uint16_t  | 
          size | ) | 
           | 
        
      
 
Allocates memory from the given size. 
- Parameters
 - 
  
    | size | the amount of memory to be allocated, has to be smaller than 65530  | 
  
   
 
 
template<typename T > 
  
  
      
        
          | const T& modm::SmartPointer::get  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get the value that are stored in the pointer casted to the given type. 
- Note
 - This method has no checking mechanism, use get(T) to have at least some.
 
- Returns
 - the stored value converted to 
T  
 
 
template<typename T > 
  
  
      
        
          | bool modm::SmartPointer::get  | 
          ( | 
          T &  | 
          value | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get the value that are stored in the pointer casted to the given type. The method checks only the size but not the type of the stored data
- Returns
 true if the type fit 
 
 
The documentation for this class was generated from the following files:
- smart_pointer.hpp
 
- smart_pointer.cpp