yate学习--yateclass.h--class YATE_API NamedCounter : public String
2015-05-05 10:04
323 查看
请声明出处:
NamedCounter,对象命名的计数器:
NamedCounter,对象命名的计数器:
/** * An atomic counter with an associated name * 关联名的原子计数器 * @short Atomic counter with name * @short 名字的原子计数器 */ class YATE_API NamedCounter : public String { YNOCOPY(NamedCounter); // no automatic copies please public: /** * Constructor * 构造函数 * @param name Name of the counter * @参数name,计数器的名字 */ explicit NamedCounter(const String& name); /** * Check if the counter is enabled * 检查计数器是否是启用的 * @return True if the counter is enabled * @返回true,如果计数器是启动的 */ inline bool enabled() const { return m_enabled; } /** * Enable or disable the counter * 启用或者禁用这个计数器 * @param val True to enable counter, false to disable * @参数val,true , 启用,false, 禁止 */ inline void enable(bool val) { m_enabled = val; } /** * Increment the counter * 增加计数 * @return Post-increment value of the counter * @返回计数器增加之后的值 */ int inc(); /** * Decrement the counter * 减少计数 * @return Post-decrement value of the counter * @返回计数器减少之后的值 */ int dec(); /** * Get the current value of the counter * 获得当前计数器的值 * @return Value of the counter * @返回计数器的值 */ inline int count() const { return m_count; } private: int m_count; bool m_enabled; Mutex* m_mutex; };
相关文章推荐
- yate学习--yateclass.h--class YATE_API NamedString : public String
- yate学习--yateclass.h--class YATE_API NamedList : public String
- yate学习--yateclass.h--class YATE_API ObjList : public GenObject
- yate学习--yateclass.h--class YATE_API GenObject
- yate学习--yateclass.h--class YATE_API SocketAddr : public GenObject
- yate学习--yateclass.h--class YATE_API Runnable
- yate学习--yatengine.h--class YATE_API MessageReceiver : public GenObject
- yate学习--yateclass.h--class YATE_API Thread : public Runnable
- yate学习--yateclass.h--class YATE_API Socket : public Stream
- yate学习--yateclass.h--class YATE_API RefObject : public GenObject
- API之Class学习
- 【NDN安全】Interest Flooding Attack and Countermeasures in Named Data Networking 学习笔记
- IOS学习——Could not instantiate class named NSLayoutConstraint
- yate学习--yatesip.h--class YSIP_API SIPParty : public RefObjec
- jqueryAPI学习之add(),addBack(),addClass(),after()学习
- 【NDN实验】Consumer-Producer API for Named Data Networking 学习笔记
- gradle学习二 利用javassist api修改class字节码
- yate学习--yatengine.h--class YATE_API Configuration : public String
- yate学习--yatesip.h--class YSIP_API SIPMessage : public RefObject
- yate学习--yateclass.h--class YATE_API Stream