Throws an exception if this object is not open OdDg::kForRead.
This function should be used only inside member functions that do not modify this object. It should be the first function called by these functions.