#UML# Astah+Doxygen 将C++源码映射为类图内成员只支持基本类型不支持自定义类型

根据上篇文章#UML# Astah+Doxygen 将C++源码映射为类图,我们可以很轻松的将源码自动映射成类图,

然而在实际过程中,会发现生成的类图中,成员变量经常会有丢失的现象。

只支持基本类型不支持自定义类型, 如下

private:
	int test_int;
	static int test_static_int;
	const int test_const_int;
	static const int test_static_const_int;
	unsigned int test_unsigned_int;
	bool test_bool;
	short test_short;
	long test_long;
	long long test_longlong;
	float test_float;
	double test_double;
	vector<Mouse> test_vector;
	vector<Mouse1> test_vector_notexit;
	string test_string;
	deque<Mouse> test_deque;
	list<Mouse> test_list;
	forward_list<Mouse> test_forward_list;
	queue<Mouse> test_queue;
	priority_queue<Mouse> test_priority_queue;
	stack<Mouse> test_stack;
	set<Mouse> test_set;
	multiset<Mouse> test_multiset;
	bitset<Mouse> test_bitset;
	hash_set<Mouse> test_hash_set;
	hash_multiset<Mouse> test_hash_multiset;
	map<Mouse> test_map;
	multimap<Mouse> test_multimap;
	hash_map<Mouse> test_hash_map;
	hash_multimap<Mouse> test_hash_multimap;

	//define myself type 
	Mouse test_calss;
	Mouse* test_calsspoint;
	Mouse1 test_calss_notexit;
	Mouse1* test_calsspoint_notexit;
	enum_letter *test_enumletter;
	ENUM_UPPER *test_enumupper;
	enum_letter1 *test_enumletter_notexit;
	ENUM_UPPER1 *test_enumupper_notexit;
	COMPUTER_TYPE m_eComputer;

正常变量可解析的成员变量XML文件数据

<memberdef kind="variable" id="class_abstract_computer_1a80a44ff444a91b7f7a2a71590bdd55c4" prot="private" static="no" mutable="no">
        <type>int</type>
        <definition>int AbstractComputer::test_int</definition>
        <argsstring></argsstring>
        <name>test_int</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/96_project/DesignPattern/Product/groupinc/Computer.h" line="107" column="5" bodyfile="C:/96_project/DesignPattern/Product/groupinc/Computer.h" bodystart="107" bodyend="-1"/>
      </memberdef>


自定义变量非可解析的成员变量XML文件数据

<memberdef kind="variable" id="class_abstract_computer_1a2788034a237fe77be8220a31e4b44dcb" prot="private" static="no" mutable="no">
        <type><ref refid="_computer_8h_1a6ede75de3409e74a7fce9e3c89b5087b" kindref="member">ENUM_UPPER</ref></type>
        <definition>ENUM_UPPER AbstractComputer::test_enumupper</definition>
        <argsstring></argsstring>
        <name>test_enumupper</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/96_project/DesignPattern/Product/groupinc/Computer.h" line="143" column="12" bodyfile="C:/96_project/DesignPattern/Product/groupinc/Computer.h" bodystart="143" bodyend="-1"/>
      </memberdef>

将<type>中的自定义变量类型ENUM_UPPER修改为基本变量类型int

<memberdef kind="variable" id="class_abstract_computer_1a2788034a237fe77be8220a31e4b44dcb" prot="private" static="no" mutable="no">
        <type><ref refid="_computer_8h_1a6ede75de3409e74a7fce9e3c89b5087b" kindref="member">int</ref></type>
        <definition>ENUM_UPPER AbstractComputer::test_enumupper</definition>
        <argsstring></argsstring>
        <name>test_enumupper</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/96_project/DesignPattern/Product/groupinc/Computer.h" line="143" column="12" bodyfile="C:/96_project/DesignPattern/Product/groupinc/Computer.h" bodystart="143" bodyend="-1"/>
      </memberdef>

成功解析出来了,如下图

 

T.B.D.

 

使用graphviz可显示自定义类成员,函数接口不够详细。可参考如下连接。

#doxygen# #graphviz# doxygen+graphviz生成函数调用流程图

如下:

 

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值