/**
* A string class with a hashed string name
* 被哈希的字符串的名的字符串的类
* @short A named string class.
* @小的字符串类的名字
*/
class YATE_API NamedString : public String
{
YNOCOPY(NamedString); // no automatic copies please
public:
/**
* Creates a new named string.
* 构造函数,创建一个新的命名字符串
* @param name Name of this string
* @参数name,这个字符串的名字
* @param value Initial value of the string
* @参数value,这个字符串的初始化的值
*/
explicit NamedString(const char* name, const char* value = 0);
/**
* Retrieve the name of this string.
* 检索字符串的名字
* @return A hashed string with the name of the string
* @返回被哈希的字符创名字的字符串
*/
inline const String& name() const
{ return m_name; }
/**
* Get a string representation of this object
* 获得该对象的字符串表示
* @return A reference to the name of this object
* @返回一个引用该对象的名称
*/
virtual const String& toString() const;
/**
* Get a pointer to a derived class given that class name
* 获得指向基于类名的派生类的指针
* @param name Name of the class we are asking for
* @参数name,我们要求的类名
* @return Pointer to the requested class or NULL if this object doesn't implement it
* @返回指向被请求类的指针,或者为NULL,如果这个对象没有实例化
*/
virtual void* getObject(const String& name) const;
/**
* Value assignment operator
* 赋值运算符重载
*/
inline NamedString& operator=(const char* value)
{ String::operator=(value); return *this; }
private:
NamedString(); // no default constructor please
String m_name;
};
yate学习--yateclass.h--class YATE_API NamedString : public String
最新推荐文章于 2015-05-22 15:29:52 发布