EBackendFactory

## EBackendFactory EBackendFactory — An abstract base class for backend factories |

## Functions

const gchar * | e_backend_factory_get_hash_key ()
EBackend * | e_backend_factory_new_backend ()
const gchar * | e_backend_factory_get_module_filename ()
gboolean | e_backend_factory_share_subprocess ()

## Types and Values

struct | EBackendFactory
struct | EBackendFactoryClass

## Includes

    #include <libebackend/libebackend.h>

## Description

An EBackendFactory's job is to create an EBackend instance for a given ESource. EBackendFactory and EBackend should be subclassed together, so that each type of EBackendFactory creates a unique type of EBackend.

Each EBackendFactory subclass must define a hash key to uniquely identify itself among other EBackendFactory subclasses. EDataFactory then services incoming connection requests by deriving a hash key from the requested ESource, using the dervied hash key to find an appropriate EBackendFactory, and creating an EBackend instance from that factory to pair with the requested ESource.

## Functions

### e_backend_factory_get_hash_key ()

    const gchar *
    e_backend_factory_get_hash_key (EBackendFactory *factory);

Returns a hash key which uniquely identifies `factory` .

Since only one instance of each EBackendFactory subclass is ever created, the hash key need only be unique among subclasses, not among instances of each subclass.

#### Parameters

factory | an EBackendFactory |

#### Returns

a hash key which uniquely identifies `factory`

Since: 3.4

### e_backend_factory_new_backend ()

    EBackend *
    e_backend_factory_new_backend (EBackendFactory *factory,
                                   ESource *source);

Returns a new EBackend instance for `source` .

#### Parameters

factory | an EBackendFactory |
source | an ESource |

#### Returns

a new EBackend instance for `source`

Since: 3.4

### e_backend_factory_get_module_filename ()

    const gchar *
    e_backend_factory_get_module_filename (EBackendFactory *factory);

Returns the filename of the shared library for the module used to load the backends provided by `factory` .

#### Parameters

factory | an EBackendFactory |

#### Returns

the filename for the module associated to the `factory`

Since: 3.16

### e_backend_factory_share_subprocess ()

    gboolean
    e_backend_factory_share_subprocess (EBackendFactory *factory);

Returns TRUE if the `factory` wants to share the subprocess for all backends provided by itself. Otherwise, returns FALSE.

#### Parameters

factory | an EBackendFactory |

#### Returns

TRUE if the `factory` shares the subprocess for all its backends. Otherwise, FALSE.

Since: 3.16

## Types and Values

### struct EBackendFactory

    struct EBackendFactory {
    };

Contains only private data that should be read and manipulated using the functions below.

Since: 3.4

### struct EBackendFactoryClass

    struct EBackendFactoryClass {
    	/* Methods */
    	const gchar * (*get_hash_key)		(EBackendFactory *factory);
    	EBackend * (*new_backend)		(EBackendFactory *factory,
    						 ESource *source);

    	struct _EModule *e_module;
    	gboolean share_subprocess;
    };

Base class structure for the EBackendFactory class

#### Members

`get_hash_key` () | Get the hash key for this factory |
`new_backend` () | Create a new EBackend of the appropriate type for the passed ESource |
struct _EModule *`e_module`; | An EModule associated with this backend factory |
gboolean `share_subprocess`; | Whether subporcesses for this backend factory should share one process |

Since: 3.4