Elektra  0.9.0
Public Member Functions | List of all members
kdb::tools::Backend Class Reference

A low-level representation of the backend (= set of plugins) that can be mounted. More...

#include <backend.hpp>

Inheritance diagram for kdb::tools::Backend:
Inheritance graph
[legend]
Collaboration diagram for kdb::tools::Backend:
Collaboration graph
[legend]

Public Member Functions

 Backend ()
 Creates a new empty backend.
 
void setMountpoint (Key mountpoint, KeySet mountConf)
 Sets the mountpoint for the backend. More...
 
void setBackendConfig (KeySet const &ks)
 Backend Config to add to. More...
 
void addPlugin (PluginSpec const &spec)
 Add a plugin that can be loaded, meets all constraints. More...
 
void useConfigFile (std::string file)
 
bool validated () const
 
void serialize (kdb::KeySet &ret)
 

Detailed Description

A low-level representation of the backend (= set of plugins) that can be mounted.

To build a backend, you should prefer BackendBuilder, which automatically fixes ordering and allows us to remove plugins.

Member Function Documentation

◆ addPlugin()

void kdb::tools::Backend::addPlugin ( PluginSpec const &  plugin)
virtual

Add a plugin that can be loaded, meets all constraints.

Note
that this does not mean that the backend validates after it is added. It only means that the situation is not getting worse.
Exceptions
PluginCheckExceptionor its subclasses if it was not possible to load the plugin

For validation

See also
validated().

Implements kdb::tools::BackendInterface.

◆ serialize()

void kdb::tools::Backend::serialize ( kdb::KeySet ret)
virtual
Precondition
name and mountpoint set Add plugin serialization into keyset ret.

Only can be done once! (see firstRef in Plugin)

Implements kdb::tools::SerializeInterface.

◆ setBackendConfig()

void kdb::tools::Backend::setBackendConfig ( KeySet const &  ks)
virtual

Backend Config to add to.

Parameters
ksthe config to add, should be below system/

Implements kdb::tools::MountBackendInterface.

◆ setMountpoint()

void kdb::tools::Backend::setMountpoint ( Key  mountpoint,
KeySet  mountConf 
)
virtual

Sets the mountpoint for the backend.

Exceptions
MountpointInvalidException
MountpointAlreadyInUseException
Parameters
mountpointthe key name will be used as mountpoint. It is allowed to pass a key with a KEY_CASCADING_NAME
mountConfneeds to include the keys below system/elektra/mountpoints

Implements kdb::tools::MountBackendInterface.

◆ useConfigFile()

void kdb::tools::Backend::useConfigFile ( std::string  file)
virtual
Precondition
: resolver needs to be loaded first Will check the filename and use it as configFile for this backend.
Exceptions
FileNotValidExceptionif filename is not valid
MissingSymbolif plugin does not implement 'checkfile'

Implements kdb::tools::MountBackendInterface.

◆ validated()

bool kdb::tools::Backend::validated ( ) const
virtual
Returns
true if backend is validated
false if more plugins are needed to be valided

Implements kdb::tools::MountBackendInterface.


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