Fawkes API  Fawkes Development Version
fawkes::SQLiteConfiguration Class Reference

#include <>>

Inheritance diagram for fawkes::SQLiteConfiguration:

Classes

class  SQLiteValueIterator
 

Public Types

enum  transaction_type_t { TRANSACTION_DEFERRED, TRANSACTION_IMMEDIATE, TRANSACTION_EXCLUSIVE }
 Transaction type. More...
 

Public Member Functions

 SQLiteConfiguration ()
 Constructor. More...
 
 SQLiteConfiguration (const char *sysconfdir, const char *userconfdir=NULL)
 Constructor. More...
 
virtual ~SQLiteConfiguration ()
 Destructor. More...
 
virtual void copy (Configuration *copyconf)
 Copy all values from the given configuration. More...
 
virtual void load (const char *filename)
 
virtual bool exists (const char *path)
 
virtual bool is_float (const char *path)
 
virtual bool is_uint (const char *path)
 
virtual bool is_int (const char *path)
 
virtual bool is_bool (const char *path)
 
virtual bool is_string (const char *path)
 
virtual bool is_list (const char *path)
 
virtual bool is_default (const char *path)
 
virtual std::string get_type (const char *path)
 
virtual float get_float (const char *path)
 
virtual unsigned int get_uint (const char *path)
 
virtual int get_int (const char *path)
 
virtual bool get_bool (const char *path)
 
virtual std::string get_string (const char *path)
 
virtual std::vector< float > get_floats (const char *path)
 
virtual std::vector< unsigned int > get_uints (const char *path)
 
virtual std::vector< int > get_ints (const char *path)
 
virtual std::vector< bool > get_bools (const char *path)
 
virtual std::vector< std::string > get_strings (const char *path)
 
virtual ValueIteratorget_value (const char *path)
 
virtual std::string get_comment (const char *path)
 
virtual std::string get_default_comment (const char *path)
 
virtual void set_float (const char *path, float f)
 
virtual void set_uint (const char *path, unsigned int uint)
 
virtual void set_int (const char *path, int i)
 
virtual void set_bool (const char *path, bool b)
 
virtual void set_string (const char *path, std::string &s)
 
virtual void set_string (const char *path, const char *s)
 
virtual void set_floats (const char *path, std::vector< float > &f)
 
virtual void set_uints (const char *path, std::vector< unsigned int > &uint)
 
virtual void set_ints (const char *path, std::vector< int > &i)
 
virtual void set_bools (const char *path, std::vector< bool > &b)
 
virtual void set_strings (const char *path, std::vector< std::string > &s)
 
virtual void set_strings (const char *path, std::vector< const char * > &s)
 
virtual void set_comment (const char *path, std::string &comment)
 
virtual void set_comment (const char *path, const char *comment)
 
virtual void erase (const char *path)
 
virtual void set_default_float (const char *path, float f)
 
virtual void set_default_uint (const char *path, unsigned int uint)
 
virtual void set_default_int (const char *path, int i)
 
virtual void set_default_bool (const char *path, bool b)
 
virtual void set_default_string (const char *path, std::string &s)
 
virtual void set_default_string (const char *path, const char *s)
 
virtual void set_default_comment (const char *path, const char *comment)
 
virtual void set_default_comment (const char *path, std::string &comment)
 
virtual void erase_default (const char *path)
 
void transaction_begin (transaction_type_t ttype=TRANSACTION_DEFERRED)
 Begin SQL Transaction. More...
 
void transaction_commit ()
 Commit SQL Transaction. More...
 
void transaction_rollback ()
 Rollback SQL Transaction. More...
 
ValueIteratoriterator ()
 
ValueIteratoriterator_default ()
 Iterator for all default values. More...
 
ValueIteratoriterator_hostspecific ()
 Iterator for all host-specific values. More...
 
ValueIteratorsearch (const char *path)
 Iterator with search results. More...
 
void lock ()
 Lock the config. More...
 
bool try_lock ()
 Try to lock the config. More...
 
void unlock ()
 Unlock the config. More...
 
SQLiteValueIteratormodified_iterator ()
 Iterator for modified values. More...
 
void try_dump ()
 Try to dump default configuration. More...
 
- Public Member Functions inherited from fawkes::Configuration
virtual ~Configuration ()
 
virtual void add_change_handler (ConfigurationChangeHandler *h)
 Add a configuration change handler. More...
 
