技术标签: Yate学习 study_yate
请声明出处:
对象的引用计数的类,基本大部分的类都继承了该类:
/**
* A reference counted object.
* 引用计数的对象
* Whenever using multiple inheritance you should inherit this class virtually.
* 使用多重继承,一般都会继承这个类
*/
class YATE_API RefObject : public GenObject
{
YNOCOPY(RefObject); // no automatic copies please
public:
/**
* The constructor initializes the reference counter to 1!
* 构造函数,初始化引用计数器为1.
* Use deref() to destruct the object when safe
* 使用deref()去销毁这个对象在安全的时候
*/
RefObject();
/**
* Destructor.
*/
virtual ~RefObject();
/**
* 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;
/**
* Check if the object is still referenced and safe to access.
* 检查对象是否依旧被引用并且安全的访问
* Note that you should not trust this result unless the object is locked
* 注意,不能完全相信这个结果,除非对象被其他方法锁定
* by other means.
* @return True if the object is referenced and safe to access
* @返回True,如果对象被引用并且安全的访问
*/
virtual bool alive() const;
/**
* Increments the reference counter if not already zero
* 增加引用计数器,如果不为0
* @return True if the object was successfully referenced and is safe to access
* @返回True,如果对象被引用并且安全的访问
*/
bool ref();
/**
* Decrements the reference counter, destroys the object if it reaches zero
* 减少引用计数器,如果为0则销毁对象
* <pre>
* // Deref this object, return quickly if the object was deleted
* if (deref()) return;
* </pre>
* @return True if the object may have been deleted, false if it still exists and is safe to access
* @返回true,如果对象已经被删除,false,依旧存在并且安全的访问
*/
bool deref();
/**
* Get the current value of the reference counter
* 获取引用计数器当前的值
* @return The value of the reference counter
*/
inline int refcount() const
{ return m_refcount; }
/**
* Refcounted objects should just have the counter decremented.
* 引用计数对象减少计数器
* That will destroy them only when the refcount reaches zero.
* 当引用计数器为0的时候销毁
*/
virtual void destruct();
/**
* Check if reference counter manipulations are efficient on this platform.
* 检查在这个平台上引用计数器对象是否有效
* If platform does not support atomic operations a mutex pool is used.
* 如果该平台不支持原子操作使用互斥对象池
* @return True if refcount uses atomic integer operations
* @返回true,如果对象计数使用原子整数操作
*/
static bool efficientIncDec();
protected:
/**
* This method is called when the reference count reaches zero after
* 当该应用计数为0之后调用这个方法
* unlocking the mutex if the call to zeroRefsTest() returned true.
* 如果调用zeroRefsTest() 返回true,解除这个互斥锁
* The default behaviour is to delete the object.
* 默认删除这个对象
*/
virtual void zeroRefs();
/**
* Bring the object back alive by setting the reference counter to one.
* Note that it works only if the counter was zero previously
* @return True if the object was resurrected - its name may be Lazarus ;-)
*/
bool resurrect();
/**
* Pre-destruction notification, called just before the object is deleted.
* Unlike in the destructor it is safe to call virtual methods here.
* Reimplementing this method allows to perform any object cleanups.
*/
virtual void destroyed();
private:
int m_refcount;
Mutex* m_mutex;
};
工作流项目演练Project 4 from JavaScript Algos and DS Certification. JavaScript Algos和DS认证的Project 4。 We're continuing our journey through the FreeCodeCamp JavaScript Algorithms and Data Structures Certific..._cum工作流
推荐一款反编译文件的工具onekey-decompile-apk_onekey decompile apk
描述:卸载ros相关的东西,从头开始安装发现缺少依赖。sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential_ros-melodic-desktop-full : depends: ros-melodic-desktop but it is not going
挺简单的,就自己做了一个开关,控制是否下拉到最后一页,道理最后一页则关闭开关,第一页的时候打开开关,直接看代码吧data: { pageNo: 1, // 页码的递进数,当前页码 allPage: 1, // 总页数 canPull: true, // 下拉是否触发}getData(pageNo) { http.getRequest('/common/shop/c..._小程序 onreachbottom 做分页 重复内容
新建虚拟环境1、新建一个环境 test1: makevirtualenv djangotest2、安装django:指定django版本使用 pip instal django=1.9.8即可安装,可以使用 pip list来查看,此环境(test1)安装的驱动包等生成Django框架创建项目,django项目创建django-admin startproject djangote..._django管理系统框架搭建问题
描述:在listview的item中还设有button点击事件,在对item设置setOnitemclicklistener点击事件时,item没有响应。原因:listview的item中加入其他的widget后,ListView的itemclick事件将无法触发,被其它widget的click事件屏蔽。解决:在和中添加android:descendantFoc
clientWidthclientHeight这两个属性可以获取元素的可见宽度和高度这些属性都是不带px的,返回的都是数字,可以直接进行计算会获取元素宽度和高度,包括内容区和内边距<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-sc
title: Depth Completion SoTA 总结date: 2019-09-28 21:36:10categories:Depth Completiontags:Depth CompletionResearchReviewDepth Completion SoTA 主流方法总结分两路计算置信度(对sparse_d进行优化、滤波,主要考虑到sparse..._depthcomplete优化方法
Amazon这几年发展真的很快,流量对于一家Amazon店铺来说真的是非常的重要,谁拥有最多的流量,谁自然就会拥有更多的曝光率和点击率,这些会促成更多的销量。在Amazon时间久了,会逐渐觉得Amazon的流量越来越重要,有些商家为了占据首页的广告费,要付出5美元一次的 点击费用,流量之所以这么贵,正是因为大量的卖家数量涌入,如果想要在这一领域长久的生存发展下去,我们既要必须了解Amazon的..._amazon 流量
DNS轮询安装dns服务包修改DNS主配置文件修改DNS区域配置文件修改DNS数据配置文件修改本地dns地址测试DNS正向解析DNS反向解析安装dns服务包yum -y install bind bind-*修改DNS主配置文件vi /etc/named.conf第11行127.0.0.1改成any第17行localhost改成any修改DNS区域配置文件在最下面添加下面内容:#vi /etc/named.rfc1912.zones zone "fangzhang.com" IN {_dns resolv.conf 轮询
题目:题解:题解1:分治法k个链表利用二分为k个独立的子链表,然后两两组合,最后合并成k个排序链表时间复杂度:O(nlogk),n为单个链表的长度,k表示k个链表题解2:优雅的暴力法利用队列queue来实现两两链表的组合,首先将队列前两个链表合并成一个,然后添加到队列的尾部,直到队列中只有一个链表时,表示k个链表已经合成了。合并两个有序链表的代码可以参考:21.合并..._分治法链表排序
一、准备工具:sourcetree二、恢复1、打开命令行模式2、查看提交的所有记录 git log -g3、找到想要恢复的分支(feature_name_20181219)commit值(0323946e152141d21575e591094895a258e6edca)或HEAD的值(HEAD{0})4、执行git branch feature_name_20181215 H...