Many of the subclasses of IccResource have 'read' methods that return const IccBuf references; for example, IccFile::readRecord, IccTempStore::readItem and IccTerminal::receive.
Care should be taken if you choose to maintain a reference to the IccBuf object, rather than copy the data from the IccBuf reference into your own IccBuf object. For example, consider the following
IccBuf buf(50);
IccTempStore store("TEMPSTOR");
buf = store.readNextItem();
Here, the data in the IccBuf reference returned from IccTempStore::readNextItem is immediately copied into the application's own IccBuf object, so it does not matter if the data is later invalidated. However, the application might look like this
IccTempStore store("TEMPSTOR");
const IccBuf& buf = store.readNextItem();
Here, the IccBuf reference returned from IccTempStore::readNextItem is not copied into the application's own storage and care must therefore be taken.
The returned IccBuf reference typically contains valid data until one of the following conditions is met:
[[ Contents Previous Page | Next Page Index ]]