virtual void rem_change_handler (ConfigurationChangeHandler *h)
 Remove a configuration change handler. More...
 
virtual float get_float_or_default (const char *path, const float &default_val)
 
virtual unsigned int get_uint_or_default (const char *path, const unsigned int &default_val)
 
virtual int get_int_or_default (const char *path, const int &default_val)
 
virtual bool get_bool_or_default (const char *path, const bool &default_val)
 
virtual std::string get_string_or_default (const char *path, const std::string &default_val)
 
virtual std::vector< float > get_floats_or_defaults (const char *path, const std::vector< float > &default_val)
 
virtual std::vector< unsigned int > get_uints_or_defaults (const char *path, const std::vector< unsigned int > &default_val)
 
virtual std::vector< int > get_ints_or_defaults (const char *path, const std::vector< int > &default_val)
 
virtual std::vector< bool > get_bools_or_defaults (const char *path, const std::vector< bool > &default_val)
 
virtual std::vector< std::string > get_strings_or_defaults (const char *path, const std::vector< std::string > &default_val)
 

Additional Inherited Members

- Protected Types inherited from fawkes::Configuration
typedef std::list< ConfigurationChangeHandler * > ChangeHandlerList
 List that contains pointers to ConfigurationChangeHandler. More...
 
typedef std::multimap< const char *, ConfigurationChangeHandler *, StringLessChangeHandlerMultimap
 Multimap string to config change handlers. More...
 
typedef std::pair< ChangeHandlerMultimap::iterator, ChangeHandlerMultimap::iterator > ChangeHandlerMultimapRange
 Config change handler multimap range. More...
 
- Protected Member Functions inherited from fawkes::Configuration
ChangeHandlerListfind_handlers (const char *path)
 Find handlers for given path. More...
 
void notify_handlers (const char *path, bool comment_changed=false)
 Notify handlers for given path. More...
 
- Protected Attributes inherited from fawkes::Configuration
ChangeHandlerMultimap _change_handlers
 Registered change handlers. More...
 
ChangeHandlerMultimapRange _ch_range
 Change handler range. More...
 

Detailed Description

Configuration storage using SQLite. This implementation of the Configuration interface uses SQLite to store the configuration.

The configuration uses two databases, one is used to store the host-specific configuration and the other one is used to store the default values. Only the default database is meant to reside under version control.

See init() for the structure of the databases. This class strictly serializes all accesses to the database such that only one thread at a time can modify the database.

Definition at line 39 of file sqlite.h.

Member Enumeration Documentation

◆ transaction_type_t

Transaction type.

See SQLite Documentation for BEGIN TRANSACTION.

Enumerator
TRANSACTION_DEFERRED 

Deferred transaction, lock acquired late.

TRANSACTION_IMMEDIATE 

Immediately acquire lock, reading remains possible.

TRANSACTION_EXCLUSIVE 

Immediately acquire lock, no more reading or writing possible.

Definition at line 106 of file sqlite.h.

Constructor & Destructor Documentation

◆ SQLiteConfiguration() [1/2]

fawkes::SQLiteConfiguration::SQLiteConfiguration ( )

Constructor.

Definition at line 186 of file sqlite.cpp.

◆ SQLiteConfiguration() [2/2]

fawkes::SQLiteConfiguration::SQLiteConfiguration ( const char *  sysconfdir,
const char *  userconfdir = NULL 
)

Constructor.

Parameters
sysconfdirsystem configuration directory, will be searched for default configuration file, and system will try to create host-specific database if writable
userconfdiruser configuration directory, will be searched preferably for default configuration file, and will be used to create host-specific database if sysconfdir is not writable. This directory will be created if it does not exist during load().

Definition at line 206 of file sqlite.cpp.

◆ ~SQLiteConfiguration()

fawkes::SQLiteConfiguration::~SQLiteConfiguration ( )
virtual

Destructor.

Definition at line 230 of file sqlite.cpp.

Member Function Documentation

◆ copy()

◆ erase()

void fawkes::SQLiteConfiguration::erase ( const char *  path)
virtual

Erase the given value from the configuration. It is not an error if the value does not exists before deletion.

Parameters
pathpath to value

Implements fawkes::Configuration.

Definition at line 1491 of file sqlite.cpp.

References fawkes::Configuration::notify_handlers().

◆ erase_default()

