summaryrefslogtreecommitdiff
path: root/indra/llxml/llcontrol.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llxml/llcontrol.h')
-rwxr-xr-xindra/llxml/llcontrol.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/indra/llxml/llcontrol.h b/indra/llxml/llcontrol.h
index f46d21408b..04575d81e0 100755
--- a/indra/llxml/llcontrol.h
+++ b/indra/llxml/llcontrol.h
@@ -29,8 +29,6 @@
#include "llboost.h"
#include "llevent.h"
-#include "llnametable.h"
-#include "llmap.h"
#include "llstring.h"
#include "llrect.h"
#include "llrefcount.h"
@@ -166,7 +164,7 @@ typedef LLPointer<LLControlVariable> LLControlVariablePtr;
template <class T>
eControlType get_control_type()
{
- llwarns << "Usupported control type: " << typeid(T).name() << "." << llendl;
+ LL_WARNS() << "Usupported control type: " << typeid(T).name() << "." << LL_ENDL;
return TYPE_COUNT;
}
@@ -258,7 +256,7 @@ public:
}
else
{
- llwarns << "Control " << name << " not found." << llendl;
+ LL_WARNS() << "Control " << name << " not found." << LL_ENDL;
return T();
}
return convert_from_llsd<T>(value, type, name);
@@ -289,7 +287,7 @@ public:
}
else
{
- llwarns << "Invalid control " << name << llendl;
+ LL_WARNS() << "Invalid control " << name << LL_ENDL;
}
}
@@ -325,7 +323,7 @@ public:
{
if(!declareTypedControl(group, name, default_value, comment))
{
- llerrs << "The control could not be created!!!" << llendl;
+ LL_ERRS() << "The control could not be created!!!" << LL_ENDL;
}
}
@@ -338,7 +336,7 @@ public:
{
if(!group.controlExists(name))
{
- llerrs << "Control named " << name << "not found." << llendl;
+ LL_ERRS() << "Control named " << name << "not found." << LL_ENDL;
}
bindToControl(group, name);
@@ -397,7 +395,6 @@ class LLCachedControl
public:
LLCachedControl(LLControlGroup& group,
const std::string& name,
-
const T& default_value,
const std::string& comment = "Declared In Code")
{
@@ -408,6 +405,16 @@ public:
}
}
+ LLCachedControl(LLControlGroup& group,
+ const std::string& name)
+ {
+ mCachedControlPtr = LLControlCache<T>::getInstance(name);
+ if (mCachedControlPtr.isNull())
+ {
+ mCachedControlPtr = new LLControlCache<T>(group, name);
+ }
+ }
+
operator const T&() const { return mCachedControlPtr->getValue(); }
operator boost::function<const T&()> () const { return boost::function<const T&()>(*this); }
const T& operator()() { return mCachedControlPtr->getValue(); }