100 std::map<CYIString, CYIAny> m_data;
107 template <
typename T>
110 m_data[key] =
CYIAny(value);
114 template <
typename T>
117 std::map<CYIString, CYIAny>::const_iterator element = m_data.find(key);
119 if (element != m_data.end())
121 *pValue = AnyCast<T>(element->second);
128 template <
typename T>
131 std::map<CYIString, CYIAny>::const_iterator element = m_data.find(key);
133 if (element != m_data.end())
135 return AnyCast<T>(element->second);
142 template <
typename T>
145 std::map<CYIString, CYIAny>::const_iterator element = m_data.find(key);
147 if (element != m_data.end())
149 return AnyCast<T>(element->second);
153 YI_LOGI(
"CYIBundle",
"Key '%s' not found in bundle while using direct access. The default constructor of the template type will be used.", key.
GetData());
157 #endif // _YI_BUNDLE_H_
Container class for Unicode strings. Conceptually, a CYIString object is a sequence of Unicode charac...
Definition: YiString.h:35
CYIBundle & operator=(const CYIBundle &bundle)
CYIBundle represents a collection of key-value pairs.
Definition: YiBundle.h:45
A class that holds instances of any type that is copy-constructible.
Definition: YiAny.h:77
The base class for an object accessible from script source code.
Definition: YiScriptableObject.h:28
T GetWithDefault(const CYIString &key, const T &defaultValue) const
Definition: YiBundle.h:129
virtual void OnDataModified(const CYIString &key)
#define YI_LOGI(tag, msg,...)
Definition: YiLoggerHelper.h:76
bool IsKeyPresent(const CYIString &key) const
void Put(const CYIString &key, T value)
Definition: YiBundle.h:108
bool Get(const CYIString &key, T *pValue) const
Definition: YiBundle.h:115
const char * GetData() const