void fawkes::SQLiteConfiguration::erase_default ( const char *  path)
virtual

Erase the given default value from the configuration. It is not an error if the value does not exists before deletion.

Parameters
pathpath to value

Implements fawkes::Configuration.

Definition at line 1813 of file sqlite.cpp.

References fawkes::Configuration::notify_handlers().

◆ exists()

bool fawkes::SQLiteConfiguration::exists ( const char *  path)
virtual

Check if a given value exists.

Parameters
pathpath to value
Returns
true if the value exists, false otherwise

Implements fawkes::Configuration.

Definition at line 743 of file sqlite.cpp.

References fawkes::Mutex::lock(), and fawkes::Mutex::unlock().

◆ get_bool()

bool fawkes::SQLiteConfiguration::get_bool ( const char *  path)
virtual

Get value from configuration which is of type bool

Parameters
pathpath to value
Returns
value

Implements fawkes::Configuration.

Definition at line 1021 of file sqlite.cpp.

References fawkes::Mutex::lock(), and fawkes::Mutex::unlock().

◆ get_bools()

std::vector< bool > fawkes::SQLiteConfiguration::get_bools ( const char *  path)
virtual

Get list of values from configuration which is of type bool

Parameters
pathpath to value
Returns
value

Implements fawkes::Configuration.

Definition at line 1077 of file sqlite.cpp.

◆ get_comment()

std::string fawkes::SQLiteConfiguration::get_comment ( const char *  path)
virtual

Get comment of value at given path. The value at the given path must exist in the host-specific configuration.

Parameters
pathpath to value
Returns
comment
Exceptions
ConfigEntryNotFoundExceptionshall be thrown if value does not exist
ConfigurationExceptionshall be thrown on any other error

Implements fawkes::Configuration.

Definition at line 803 of file sqlite.cpp.

References fawkes::Mutex::lock(), and fawkes::Mutex::unlock().

◆ get_default_comment()

std::string fawkes::SQLiteConfiguration::get_default_comment ( const char *  path)
virtual

Get comment of value at given path. The value at the given path must exist in the default configuration.

Parameters
pathpath to value
Returns
comment
Exceptions
ConfigEntryNotFoundExceptionshall be thrown if value does not exist
ConfigurationExceptionshall be thrown on any other error

Implements fawkes::Configuration.

Definition at line 832 of file sqlite.cpp.

References fawkes::Mutex::lock(), and fawkes::Mutex::unlock().

◆ get_float()

float fawkes::SQLiteConfiguration::get_float ( const char *  path)
virtual

Get value from configuration which is of type float

Parameters
pathpath to value
Returns
value

Implements fawkes::Configuration.

Definition at line 963 of file sqlite.cpp.

References fawkes::Mutex::lock(), and fawkes::Mutex::unlock().

◆ get_floats()

std::vector< float > fawkes::SQLiteConfiguration::get_floats ( const char *  path)
virtual

Get list of values from configuration which is of type float

Parameters
pathpath to value
Returns
value

Implements fawkes::Configuration.

Definition at line 1059 of file sqlite.cpp.

◆ get_int()

int fawkes::SQLiteConfiguration::get_int ( const char *  path)
virtual

Get value from configuration which is of type int

Parameters
pathpath to value
Returns
value

Implements fawkes::Configuration.

Definition at line 1003 of file sqlite.cpp.

References fawkes::Mutex::lock(), and fawkes::Mutex::unlock().

◆ get_ints()

std::vector< int > fawkes::SQLiteConfiguration::get_ints ( const char *  path)
virtual

Get list of values from configuration which is of type int

Parameters
pathpath to value
Returns
value

Implements fawkes::Configuration.

Definition at line 1071 of file sqlite.cpp.

◆ get_string()

std::string fawkes::SQLiteConfiguration::get_string ( const char *  path)
virtual

Get value from configuration which is of type string

Parameters
pathpath to value
Returns
value

Implements fawkes::Configuration.

Definition at line 1039 of file sqlite.cpp.

References fawkes::Exception::append(), fawkes::Mutex::lock(), and fawkes::Mutex::unlock().

◆ get_strings()

std::vector< std::string > fawkes::SQLiteConfiguration::get_strings ( const char *  path)
virtual

Get list of values from configuration which is of type string

Parameters
pathpath to value
Returns
value

Implements fawkes::Configuration.

