[MOAB-dev] Reader/Writer filename extension access
Jason Kraftcheck
kraftche at cae.wisc.edu
Fri Apr 30 10:02:46 CDT 2010
Jed Brown wrote:
> On Fri, 30 Apr 2010 09:17:55 -0500, Robert Smith <smithrm at mcs.anl.gov> wrote:
>> Do you mean the code that uses the Readers/Writers? I would agree, it
>> should not depend on the implementation. But does that mean no client
>> code can know which particular Reader/Writer it is using? If that's
>> true then the entire purpose of the ticket seems moot.
>
> I still don't understand the purpose of getting ahold of the
> implementation (dependency violation aside), you have a file/file name,
> there is an API that will give you an instance that reads/writes that
> file, what more do you want? If the issue is debugging, the debugger
> already has that information.
>
>> If that's not what you mean then I don't see how my suggestions open
>> the implementation to the users. They are just new member functions.
>
> So a virtual method in ReaderIface and WriterIface could be acceptable
> as long as you wanted to make the valid extensions built-in to the class
> (instead of being able to specify them when calling
> ReaderWriterSet::register_factory()). Using static members or
> dynamic_cast would violate the fact that
> ReaderWriterSet::register_factory should be the only place where the
> implementations are referred to.
>
There's still high-level code in MBCore that you would be bypassing if you
called into the reader/writer directly. It should not be necessary to do
so. The moab::Interface::write_file function accepts a string name to
specify the desired file format. And specifying a file format for
moab::Interface::read_file should never be necessary. MOAB should figure
out what the file format is w/out requiring the application to specify it.
- jason
More information about the moab-dev
mailing list