mirror of
https://github.com/eclipse/upm.git
synced 2025-07-01 09:21:12 +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:
@ -54,8 +54,7 @@ int main(int argc, char **argv)
|
||||
cout << "Using device: " << defaultDev << endl;
|
||||
|
||||
// Instantiate a RN2903 sensor on defaultDev at 57600 baud.
|
||||
upm::RN2903 sensor = upm::RN2903(defaultDev,
|
||||
RN2903_DEFAULT_BAUDRATE);
|
||||
upm::RN2903 sensor (defaultDev, RN2903_DEFAULT_BAUDRATE);
|
||||
|
||||
// To use an internal UART understood by MRAA, use the following
|
||||
// to inititialize rather than the above, which by default uses a
|
||||
|
@ -54,8 +54,7 @@ int main(int argc, char **argv)
|
||||
cout << "Using device: " << defaultDev << endl;
|
||||
|
||||
// Instantiate a RN2903 sensor on defaultDev at 57600 baud.
|
||||
upm::RN2903 sensor = upm::RN2903(defaultDev,
|
||||
RN2903_DEFAULT_BAUDRATE);
|
||||
upm::RN2903 sensor(defaultDev, RN2903_DEFAULT_BAUDRATE);
|
||||
|
||||
// To use an internal UART understood by MRAA, use the following
|
||||
// to inititialize rather than the above, which by default uses a
|
||||
|
@ -42,8 +42,7 @@ int main(int argc, char **argv)
|
||||
cout << "Using device: " << defaultDev << endl;
|
||||
|
||||
// Instantiate a RN2903 sensor on defaultDev at 57600 baud.
|
||||
upm::RN2903 sensor = upm::RN2903(defaultDev,
|
||||
RN2903_DEFAULT_BAUDRATE);
|
||||
upm::RN2903 sensor(defaultDev, RN2903_DEFAULT_BAUDRATE);
|
||||
|
||||
// To use an internal UART understood by MRAA, use the following
|
||||
// to inititialize rather than the above, which by default uses a
|
||||
|
Reference in New Issue
Block a user