Definition at line 1083 of file sqlite.cpp.

◆ get_type()

std::string fawkes::SQLiteConfiguration::get_type ( const char *  path)
virtual

Get type of value at given path.

Parameters
pathpath to value
Returns
string representation of type, one of float, unsigned int, int, bool, or string
Exceptions
ConfigurationExceptionshall be thrown if value does not exist or on any other error.

Implements fawkes::Configuration.

Definition at line 770 of file sqlite.cpp.

References fawkes::Mutex::lock(), and fawkes::Mutex::unlock().

Referenced by is_bool(), is_float(), is_int(), is_string(), and is_uint().

◆ get_uint()

unsigned int fawkes::SQLiteConfiguration::get_uint ( const char *  path)
virtual

Get value from configuration which is of type unsigned int

Parameters
pathpath to value
Returns
value

Implements fawkes::Configuration.

Definition at line 981 of file sqlite.cpp.

References fawkes::Mutex::lock(), and fawkes::Mutex::unlock().

◆ get_uints()

std::vector< unsigned int > fawkes::SQLiteConfiguration::get_uints ( const char *  path)
virtual

Get list of values from configuration which is of type unsigned int

Parameters
pathpath to value
Returns
value

Implements fawkes::Configuration.

Definition at line 1065 of file sqlite.cpp.

◆ get_value()

Configuration::ValueIterator * fawkes::SQLiteConfiguration::get_value ( const char *  path)
virtual

Get value from configuration.

Parameters
pathpath to value
Returns
value iterator for just this one value, maybe invalid if value does not exists.

Implements fawkes::Configuration.

Definition at line 1089 of file sqlite.cpp.

◆ is_bool()

bool fawkes::SQLiteConfiguration::is_bool ( const char *  path)
virtual

Check if a value is of type bool

Parameters
pathpath to value
Returns
true if the value exists and is of type bool

Implements fawkes::Configuration.

Definition at line 879 of file sqlite.cpp.

References get_type().

◆ is_default()

bool fawkes::SQLiteConfiguration::is_default ( const char *  path)
virtual

Check if a value was read from the default config.

Parameters
pathpath to value
Returns
true if the value exists and is only stored in the default config

Implements fawkes::Configuration.

Definition at line 897 of file sqlite.cpp.

References fawkes::Mutex::lock(), and fawkes::Mutex::unlock().

◆ is_float()

bool fawkes::SQLiteConfiguration::is_float ( const char *  path)
virtual

Check if a value is of type float

Parameters
pathpath to value
Returns
true if the value exists and is of type float

Implements fawkes::Configuration.

Definition at line 861 of file sqlite.cpp.

References get_type().

◆ is_int()

bool fawkes::SQLiteConfiguration::is_int ( const char *  path)
virtual

Check if a value is of type int

Parameters
pathpath to value
Returns
true if the value exists and is of type int

Implements fawkes::Configuration.

Definition at line 873 of file sqlite.cpp.

References get_type().

◆ is_list()

bool fawkes::SQLiteConfiguration::is_list ( const char *  path)
virtual

Check if a value is a list.

Parameters
pathpath to value
Returns
true if the value exists and is a list

Implements fawkes::Configuration.

Definition at line 891 of file sqlite.cpp.

◆ is_string()

bool fawkes::SQLiteConfiguration::is_string ( const char *  path)
virtual

Check if a value is of type string

Parameters
pathpath to value
Returns
true if the value exists and is of type string

Implements fawkes::Configuration.

Definition at line 885 of file sqlite.cpp.

References get_type().

◆ is_uint()

bool fawkes::SQLiteConfiguration::is_uint ( const char *  path)
virtual

Check if a value is of type unsigned int

Parameters
pathpath to value
Returns
true if the value exists and is of type unsigned int

Implements fawkes::Configuration.

Definition at line 867 of file sqlite.cpp.

References get_type().

◆ iterator()

Configuration::ValueIterator * fawkes::SQLiteConfiguration::iterator ( )
virtual

Iterator for all values. Returns an iterator that can be used to iterate over all values in the current configuration, it will value the overlay. If a default and a host-specific value exists you will only see the host-specific value.

Returns
iterator over all values

Implements fawkes::Configuration.

Definition at line 1868 of file sqlite.cpp.

◆ iterator_default()

Configuration::ValueIterator * fawkes::SQLiteConfiguration::iterator_default ( )

