ArcGIS Procedural Runtime  3.2.10650
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
prtx::EncoderFactory Class Referenceabstract

#include <EncoderFactory.h>

Inheritance diagram for prtx::EncoderFactory:
[legend]

Public Member Functions

virtual bool canHandleURI (prtx::URIPtr) const final override
 
bool checkOptionKeys (prt::AttributeMap const *opts) const
 
virtual Encodercreate (const prt::AttributeMap *options, prt::Callbacks *callbacks) const =0
 
prt::EncoderInfocreateEncoderInfo () const
 
virtual prt::ContentType getContentType () const final
 
virtual const std::wstring & getDescription () const final
 
virtual prtx::Extension::ExtensionType getExtensionType () const final override
 
virtual const std::wstring & getID () const final
 
virtual const std::wstring & getName () const final
 
- Public Member Functions inherited from prtx::ExtensionFactory
 ExtensionFactory (const ExtensionFactory &)=delete
 
virtual float getMerit () const
 
ExtensionFactoryoperator= (const ExtensionFactory &)=delete
 

Protected Member Functions

 EncoderFactory (const prt::EncoderInfo *info)
 

Protected Attributes

const EncoderInfoImpl * mInfo {nullptr}
 

Additional Inherited Members

- Static Public Member Functions inherited from prtx::ExtensionFactory
static float getDefaultMerit ()
 

Detailed Description

Base class for all encoder factories.

A typical example to create a custom EncoderFactory with the Singleton helper template:

class MyEncoder {
// ...
};
class MyEncoderFactory : public prtx::EncoderFactory, public prtx::ClassUtils::Singleton<MyEncoderFactory> {
public:
MyEncoderFactory(const prt::EncoderInfo* info) : prtx::EncoderFactory(info) { }
virtual ~MyEncoderFactory() { }
virtual MyEncoder* create(const prt::AttributeMap* defaultOptions, prt::Callbacks* callbacks) const {
return new MyEncoder(getID(), defaultOptions, callbacks);
}
static MyEncoderFactory* createInstance() {
// ...
return new MyEncoderFactory(info);
}
};

The factory can then be conveniently registered like this:

manager->addFactory(MyEncoderFactory::instance());

Constructor & Destructor Documentation

◆ EncoderFactory()

prtx::EncoderFactory::EncoderFactory ( const prt::EncoderInfo info)
protected

Constructs an EncoderFactory with the appropriate info. EncoderFactory subclasses must be used with singleton

It is recommended to also protected the constructors of subclasses and use a static member function to create the singleton.

Parameters
infoownership is transferred to EncoderFactory
See also
EncoderInfo

Member Function Documentation

◆ canHandleURI()

virtual bool prtx::EncoderFactory::canHandleURI ( prtx::URIPtr  ) const
inlinefinaloverridevirtual

Encoders can handle any URI.

Returns
Always returns true.

Implements prtx::ExtensionFactory.

◆ checkOptionKeys()

bool prtx::EncoderFactory::checkOptionKeys ( prt::AttributeMap const *  opts) const

Returns true if opts has the same key set as the default options

◆ create()

virtual Encoder* prtx::EncoderFactory::create ( const prt::AttributeMap options,
prt::Callbacks callbacks 
) const
pure virtual

Subclasses must override this member function to create an instance of the corresponding encoder.

Parameters
optionsEncoder options passed by client on generate call.
callbacksOptional callbacks needed to create an instance of the extension.
Returns
A new Encoder instance, must be destroyed by the caller.

◆ createEncoderInfo()

prt::EncoderInfo* prtx::EncoderFactory::createEncoderInfo ( ) const

Returns a copy of the encoder info describing this encoder. Throws prtx::StatusException if the factory is not properly setup.

Returns
A new instance of EncoderInfo, must be destroyed by the caller.

◆ getContentType()

virtual prt::ContentType prtx::EncoderFactory::getContentType ( ) const
finalvirtual

Convenience member function forwarded from EncoderInfo.

Implements prtx::ExtensionFactory.

◆ getDescription()

virtual const std::wstring& prtx::EncoderFactory::getDescription ( ) const
finalvirtual

Convenience member function forwarded from EncoderInfo.

Implements prtx::ExtensionFactory.

◆ getExtensionType()

virtual prtx::Extension::ExtensionType prtx::EncoderFactory::getExtensionType ( ) const
inlinefinaloverridevirtual

Fixate the extension type to prtx::Extension::ET_ENCODER.

Returns
Always returns Extension::ET_ENCODER.

Implements prtx::ExtensionFactory.

◆ getID()

virtual const std::wstring& prtx::EncoderFactory::getID ( ) const
finalvirtual

Convenience member function forwarded from EncoderInfo.

Implements prtx::ExtensionFactory.

◆ getName()

virtual const std::wstring& prtx::EncoderFactory::getName ( ) const
finalvirtual

Convenience member function forwarded from EncoderInfo.

Implements prtx::ExtensionFactory.


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