zoukankan      html  css  js  c++  java
  • TypeId和IidManager关系

    IidInformation结构

    数据类型 名字
    string name
    TypeId::hash_t hash
    uint16_t parent
    string groupName
    size_t size
    bool hasConstructor
    Callback<ObjectBase*> constructor
    bool mustHideFromDocumentation
    vector<TypeId::AttributeInformation> attributes
    vector<TypeId::TraceSourceInformation> traceSources

    IidManager中包含的成员

    vector<struct IidInformation> m_information;
    namemap_t m_namemap;
    hashmap_t m_hashmap;
    

    IidManager中存了三张表;

    • m_information 用于建立tid(uint16_t)和每个 IidInformation的映射关系。Vector中下标为i的 IidInformation对应的tid为i+1;
    • m_namemap
      • map<string, uint16_t>
    • m_hashmap
      • map<TypeId::hash_t,uint16_t>
    • m_information中的映射关系造成的影响:
      • LookupInformation (uint16_t uid)函数返回的是&m_information[uid-1]
      • 创建新的IidInformation(假设为newIn)时,先把newIn加入Vector,在令对应的uid为Vetor.size().然后加入map<name, uid>,map<hash, uid>

    TypeId

    • 类成员:m_tid.
    • 成员函数的实现 通过调用IidManager的同名实现函数(将m_tid作为实参传入)实现。
  • 相关阅读:
    python 文件目录/方法
    python文件
    python模块
    python数据结构
    python函数
    python迭代器和生成器
    python循环语句
    python控制语句 if
    python数字
    个人课程总结
  • 原文地址:https://www.cnblogs.com/rainySue/p/TypeId-heIidManager-guan-xi.html
Copyright © 2011-2022 走看看