yate学习--yateclass.h--class YATE_API RefObject : public GenObject_class test1_api umyobject : public uobject报错-程序员宅基地

技术标签: 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;
};


版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/u012377333/article/details/45917765

智能推荐

计算机毕业设计吊打导师Hadoop+Hive+PySpark旅游景点推荐 旅游推荐系统 景区游客满意度预测与优化 Apriori算法 景区客流量预测 旅游大数据 景点规划 知识图谱 机器学习 深度学习-程序员宅基地

文章浏览阅读1.2k次,点赞41次,收藏16次。计算机毕业设计吊打导师Hadoop+Hive+PySpark旅游景点推荐 旅游推荐系统 景区游客满意度预测与优化 Apriori算法 景区客流量预测 旅游大数据 景点规划 知识图谱 机器学习 深度学习 人工智能

Google APK Crash 解决方案-程序员宅基地

文章浏览阅读1.2k次。阅读五分钟,每日十点,和您一起终身学习,这里是程序员Android本篇文章主要介绍开发中我们没有源码的GMS Crash崩溃后的解决方案,通过阅读本篇文章,您将收获以下内容:一、gms.ui Service not registered CrashGMS(GoogleMobile Service)包是出口国外手机中Google限制必须要预制的,如果不预置无法过Google CTS认证,会导致手...

Java多线程(超详细!)-程序员宅基地

文章浏览阅读10w+次,点赞880次,收藏3.9k次。1、什么是进程?什么是线程?进程是:一个应用程序(1个进程是一个软件)。线程是:一个进程中的执行场景/执行单元。注意:一个进程可以启动多个线程。eg.对于java程序来说,当在DOS命令窗口中输入:java HelloWorld 回车之后。会先启动JVM,而JVM就是一个进程。JVM再启动一个主线程调用main方法。同时再启动一个垃圾回收线程负责看护,回收垃圾。最起码,现在的java程序中至少有两个线程并发,一个是垃圾回收线程,一个是执行main方法的主线程。3、进程和线程是什么关系?_java多线程

vue中使用webVideoCtrl播放海康插件_海康威视divplugin 浮层问题-程序员宅基地

文章浏览阅读2.2k次。<template> <div class="video-player"> <div id="divPlugin" class="divPlugin" ref="divPlugin" v-if="plugin"> </div> <!-- <div class="down" v-else> <a href="http://jbfsys.oss-cn-bei.._海康威视divplugin 浮层问题

Android 9 (P)之init进程启动源码分析指南之三_exec_start update_verifier_nonencrypted-程序员宅基地

文章浏览阅读3.6k次,点赞7次,收藏10次。      Android P之init进程启动源码分析指南之三前言  在前面的篇章Android P之init进程启动源码分析指南之一和Android P之init进程启动源码分析指南之二讲解了init进程经过前面两个阶段以后,已经建立了相关的文件系统,属性系统,SELinux安全策略系统。但是我们知道init进程做的远远不止这些,还要启动一些Android的native service系统服务及其其他相关的操作,但是如果都是像属性系统和SELinux系统那样一行行代码去做,显得有点杂乱繁琐,而且_exec_start update_verifier_nonencrypted

关联规则--Apriori算法_apriori关联规则算法-程序员宅基地

文章浏览阅读2w次,点赞17次,收藏199次。啤酒与尿布的故事:在美国,一些年轻的父亲下班后经常要到超市去买婴儿尿布,超市也因此发现了一个规律,在购买婴儿尿布的年轻的父亲们中,有30%~40%的人同时要买一些啤酒。超市随后调整了货架的摆放,将尿布和啤酒放在一起,因此,明显增加了销售额。_apriori关联规则算法

随便推点

【华为机试真题 Python实现】华为机试题整理(已更新211篇)_华为机试垂直矩阵-程序员宅基地

文章浏览阅读2.6w次,点赞26次,收藏269次。拆分输出字符串求n阶方阵里所有数的和合法的三角形个数整型数组求整数对最小和机器人走迷宫【2022 Q1 Q2 |200分】数格子两个超大整型数相加字符串格式化输出【2022 Q1 Q2 |100分】树形目录操作【2022 Q1 Q2 |200分】整型数组按个位值排序奥运会奖牌榜的排名【2022 Q1 | 100分】无重复字符的最长子串最长回文子串两个字符串的最长公共子串括号生成字符串处理一个正整数到 Excel 编号之间的转换字符串压缩搜索矩阵免单统计数组的转换藏宝_华为机试垂直矩阵

HZNUOJ1527_输入两个正整数x,y(其中x<y) 求x到y之间能被3整除的个数。 输入 输入两行,即x和y-程序员宅基地

文章浏览阅读853次。HZNUOJ1527(巨水题题解)Description输入两个正整数X,Y,求出[X,Y]内被除3余1并且被除5余3的整数的和Input输入两个正整数X,YOutput求所有满足条件的数的和对 x到 y进行遍历 并判断同时累计符合要求的个数。#include<stdio.h>int main(){ int x, y,sum=0; scanf("%d %d", &x, &y); for (int i = x; i <= y; i++) { i_输入两个正整数x,y(其中x

前后端分离架构:Web实现前后端分离,前后端解耦-程序员宅基地

文章浏览阅读1.8k次。分享一篇讲得特别详细的blog前后端分离架构:Web实现前后端分离,前后端解耦

工作流Activiti的学习总结(一)安装条件以及各步骤的作用以及不同环境需要lib包_part 1: configure activiti here is an example of c-程序员宅基地

文章浏览阅读770次。工作流activiti的下载地址: http://activiti.org/download.html工作流activiti的必须的软件JDK5+,Ant1.81+,Eclipse3.6.2JDK:查看版本 java –versionANT:查看版本 ant –version运行默认的Demo安装: 1.需要配置JAVA_HOME,ANT_HOME环境变量。_part 1: configure activiti here is an example of configuring activiti with s

华为海思2024春招数字芯片岗机试题(共9套)_华为海思机考题库-程序员宅基地

文章浏览阅读1.1k次,点赞13次,收藏3次。华为海思2024春招数字芯片岗机试题(共9套)_华为海思机考题库

C#调用SAP接口保存数据到SAP_irfctable not support linq-程序员宅基地

文章浏览阅读505次。DataTable dt ; RfcDestination dest = SapManager.getRfcDestination(); RfcRepository rfcrep = dest.Repository; IRfcFunction myfun = null; myfun = rfcrep.CreateFunction("HJJDB_T..._irfctable not support linq