libopenraw
OpenRaw::Internals::RawFileFactory Class Reference

Public Types

typedef std::function< RawFile *(const IO::Stream::Ptr &)> raw_file_factory_t
typedef std::map< RawFile::Type, raw_file_factory_t > Table
typedef std::map< std::string, RawFile::Type > Extensions

Public Member Functions

 RawFileFactory (RawFile::Type type, const raw_file_factory_t &fn, const char *ext)

Static Public Member Functions

static Tabletable ()
static Extensions & extensions ()
static const char ** fileExtensions ()
static void registerType (RawFile::Type type, const raw_file_factory_t &fn, const char *ext)
static void unRegisterType (RawFile::Type type)

Detailed Description

Definition at line 34 of file rawfilefactory.hpp.

Member Typedef Documentation

◆ Extensions

typedef std::map<std::string, RawFile::Type> OpenRaw::Internals::RawFileFactory::Extensions

Definition at line 44 of file rawfilefactory.hpp.

◆ raw_file_factory_t

typedef std::function<RawFile*(const IO::Stream::Ptr&)> OpenRaw::Internals::RawFileFactory::raw_file_factory_t

Definition at line 37 of file rawfilefactory.hpp.

◆ Table

typedef std::map<RawFile::Type, raw_file_factory_t> OpenRaw::Internals::RawFileFactory::Table

the factory type for raw files key is the extension. file is factory method

Definition at line 42 of file rawfilefactory.hpp.

Constructor & Destructor Documentation

◆ RawFileFactory()

OpenRaw::Internals::RawFileFactory::RawFileFactory ( RawFile::Type type,
const raw_file_factory_t & fn,
const char * ext )

register a filetype with the factory

Parameters
typethe type of file
fnthe factory method
extthe extension associated
Note
it is safe to call this method with the same fn and type to register a different extension

Definition at line 39 of file rawfilefactory.cpp.

Member Function Documentation

◆ extensions()

RawFileFactory::Extensions & OpenRaw::Internals::RawFileFactory::extensions ( )
inlinestatic

access the extensions table. Ensure that it has been constructed.

the factory table

Definition at line 83 of file rawfilefactory.hpp.

Referenced by fileExtensions().

◆ fileExtensions()

const char ** OpenRaw::Internals::RawFileFactory::fileExtensions ( )
static

access the the list of file extenstions registered.

Definition at line 69 of file rawfilefactory.cpp.

References extensions().

◆ registerType()

void OpenRaw::Internals::RawFileFactory::registerType ( RawFile::Type type,
const raw_file_factory_t & fn,
const char * ext )
static

Definition at line 47 of file rawfilefactory.cpp.

◆ table()

RawFileFactory::Table & OpenRaw::Internals::RawFileFactory::table ( )
inlinestatic

access the table. Ensure that it has been constructed.

accessor. This make sure the instance has been constructed when needed

the factory table

Definition at line 76 of file rawfilefactory.hpp.

◆ unRegisterType()

void OpenRaw::Internals::RawFileFactory::unRegisterType ( RawFile::Type type)
static

Definition at line 59 of file rawfilefactory.cpp.


The documentation for this class was generated from the following files: