Open main menu

Difference between revisions of "User talk:David corrales"

m
no edit summary
(Update for 28/3)
m
Line 75: Line 75:
Finally, lets not forget that BaseScummFile uses other tricks to handle the inherited methods from Common::File. Since they are not virtual, the subclasses can create a method with the same signature and still call the base class independently (as done in ScummFile for example). By using the deferred method, this technique could pose problems.
Finally, lets not forget that BaseScummFile uses other tricks to handle the inherited methods from Common::File. Since they are not virtual, the subclasses can create a method with the same signature and still call the base class independently (as done in ScummFile for example). By using the deferred method, this technique could pose problems.


Update 28/03: BaseScummFile could be implemented as a wrapper around Common::File instead of inheriting from it.
'''Update 28/03''': BaseScummFile could be implemented as a wrapper around Common::File instead of inheriting from it.


=== Methods affected by different architectures ===
=== Methods affected by different architectures ===
Line 84: Line 84:
Another option would be to use a pattern like, template for example. And define the algorithm in parts, where each subclass redefines parts as needed. This seems like overkill to me, since most of the backends would use the default implementation. As in a comment inside file.cpp, "such a high price for a simple beautification".
Another option would be to use a pattern like, template for example. And define the algorithm in parts, where each subclass redefines parts as needed. This seems like overkill to me, since most of the backends would use the default implementation. As in a comment inside file.cpp, "such a high price for a simple beautification".


Update 28/03: functions like '''ps2_open''' are actually implemented by ScummVM. If Common::File gets redefined, said implementation will be moved to the appropiate subclass of the new File class.
'''Update 28/03''': functions like '''ps2_open''' are actually implemented by ScummVM. If Common::File gets redefined, said implementation will be moved to the appropiate subclass of the new File class.


=== A possible wrapper ===
=== A possible wrapper ===
Given that the Common::File class inherits itself from two classes: Common::SeekableReadStream and Common::WriteStream, the wrapper itself would have to handle things like "data >> wrapper", since streams usually overload the >> and << operators. Again, this would add a lot of complexity.
Given that the Common::File class inherits itself from two classes: Common::SeekableReadStream and Common::WriteStream, the wrapper itself would have to handle things like "data >> wrapper", since streams usually overload the >> and << operators. Again, this would add a lot of complexity.


Update 28/03: The operators << and >> and not being currently overloaded by the classes Common::File inherits from.
'''Update 28/03''': The operators << and >> and not being currently overloaded by the classes Common::File inherits from.


=== New methods ===
=== New methods ===