C++ API Reference: AccessorFactory< AccessorType > Class Template Reference

AccessorFactory< AccessorType > Class Template Reference

Calls the specified Accessor type's default constructor. More...

#include <adskDataAccessor.h>

+ Inheritance diagram for AccessorFactory< AccessorType >:

Public Member Functions

std::unique_ptr< Accessorcreate () const override
 Returns a factory for creating accessors handling the supported file type. More...
 
- Public Member Functions inherited from AccessorFactoryBase
virtual ~AccessorFactoryBase ()
 Unregisters the factory.
 

Additional Inherited Members

- Protected Member Functions inherited from AccessorFactoryBase
 AccessorFactoryBase (const std::string &fileNameExtension)
 Registers the factory. More...
 

Detailed Description

template<typename AccessorType>
class adsk::Data::AccessorFactory< AccessorType >

Calls the specified Accessor type's default constructor.

Accessor factories automatically register themselves upon construction and deregister themselves upon destruction. So the creator of a factory must maintain it in-scope as long as the factory for the supported file extension(s) is needed. Typically, this will be a file-scope variable declared with the accessor implementation.

For example (in myAccessor.cpp), to support *.myext files:

class MyAccessor : public adsk::Data::Accessor { ... };

adsk::Data::AccessorFactory< MyAccessor > myFactory( "myext" );

Member Function Documentation

std::unique_ptr< Accessor > create ( ) const
inlineoverridevirtual

Returns a factory for creating accessors handling the supported file type.

Returns
A new accessor for the file type supported by the concrete factory.

Implements AccessorFactoryBase.


The documentation for this class was generated from the following file:
  • adskDataAccessor.h