📄 dynclass.cpp
字号:
#include "dynclass.h"extern "C"{ void * createByClassName(const char * strClassName) { return DYN_CREATE(strClassName); }}namespace DYN_CLASS{ CFactoryList * CFactoryList::_head = 0; void *Create( const char * class_name ) { void * new_object = 0; const CFactoryList * cur = CFactoryList::_head; for( ; cur ; cur = cur->m_next ) { /* if class_name matched, object will then be created and returned */ if( new_object = cur->m_item->Create(class_name) ) { break; } } return new_object; } /* delete linkage from CFactoryList when some class factory destroyed */ CFactoryList::~CFactoryList( void ) { CFactoryList ** m_nextp = &CFactoryList::_head; for( ; *m_nextp ; m_nextp = &(*m_nextp)->m_next ) if( *m_nextp == this ) { *m_nextp = (*m_nextp)->m_next; break; } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -