📄 cclasstype.hh
字号:
#ifndef RFL_CCLASSTYPE_HH#define RFL_CCLASSTYPE_HH/* C++ Reflection & Serice Library * Copyright (C) 2003 Marcus Perlick * mailto: riffraff@users.sf.net * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * This file is part of the "C++ Reflection & Serice Library" */#include <new>#include "align.hh"#include "baseoffset.hh"#include "ClassType.hh"namespace rfl {#define RFL_POD_CCLASS 0,0,0,0,0,0,0 template<typename T> class CClassType : public ClassType { public: CClassType( const char* name, void(*create)(const Type*,void*), void(*cCreate)(const Type*,void*,const void*), void(*destroy)(const Type*,void*), void(*assign)(const Type*,void*,const void*), void*(*newObj)(const Type*), void*(*newCopy)(const Type*,const void*), void(*delObj)(const Type*,void*) ) : ClassType( name, sizeof(T), AlignmentOf<T>::is(), 0, create, cCreate, destroy, assign, newObj, newCopy, delObj ) {} template<typename B> void addBaseClass( const CClassType<B>& baseClass ); template<typename M> void addMember( const char* name, const Type& type, M T::* member ); }; template<typename T> template<typename M> void CClassType<T>::addMember( const char* name, const Type& type, M T::* member ) { Member tmp = { name, &type, (std::size_t)member }; mbrs_.push_back( tmp ); elmNo_ = mbrs_.size(); } template<typename T> template<typename B> void CClassType<T>::addBaseClass( const CClassType<B>& baseClass ) { OffsetOf<B>::template inClass<T>(); BaseClass tmp = { &baseClass, 0 }; bases_.push_back( tmp ); }} // namespace rfl#endif // RFL_CCLASSTYPE_HH
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -