mirror of
https://github.com/eclipse/upm.git
synced 2025-07-02 01:41: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:
@ -65,6 +65,10 @@ public:
|
||||
void setBrightness(int dutyPercent);
|
||||
|
||||
private:
|
||||
/* Disable implicit copy and assignment operators */
|
||||
LP8860(const LP8860&) = delete;
|
||||
LP8860 &operator=(const LP8860&) = delete;
|
||||
|
||||
void i2cWriteByte(int reg, int value);
|
||||
void i2cWriteBuffer(int reg, uint8_t* buf, int length);
|
||||
uint8_t i2cReadByte(uint8_t reg);
|
||||
|
Reference in New Issue
Block a user