Maintain list of readers and writers. More...
#include <ReaderWriterSet.hpp>
Classes | |
class | Handler |
Public Types | |
typedef ReaderIface *(* | reader_factory_t) (Interface *) |
typedef WriterIface *(* | writer_factory_t) (Interface *) |
typedef std::list< Handler >::const_iterator | iterator |
Public Member Functions | |
ReaderWriterSet (Core *mdb) | |
~ReaderWriterSet () | |
ErrorCode | register_factory (reader_factory_t reader_fact, writer_factory_t writer_fact, const char *description, const char *const *extensions, const char *name) |
ErrorCode | register_factory (reader_factory_t reader_fact, writer_factory_t writer_fact, const char *description, const char *extension, const char *name) |
ReaderIface * | get_file_extension_reader (const std::string &filename) const |
WriterIface * | get_file_extension_writer (const std::string &filename) const |
ReaderIface * | get_file_reader (const char *format_name) const |
WriterIface * | get_file_writer (const char *format_name) const |
iterator | begin () const |
iterator | end () const |
iterator | handler_from_extension (const std::string &extension, bool with_reader=false, bool with_writer=false) const |
iterator | handler_by_name (const char *name) const |
Static Public Member Functions | |
static std::string | extension_from_filename (const std::string &filename) |
Private Attributes | |
Core * | mbCore |
std::list< Handler > | handlerList |
Maintain list of readers and writers.
Definition at line 36 of file ReaderWriterSet.hpp.
typedef std::list< Handler >::const_iterator moab::ReaderWriterSet::iterator |
Definition at line 161 of file ReaderWriterSet.hpp.
typedef ReaderIface*( * moab::ReaderWriterSet::reader_factory_t) (Interface *) |
Definition at line 40 of file ReaderWriterSet.hpp.
typedef WriterIface*( * moab::ReaderWriterSet::writer_factory_t) (Interface *) |
Definition at line 41 of file ReaderWriterSet.hpp.
moab::ReaderWriterSet::ReaderWriterSet | ( | Core * | mdb | ) |
Definition at line 87 of file ReaderWriterSet.cpp.
References moab::ReadABAQUS::factory(), moab::ReadCCMIO::factory(), moab::ReadCGNS::factory(), moab::ReadDamsel::factory(), moab::ReadGmsh::factory(), moab::ReadHDF5::factory(), moab::ReadIDEAS::factory(), moab::ReadMCNP5::factory(), moab::ReadNASTRAN::factory(), moab::ReadNC::factory(), moab::ReadNCDF::factory(), moab::ReadOBJ::factory(), moab::ReadRTT::factory(), moab::ReadSmf::factory(), moab::ReadSms::factory(), moab::ReadSTL::factory(), moab::ReadTemplate::factory(), moab::ReadTetGen::factory(), moab::ReadVtk::factory(), moab::Tqdcfr::factory(), moab::WriteAns::factory(), moab::WriteCCMIO::factory(), moab::WriteCGNS::factory(), moab::WriteGmsh::factory(), moab::WriteGMV::factory(), moab::WriteHDF5::factory(), moab::WriteNC::factory(), moab::WriteNCDF::factory(), moab::WriteSLAC::factory(), moab::WriteSmf::factory(), moab::WriteSTL::factory(), moab::WriteTemplate::factory(), moab::WriteVtk::factory(), moab::WriteHDF5Parallel::factory(), moab::WriteDamsel::factory(), and register_factory().
moab::ReaderWriterSet::~ReaderWriterSet | ( | ) |
Definition at line 161 of file ReaderWriterSet.cpp.
|
inline |
Definition at line 163 of file ReaderWriterSet.hpp.
References handlerList.
Referenced by handler_by_name(), handler_from_extension(), list_formats(), moab::Core::serial_load_file(), and moab::Core::serial_read_tag().
|
inline |
Definition at line 168 of file ReaderWriterSet.hpp.
References handlerList.
Referenced by get_file_extension_reader(), get_file_extension_writer(), handler_by_name(), handler_from_extension(), list_formats(), register_factory(), moab::Core::serial_load_file(), and moab::Core::serial_read_tag().
|
static |
Get the file extension from a file name
Definition at line 223 of file ReaderWriterSet.cpp.
Referenced by get_file_extension_reader(), get_file_extension_writer(), moab::Core::serial_load_file(), and moab::Core::write_file().
ReaderIface * moab::ReaderWriterSet::get_file_extension_reader | ( | const std::string & | filename | ) | const |
Create a reader object for the passed file name according to the dot-extension of the file name. Caller must delete the object when finished. Returns null if no matching file extension.
Definition at line 209 of file ReaderWriterSet.cpp.
References end(), extension_from_filename(), handler_from_extension(), and mbCore.
Referenced by moab::Core::serial_read_tag().
WriterIface * moab::ReaderWriterSet::get_file_extension_writer | ( | const std::string & | filename | ) | const |
Create a writer object for the passed file name according to the dot-extension of the file name. Caller must delete the object when finished. Returns null if no matching file extension.
Definition at line 216 of file ReaderWriterSet.cpp.
References end(), extension_from_filename(), handler_from_extension(), and mbCore.
ReaderIface* moab::ReaderWriterSet::get_file_reader | ( | const char * | format_name | ) | const |
Create a reader object for the passed file format type. Caller is responsible for deletion of returned object. Returns NULL if no match.
WriterIface* moab::ReaderWriterSet::get_file_writer | ( | const char * | format_name | ) | const |
Create a writer object for the passed file format type. Caller is responsible for deletion of returned object. Returns NULL if no match.
ReaderWriterSet::iterator moab::ReaderWriterSet::handler_by_name | ( | const char * | name | ) | const |
Definition at line 305 of file ReaderWriterSet.cpp.
References begin(), and end().
Referenced by register_factory().
ReaderWriterSet::iterator moab::ReaderWriterSet::handler_from_extension | ( | const std::string & | extension, |
bool | with_reader = false , |
||
bool | with_writer = false |
||
) | const |
Definition at line 249 of file ReaderWriterSet.cpp.
References begin(), and end().
Referenced by get_file_extension_reader(), get_file_extension_writer(), and register_factory().
ErrorCode moab::ReaderWriterSet::register_factory | ( | reader_factory_t | reader_fact, |
writer_factory_t | writer_fact, | ||
const char * | description, | ||
const char *const * | extensions, | ||
const char * | name | ||
) |
Regiseter a reader and/or writer Either factory function may be NULL, but not both.
reader_fact | A factory method to create an instance of the reader |
writer_fact | A factory method to create an instance of the reader |
description | A short description of the file format. |
extensions | A null-terminated list of file extensions |
name | File format identifier string. |
Definition at line 163 of file ReaderWriterSet.cpp.
References end(), handler_by_name(), handler_from_extension(), handlerList, MB_SET_ERR, and MB_SUCCESS.
Referenced by ReaderWriterSet(), and register_factory().
ErrorCode moab::ReaderWriterSet::register_factory | ( | reader_factory_t | reader_fact, |
writer_factory_t | writer_fact, | ||
const char * | description, | ||
const char * | extension, | ||
const char * | name | ||
) |
|
private |
Definition at line 182 of file ReaderWriterSet.hpp.
Referenced by begin(), end(), and register_factory().
|
private |
Definition at line 180 of file ReaderWriterSet.hpp.
Referenced by get_file_extension_reader(), and get_file_extension_writer().