#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生成函數調用流程圖

如下:

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章