00001 /*======================================================================= 00002 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), *** 00003 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. *** 00004 *** *** 00005 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS *** 00006 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR *** 00007 *** WRITTEN AUTHORIZATION OF FEI S.A.S. *** 00008 *** *** 00009 *** RESTRICTED RIGHTS LEGEND *** 00010 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS *** 00011 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN *** 00012 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT *** 00013 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN *** 00014 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. *** 00015 *** *** 00016 *** COPYRIGHT (C) 1996-2014 BY FEI S.A.S, *** 00017 *** BORDEAUX, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 /*======================================================================= 00021 ** Author : Nicolas DAGUISE (Oct 2005) 00022 **=======================================================================*/ 00023 00024 00025 #include <Inventor/SoType.h> 00026 00027 /*************************************************************************/ 00028 // SO_PERF_COUNTER_HEADER macro. 00029 // Description : 00030 // Defines common methods and definition for all stats commands. 00031 // The macro takes one parameter: the class. 00032 //------------------------------------------------------------------------- 00033 #define SO_PERF_COUNTER_HEADER(className) \ 00034 public: \ 00035 static void initClass(); \ 00036 static void exitClass(); \ 00037 static SoType getClassTypeId(); \ 00038 virtual SoType getTypeId() const; \ 00039 private: \ 00040 static SoType m_classTypeId; 00041 00042 /*************************************************************************/ 00043 // SO_PERF_COUNTER_SOURCE macro. 00044 // Description : 00045 // Defines common methods and definition for all stats commands. 00046 // The macro takes two parameters: 00047 // - the class 00048 // - the inherited class 00049 //------------------------------------------------------------------------- 00050 #define SO_PERF_COUNTER_SOURCE(className, inheritClass) \ 00051 SoType className::m_classTypeId; \ 00052 void className::initClass() { \ 00053 if (m_classTypeId.isBad()) { \ 00054 if (inheritClass::getClassTypeId().isBad() ) \ 00055 inheritClass::initClass(); \ 00056 m_classTypeId = SoType::createType(inheritClass::getClassTypeId(), #className); \ 00057 m_classTypeId.makeInternal(); \ 00058 } \ 00059 } \ 00060 void className::exitClass() { \ 00061 if (m_classTypeId != SoType::badType()) { \ 00062 SoType::removeType(m_classTypeId.getName()); \ 00063 m_classTypeId = SoType::badType(); \ 00064 } \ 00065 } \ 00066 SoType className::getClassTypeId() { return className::m_classTypeId; } \ 00067 SoType className::getTypeId() const { return className::m_classTypeId; } 00068 00069 00070 00071