Iterator for all default values.

Returns an iterator that can be used to iterate over all default values in the current default configuration. Note that this might return less paths than available, because the values for which no default entry exists are not returned.

Returns
iterator over all default values

Definition at line 1888 of file sqlite.cpp.

◆ iterator_hostspecific()

Configuration::ValueIterator * fawkes::SQLiteConfiguration::iterator_hostspecific ( )

Iterator for all host-specific values.

Returns an iterator that can be used to iterate over all host-specific values in the current configuration. Note that this might return less paths than available, because the default values for which no host-specific entry exists are not returned.

Returns
iterator over all host-specific values

Definition at line 1908 of file sqlite.cpp.

◆ load()

void fawkes::SQLiteConfiguration::load ( const char *  file_path)
virtual

Load configuration. Loads configuration data, or opens a file, depending on the implementation. After this call access to all other methods shall be possible.

Parameters
file_pathpath of the configuration file.

Implements fawkes::Configuration.

Definition at line 563 of file sqlite.cpp.

References fawkes::Exception::append(), fawkes::Mutex::lock(), fawkes::HostInfo::short_name(), and fawkes::Mutex::unlock().

◆ lock()

void fawkes::SQLiteConfiguration::lock ( )
virtual

Lock the config.

No further changes or queries can be executed on the configuration and will block until the config is unlocked.

Implements fawkes::Configuration.

Definition at line 1843 of file sqlite.cpp.

References fawkes::Mutex::lock().

◆ modified_iterator()

SQLiteConfiguration::SQLiteValueIterator * fawkes::SQLiteConfiguration::modified_iterator ( )

Iterator for modified values.

Returns an iterator that can be used to iterate over all values that have been modified in the default database in the last load (added, erased or changed).

Returns
iterator over all values

Definition at line 1926 of file sqlite.cpp.

◆ search()

Configuration::ValueIterator * fawkes::SQLiteConfiguration::search ( const char *  path)
virtual

Iterator with search results.

Returns an iterator that can be used to iterate over the search results. All values whose component and path start with the given strings are returned. A call like

config->search("");

is effectively the same as a call to iterator().

Parameters
pathstart of path
Returns
iterator to search results

Implements fawkes::Configuration.

Definition at line 1950 of file sqlite.cpp.

◆ set_bool()

void fawkes::SQLiteConfiguration::set_bool ( const char *  path,
bool  b 
)
virtual

Set new value in configuration of type bool

Parameters
pathpath to value
bnew bool value

Implements fawkes::Configuration.

Definition at line 1304 of file sqlite.cpp.

References fawkes::Mutex::lock(), fawkes::Configuration::notify_handlers(), and fawkes::Mutex::unlock().

Referenced by copy().

◆ set_bools()

void fawkes::SQLiteConfiguration::set_bools ( const char *  path,
std::vector< bool > &  b 
)
virtual

Set new value in configuration of type bool

Parameters
pathpath to value
bnew bool values

Implements fawkes::Configuration.

Definition at line 1430 of file sqlite.cpp.

◆ set_comment() [1/2]

void fawkes::SQLiteConfiguration::set_comment ( const char *  path,
const char *  comment 
)
virtual

Set new comment for existing value. Works like the aforementioned method. Just takes an good ol' char array instead of a std::string.

Parameters
pathpath to value
commentnew comment string

Implements fawkes::Configuration.

Definition at line 1448 of file sqlite.cpp.

References fawkes::Mutex::lock(), fawkes::Configuration::notify_handlers(), and fawkes::Mutex::unlock().

◆ set_comment() [2/2]

void fawkes::SQLiteConfiguration::set_comment ( const char *  path,
std::string &  comment 
)
virtual

Set new comment for existing value.

Parameters
pathpath to value
commentnew comment string

Implements fawkes::Configuration.

Definition at line 1485 of file sqlite.cpp.

◆ set_default_bool()

void fawkes::SQLiteConfiguration::set_default_bool ( const char *  path,
bool  b 
)
virtual

Set new default value in configuration of type bool

Parameters
pathpath to value
bnew bool value

Implements fawkes::Configuration.

Definition at line 1664 of file sqlite.cpp.

References fawkes::Mutex::lock(), fawkes::Configuration::notify_handlers(), and fawkes::Mutex::unlock().

◆ set_default_comment() [1/2]

