yate学习--yateclass.h--class YATE_API NamedString : public String

    
/**
 * 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;
};

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值