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

#UML# Astah+Doxygen 将C++源码映射为类图内成员只支持基本类型不支持自定义类型「建议收藏」根据上篇文章#UML#Astah+Doxygen将C++源码映射为类图,我们可以很轻松的将源码自动映射成类图,然而在实际过程中,会发现生成的类图中,成员变量经常会有丢失的现象。只支持基本类型不支持自定义类型,如下private: inttest_int; staticinttest_static_int; constinttest_const_int; sta…

大家好,欢迎来到IT知识分享网。

根据上篇文章#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;

IT知识分享网

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

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

IT知识分享网<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

IT知识分享网<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>

成功解析出来了,如下图

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

 

T.B.D.

 

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

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

如下:

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

 

 

免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://yundeesoft.com/10913.html

(0)

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

关注微信