void fawkes::SQLiteConfiguration::set_default_comment ( const char *  path,
const char *  comment 
)
virtual

Set new default comment for existing default configuration value. Works like the aforementioned method. Just takes an good ol' char array instead of a std::string.

Parameters
pathpath to value
commentnew comment string

Implements fawkes::Configuration.

Definition at line 1771 of file sqlite.cpp.

References fawkes::Mutex::lock(), fawkes::Configuration::notify_handlers(), and fawkes::Mutex::unlock().

Referenced by set_default_comment().

◆ set_default_comment() [2/2]

void fawkes::SQLiteConfiguration::set_default_comment ( const char *  path,
std::string &  comment 
)
virtual

Set new default comment for existing default configuration value.

Parameters
pathpath to value
commentnew comment string

Implements fawkes::Configuration.

Definition at line 1807 of file sqlite.cpp.

References set_default_comment().

◆ set_default_float()

void fawkes::SQLiteConfiguration::set_default_float ( const char *  path,
float  f 
)
virtual

Set new default value in configuration of type float

Parameters
pathpath to value
fnew float value

Implements fawkes::Configuration.

Definition at line 1517 of file sqlite.cpp.

References fawkes::Mutex::lock(), fawkes::Configuration::notify_handlers(), and fawkes::Mutex::unlock().

◆ set_default_int()

void fawkes::SQLiteConfiguration::set_default_int ( const char *  path,
int  i 
)
virtual

Set new default value in configuration of type int

Parameters
pathpath to value
inew int value

Implements fawkes::Configuration.

Definition at line 1616 of file sqlite.cpp.

References fawkes::Mutex::lock(), fawkes::Configuration::notify_handlers(), and fawkes::Mutex::unlock().

◆ set_default_string() [1/2]

void fawkes::SQLiteConfiguration::set_default_string ( const char *  path,
const char *  s 
)
virtual

Set new default value in configuration of type string. Works like the aforementioned method. Just takes an good ol' char array instead of a std::string.

Parameters
pathpath to value
snew string value

Implements fawkes::Configuration.

Definition at line 1714 of file sqlite.cpp.

References fawkes::Mutex::lock(), fawkes::Configuration::notify_handlers(), and fawkes::Mutex::unlock().

◆ set_default_string() [2/2]

void fawkes::SQLiteConfiguration::set_default_string ( const char *  path,
std::string &  s 
)
virtual

Set new default value in configuration of type string

Parameters
pathpath to value
snew string value

Implements fawkes::Configuration.

Definition at line 1765 of file sqlite.cpp.

◆ set_default_uint()

void fawkes::SQLiteConfiguration::set_default_uint ( const char *  path,
unsigned int  uint 
)
virtual

Set new default value in configuration of type unsigned int

Parameters
pathpath to value
uintnew unsigned int value

Implements fawkes::Configuration.

Definition at line 1567 of file sqlite.cpp.

References fawkes::Mutex::lock(), fawkes::Configuration::notify_handlers(), and fawkes::Mutex::unlock().

◆ set_float()

void fawkes::SQLiteConfiguration::set_float ( const char *  path,
float  f 
)
virtual

Set new value in configuration of type float

Parameters
pathpath to value
fnew float value

Implements fawkes::Configuration.

Definition at line 1155 of file sqlite.cpp.

References fawkes::Mutex::lock(), fawkes::Configuration::notify_handlers(), and fawkes::Mutex::unlock().

Referenced by copy().

◆ set_floats()

void fawkes::SQLiteConfiguration::set_floats ( const char *  path,
std::vector< float > &  f 
)
virtual

Set new value in configuration of type float

Parameters
pathpath to value
fnew float values

Implements fawkes::Configuration.

Definition at line 1412 of file sqlite.cpp.

◆ set_int()

void fawkes::SQLiteConfiguration::set_int ( const char *  path,
int  i 
)
virtual

Set new value in configuration of type int

Parameters
pathpath to value
inew int value

Implements fawkes::Configuration.

Definition at line 1254 of file sqlite.cpp.

References fawkes::Mutex::lock(), fawkes::Configuration::notify_handlers(), and fawkes::Mutex::unlock().

Referenced by copy().

◆ set_ints()

void fawkes::SQLiteConfiguration::set_ints ( const char *  path,
std::vector< int > &  i 
)
virtual

Set new value in configuration of type int

