summaryrefslogtreecommitdiff
path: root/indra/llinventory/llsettingsbase.h
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2018-02-26 09:27:14 -0800
committerRider Linden <rider@lindenlab.com>2018-02-26 09:27:14 -0800
commitb766466b3013e39831bcfcaef5d1089c07202afb (patch)
tree8d60793bc706efe39407cbec0a2c6c16b3bcec51 /indra/llinventory/llsettingsbase.h
parente9edd37cdb39639e1ab24e2e63d4f83432282c88 (diff)
Added settings inventory object with subtype
Diffstat (limited to 'indra/llinventory/llsettingsbase.h')
-rw-r--r--indra/llinventory/llsettingsbase.h29
1 files changed, 19 insertions, 10 deletions
diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h
index 420bcb9943..c7ed9e9e21 100644
--- a/indra/llinventory/llsettingsbase.h
+++ b/indra/llinventory/llsettingsbase.h
@@ -42,6 +42,8 @@
#include "v4color.h"
#include "v3color.h"
+#include "llinventorysettings.h"
+
class LLSettingsBase :
public std::enable_shared_from_this<LLSettingsBase>,
private boost::noncopyable
@@ -49,6 +51,8 @@ class LLSettingsBase :
friend class LLEnvironment;
friend class LLSettingsDay;
+ friend std::ostream &operator <<(std::ostream& os, LLSettingsBase &settings);
+
public:
static const std::string SETTING_ID;
static const std::string SETTING_NAME;
@@ -64,6 +68,8 @@ public:
//---------------------------------------------------------------------
virtual std::string getSettingType() const = 0;
+ virtual LLSettingsType getSettingTypeValue() const = 0;
+
//---------------------------------------------------------------------
// Settings status
inline bool hasSetting(const std::string &param) const { return mSettings.has(param); }
@@ -143,27 +149,28 @@ public:
// Note this method is marked const but may modify the settings object.
// (note the internal const cast). This is so that it may be called without
// special consideration from getters.
- inline void update() const
+ inline void update() const
{
if (!mDirty)
return;
(const_cast<LLSettingsBase *>(this))->updateSettings();
}
- virtual void blend(const ptr_t &end, F64 blendf) = 0;
+ virtual void blend(const ptr_t &end, F64 blendf) = 0;
- virtual bool validate();
+ virtual bool validate();
class Validator
{
public:
typedef boost::function<bool(LLSD &)> verify_pr;
- Validator(std::string name, bool required, LLSD::Type type, verify_pr verify = verify_pr()) :
+ Validator(std::string name, bool required, LLSD::Type type, verify_pr verify = verify_pr(), LLSD defval = LLSD()) :
mName(name),
mRequired(required),
mType(type),
- mVerify(verify)
+ mVerify(verify),
+ mDefault(defval)
{ }
std::string getName() const { return mName; }
@@ -187,6 +194,7 @@ public:
bool mRequired;
LLSD::Type mType;
verify_pr mVerify;
+ LLSD mDefault;
};
typedef std::vector<Validator> validation_list_t;
@@ -223,15 +231,16 @@ protected:
virtual parammapping_t getParameterMap() const { return parammapping_t(); }
- LLSD mSettings;
- bool mIsValid;
+ LLSD mSettings;
+ bool mIsValid;
+ LLAssetID mAssetID;
- LLSD cloneSettings() const;
+ LLSD cloneSettings() const;
private:
- bool mDirty;
+ bool mDirty;
- LLSD combineSDMaps(const LLSD &first, const LLSD &other) const;
+ LLSD combineSDMaps(const LLSD &first, const LLSD &other) const;
};