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:
Noel Eck
2017-07-14 11:16:27 -07:00
parent f59f3131bb
commit 5e7a8b41a3
75 changed files with 264 additions and 19 deletions

View File

@ -343,6 +343,10 @@ namespace upm {
lsm6dsl_context m_lsm6dsl;
private:
/* Disable implicit copy and assignment operators */
LSM6DSL(const LSM6DSL&) = delete;
LSM6DSL &operator=(const LSM6DSL&) = delete;
// Adding a private function definition for java bindings
#if defined(SWIGJAVA) || defined(JAVACALLBACK)
void installISR(LSM6DSL_INTERRUPT_PINS_T intr, int gpio,