diff options
Diffstat (limited to 'src/FbTk')
-rw-r--r-- | src/FbTk/Resource.hh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/FbTk/Resource.hh b/src/FbTk/Resource.hh index 00f8769..518d0aa 100644 --- a/src/FbTk/Resource.hh +++ b/src/FbTk/Resource.hh | |||
@@ -190,10 +190,18 @@ template <typename T, typename Traits> | |||
190 | class Resource:public Resource_base, public Accessor<T> { | 190 | class Resource:public Resource_base, public Accessor<T> { |
191 | public: | 191 | public: |
192 | typedef T Type; | 192 | typedef T Type; |
193 | |||
193 | Resource(ResourceManager_base &rm, T val, const std::string &name, const std::string &altname): | 194 | Resource(ResourceManager_base &rm, T val, const std::string &name, const std::string &altname): |
194 | Resource_base(name, altname), m_value(val), m_defaultval(val), m_rm(rm) { | 195 | Resource_base(name, altname), m_value(val), m_defaultval(val), m_rm(rm) { |
195 | m_rm.addResource(*this); // add this to resource handler | 196 | m_rm.addResource(*this); // add this to resource handler |
196 | } | 197 | } |
198 | |||
199 | // LResourceManager does not use altname, so we provide a constructor which initializes | ||
200 | // altname to name | ||
201 | Resource(ResourceManager_base &rm, T val, const std::string &name): | ||
202 | Resource_base(name, name), m_value(val), m_defaultval(val), m_rm(rm) { | ||
203 | m_rm.addResource(*this); // add this to resource handler | ||
204 | } | ||
197 | virtual ~Resource() { | 205 | virtual ~Resource() { |
198 | m_rm.removeResource(*this); // remove this from resource handler | 206 | m_rm.removeResource(*this); // remove this from resource handler |
199 | } | 207 | } |