declare writeData in hpp