Logo Search packages:      
Sourcecode: fbpager version File versions  Download package

FbTk::Resource< T > Class Template Reference

#include <Resource.hh>

Inheritance diagram for FbTk::Resource< T >:

FbTk::Resource_base FbTk::NotCopyable

List of all members.


Detailed Description

template<typename T>
class FbTk::Resource< T >

Real resource class.

usage: Resource<int> someresource(resourcemanager, 10, "someresourcename", "somealternativename");
and then implement setFromString and getString
example:
template <>
void Resource<int>::setFromString(const char *str) {
*(*this) = atoi(str);
}

Definition at line 148 of file Resource.hh.


Public Member Functions

const std::string & altName () const
 get alternative name of this resource
template<>
std::string getString ()
 get string value
template<>
std::string getString ()
 get string value
template<>
std::string getString ()
 get string value
template<>
std::string getString ()
 get string value
std::string getString ()
const std::string & name () const
 get name of this resource
const T & operator* () const
T & operator* ()
const T * operator-> () const
T * operator-> ()
Resource< T > & operator= (const T &newvalue)
 Resource (ResourceManager &rm, T val, const std::string &name, const std::string &altname)
void setDefaultValue ()
 set default value
template<>
void setFromString (const char *str)
 set from string value
template<>
void setFromString (const char *str)
 set from string value
template<>
void setFromString (const char *str)
 set from string value
template<>
void setFromString (char const *strval)
 set from string value
void setFromString (const char *strval)
 sets resource from string, specialized, must be implemented

Private Attributes

m_defaultval
ResourceManager & m_rm
m_value

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index