mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
p3Config improved coding style
This commit is contained in:
parent
f9b0063704
commit
828792f2b5
@ -144,7 +144,6 @@ void setHash(const RsFileHash& h);
|
|||||||
* Class data is protected by mutex's so that anyone can call these
|
* Class data is protected by mutex's so that anyone can call these
|
||||||
* functions, at any time.
|
* functions, at any time.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class p3ConfigMgr
|
class p3ConfigMgr
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -177,7 +176,7 @@ class p3ConfigMgr
|
|||||||
*/
|
*/
|
||||||
void addConfiguration(std::string file, pqiConfig *conf);
|
void addConfiguration(std::string file, pqiConfig *conf);
|
||||||
|
|
||||||
/* saves config, and disables further saving
|
/** saves config, and disables further saving
|
||||||
* used for exiting the system
|
* used for exiting the system
|
||||||
*/
|
*/
|
||||||
void completeConfiguration();
|
void completeConfiguration();
|
||||||
@ -209,31 +208,29 @@ class p3ConfigMgr
|
|||||||
/***************************************************************************************************/
|
/***************************************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
//! abstract class for configuration saving, aimed at rs services that uses RsItem config data
|
/**
|
||||||
/*!
|
* @brief Abstract class for configuration saving.
|
||||||
* The aim of this class is to provide a way for rs services and object to save particular
|
* Aimed at rs services that uses RsItem config data, provide a way for RS
|
||||||
* configurations an items (and load them up as well).
|
* services to save and load particular configurations as items.
|
||||||
*/
|
*/
|
||||||
class p3Config: public pqiConfig
|
struct p3Config : pqiConfig
|
||||||
{
|
{
|
||||||
public:
|
|
||||||
|
|
||||||
p3Config();
|
p3Config();
|
||||||
|
|
||||||
virtual bool loadConfiguration(RsFileHash &loadHash);
|
virtual bool loadConfiguration(RsFileHash &loadHash);
|
||||||
virtual bool saveConfiguration();
|
virtual bool saveConfiguration();
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
/* Key Functions to be overloaded for Full Configuration */
|
/// Key Functions to be overloaded for Full Configuration
|
||||||
virtual RsSerialiser *setupSerialiser() = 0;
|
virtual RsSerialiser *setupSerialiser() = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* saves list of derived object
|
* saves list of derived object
|
||||||
* @param cleanup this inform you if you need to call saveDone() to unlock/allow
|
* @param cleanup this inform you if you need to call saveDone() to
|
||||||
* access to resources pointed to by handles (list) returned by function: thus false, call saveDone after returned list finished with
|
* unlock/allow access to resources pointed to by handles (list)
|
||||||
* and vice versa
|
* returned by function: thus false, call saveDone after returned list
|
||||||
|
* finished with and vice versa
|
||||||
* @return list of config items derived object wants to saves
|
* @return list of config items derived object wants to saves
|
||||||
*/
|
*/
|
||||||
virtual bool saveList(bool &cleanup, std::list<RsItem *>&) = 0;
|
virtual bool saveList(bool &cleanup, std::list<RsItem *>&) = 0;
|
||||||
@ -248,16 +245,16 @@ virtual bool loadList(std::list<RsItem *>& load) = 0;
|
|||||||
* callback for mutex unlocking
|
* callback for mutex unlocking
|
||||||
* in derived classes (should only be needed if cleanup = false)
|
* in derived classes (should only be needed if cleanup = false)
|
||||||
*/
|
*/
|
||||||
virtual void saveDone() { return; }
|
virtual void saveDone() {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
bool loadConfig();
|
bool loadConfig();
|
||||||
bool saveConfig();
|
bool saveConfig();
|
||||||
|
|
||||||
bool loadAttempt(const std::string&,const std::string&, std::list<RsItem *>& load);
|
bool loadAttempt( const std::string&, const std::string&,
|
||||||
|
std::list<RsItem *>& load );
|
||||||
}; /* end of p3Config */
|
}; // end of p3Config
|
||||||
|
|
||||||
|
|
||||||
class p3GeneralConfig: public p3Config
|
class p3GeneralConfig: public p3Config
|
||||||
|
Loading…
Reference in New Issue
Block a user