Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenRead function in as_02_IAB.cpp should be const #62

Open
kblinova opened this issue Aug 18, 2020 · 3 comments
Open

OpenRead function in as_02_IAB.cpp should be const #62

kblinova opened this issue Aug 18, 2020 · 3 comments

Comments

@kblinova
Copy link

as-02-info FileInfoWrapper would need a special method when it is modified to support IAB essence because it relies on OpenRead functions to be const.

The const'ness of OpenRead method is achieved by delegating the implementation of the reading to an internal class (see h__Reader in other implementations).

@palemieux
Copy link
Contributor

The const'ness of OpenRead method is achieved by delegating the implementation of the reading to an internal class (see h__Reader in other implementations).

I do not know how this is possible. For example, AS_02::JP2K::MXFReader::OpenRead() is defined as const but in fact modifies its internal state through a non-const method call on its own member: m_Reader->OpenRead(filename).

@jhursty
Copy link
Contributor

jhursty commented Aug 24, 2020

The established pattern in the library is that reader instances will work properly when declared const. Whether or not one may agree with it the pattern nonetheless is established and should not be ignored.

@palemieux
Copy link
Contributor

@jhursty What is the objective of defining OpenRead() as const?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants