Working constructor, copy constructor and destructor for DeviceGrid