Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoSubPerfCounter.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2014 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : Nicolas DAGUISE (Oct 2005)
22**=======================================================================*/
23
24
25#include <Inventor/SoType.h>
26
27/*************************************************************************/
28// SO_PERF_COUNTER_HEADER macro.
29// Description :
30// Defines common methods and definition for all stats commands.
31// The macro takes one parameter: the class.
32//-------------------------------------------------------------------------
33#define SO_PERF_COUNTER_HEADER(className) \
34public: \
35 static void initClass(); \
36 static void exitClass(); \
37 static SoType getClassTypeId(); \
38 virtual SoType getTypeId() const; \
39private: \
40 static SoType m_classTypeId;
41
42/*************************************************************************/
43// SO_PERF_COUNTER_SOURCE macro.
44// Description :
45// Defines common methods and definition for all stats commands.
46// The macro takes two parameters:
47// - the class
48// - the inherited class
49//-------------------------------------------------------------------------
50#define SO_PERF_COUNTER_SOURCE(className, inheritClass) \
51SoType className::m_classTypeId; \
52void className::initClass() { \
53 if (m_classTypeId.isBad()) { \
54 if (inheritClass::getClassTypeId().isBad() ) \
55 inheritClass::initClass(); \
56 m_classTypeId = SoType::createType(inheritClass::getClassTypeId(), #className); \
57 m_classTypeId.makeInternal(); \
58 } \
59} \
60void className::exitClass() { \
61 if (m_classTypeId != SoType::badType()) { \
62 SoType::removeType(m_classTypeId.getName()); \
63 m_classTypeId = SoType::badType(); \
64 } \
65} \
66SoType className::getClassTypeId() { return className::m_classTypeId; } \
67SoType className::getTypeId() const { return className::m_classTypeId; }
68
69
70