Parameters
pathpath to value
inew int values

Implements fawkes::Configuration.

Definition at line 1424 of file sqlite.cpp.

◆ set_string() [1/2]

void fawkes::SQLiteConfiguration::set_string ( const char *  path,
const char *  s 
)
virtual

Set new value in configuration of type string. Works like the aforementioned method. Just takes an good ol' char array instead of a std::string.

Parameters
pathpath to value
snew string value

Implements fawkes::Configuration.

Definition at line 1354 of file sqlite.cpp.

References fawkes::Mutex::lock(), fawkes::Configuration::notify_handlers(), and fawkes::Mutex::unlock().

◆ set_string() [2/2]

void fawkes::SQLiteConfiguration::set_string ( const char *  path,
std::string &  s 
)
virtual

Set new value in configuration of type string

Parameters
pathpath to value
snew string value

Implements fawkes::Configuration.

Definition at line 1406 of file sqlite.cpp.

Referenced by copy().

◆ set_strings() [1/2]

void fawkes::SQLiteConfiguration::set_strings ( const char *  path,
std::vector< const char * > &  s 
)
virtual

Set new value in configuration of type string. Works like the aforementioned method. Just takes an good ol' char array instead of a std::string.

Parameters
pathpath to value
snew string values

Implements fawkes::Configuration.

Definition at line 1442 of file sqlite.cpp.

◆ set_strings() [2/2]

void fawkes::SQLiteConfiguration::set_strings ( const char *  path,
std::vector< std::string > &  s 
)
virtual

Set new value in configuration of type string

Parameters
pathpath to value
snew string values

Implements fawkes::Configuration.

Definition at line 1436 of file sqlite.cpp.

◆ set_uint()

void fawkes::SQLiteConfiguration::set_uint ( const char *  path,
unsigned int  uint 
)
virtual

Set new value in configuration of type unsigned int

Parameters
pathpath to value
uintnew unsigned int value

Implements fawkes::Configuration.

Definition at line 1205 of file sqlite.cpp.

References fawkes::Mutex::lock(), fawkes::Configuration::notify_handlers(), and fawkes::Mutex::unlock().

Referenced by copy().

◆ set_uints()

void fawkes::SQLiteConfiguration::set_uints ( const char *  path,
std::vector< unsigned int > &  uint 
)
virtual

Set new value in configuration of type unsigned int

Parameters
pathpath to value
uintnew unsigned int values

Implements fawkes::Configuration.

Definition at line 1418 of file sqlite.cpp.

◆ transaction_begin()

void fawkes::SQLiteConfiguration::transaction_begin ( transaction_type_t  ttype = TRANSACTION_DEFERRED)

Begin SQL Transaction.

Parameters
ttypetransaction type

Definition at line 506 of file sqlite.cpp.

References TRANSACTION_EXCLUSIVE, and TRANSACTION_IMMEDIATE.

Referenced by copy().

◆ transaction_commit()

void fawkes::SQLiteConfiguration::transaction_commit ( )

Commit SQL Transaction.

Definition at line 523 of file sqlite.cpp.

Referenced by copy().

◆ transaction_rollback()

void fawkes::SQLiteConfiguration::transaction_rollback ( )

Rollback SQL Transaction.

Definition at line 535 of file sqlite.cpp.

◆ try_dump()

void fawkes::SQLiteConfiguration::try_dump ( )
virtual

Try to dump default configuration.

This method will try to open the SQL dump file for writing and dump the current content of the default database into the file.

Exceptions
Exceptionthrown if dumping fails

Implements fawkes::Configuration.

Definition at line 375 of file sqlite.cpp.

◆ try_lock()

bool fawkes::SQLiteConfiguration::try_lock ( )
virtual

Try to lock the config.

See also
Configuration::lock()
Returns
true, if the lock has been aquired, false otherwise

Implements fawkes::Configuration.

Definition at line 1853 of file sqlite.cpp.

References fawkes::Mutex::try_lock().

◆ unlock()

void fawkes::SQLiteConfiguration::unlock ( )
virtual

Unlock the config.

Modifications and queries are possible again.

Implements fawkes::Configuration.

Definition at line 1862 of file sqlite.cpp.

References fawkes::Mutex::unlock().


The documentation for this class was generated from the following files:
fawkes::Configuration::search
virtual ValueIterator * search(const char *path)=0