mirror of
https://github.com/eclipse/upm.git
synced 2025-07-03 02:11:15 +03:00
memory: Hide all copy/assignment ops for class w/heap allocation
Many of the UPM libraries allocate space on the heap but do not explicitly handle copying and assignment. This commit uses C++11 delete to forbit both the copy and assignment operator for these classes. The C++ examples which used assignment operators to initialize class instances were also updated since it did not appear necessary in those cases to use the assignment operator. Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit is contained in:
@ -326,6 +326,10 @@ namespace upm {
|
||||
lsm6ds3h_context m_lsm6ds3h;
|
||||
|
||||
private:
|
||||
/* Disable implicit copy and assignment operators */
|
||||
LSM6DS3H(const LSM6DS3H&) = delete;
|
||||
LSM6DS3H &operator=(const LSM6DS3H&) = delete;
|
||||
|
||||
// Adding a private function definition for java bindings
|
||||
#if defined(SWIGJAVA) || defined(JAVACALLBACK)
|
||||
void installISR(LSM6DS3H_INTERRUPT_PINS_T intr, int gpio,
|
||||
|
Reference in New Issue
Block a user