UtilsLite
Utilities for C++ programming
Loading...
Searching...
No Matches
Utils::mex_class_handle< base > Class Template Reference

A class template that manages a C++ object for use with MATLAB. More...

#include <mex_utils.hxx>

Public Member Functions

mex_class_handle< base > const & operator= (mex_class_handle< base > const &)=delete
 Deleted copy assignment operator.
 
 mex_class_handle ()=delete
 Deleted default constructor.
 
 mex_class_handle (base *ptr)
 Constructor that initializes the handle with a pointer to a C++ object.
 
 ~mex_class_handle ()
 Destructor that cleans up the managed object.
 
bool is_valid ()
 Checks if the handle is valid.
 
base * ptr ()
 Retrieves the pointer to the managed C++ object.
 

Detailed Description

template<typename base>
class Utils::mex_class_handle< base >

A class template that manages a C++ object for use with MATLAB.

This class template is designed to wrap a C++ class pointer for integration with MATLAB. It manages the memory of the object and provides a mechanism for checking the validity of the handle.

Template Parameters
baseThe type of the C++ class being wrapped.

Constructor & Destructor Documentation

◆ mex_class_handle() [1/2]

template<typename base>
Utils::mex_class_handle< base >::mex_class_handle ( )
delete

Deleted default constructor.

This constructor is deleted to prevent creating an uninitialized handle.

◆ mex_class_handle() [2/2]

template<typename base>
Utils::mex_class_handle< base >::mex_class_handle ( base * ptr)
inlineexplicit

Constructor that initializes the handle with a pointer to a C++ object.

Parameters
ptrPointer to the C++ object being managed.

◆ ~mex_class_handle()

template<typename base>
Utils::mex_class_handle< base >::~mex_class_handle ( )
inline

Destructor that cleans up the managed object.

Member Function Documentation

◆ is_valid()

template<typename base>
bool Utils::mex_class_handle< base >::is_valid ( )
inline

Checks if the handle is valid.

The handle is considered valid if the signature matches and the type name is correct.

Returns
true if the handle is valid, false otherwise.

◆ operator=()

template<typename base>
mex_class_handle< base > const & Utils::mex_class_handle< base >::operator= ( mex_class_handle< base > const & )
delete

Deleted copy assignment operator.

This operator is deleted to prevent copying of the handle.

◆ ptr()

template<typename base>
base * Utils::mex_class_handle< base >::ptr ( )
inline

Retrieves the pointer to the managed C++ object.

Returns
Pointer to the managed object.

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