Open Inventor Reference
SoProfiling.h
Go to the documentation of this file.
1/*
2 *
3 * Copyright (C) 2013 MeVis Medical Solutions AG, All Rights Reserved.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * Further, this software is distributed without any warranty that it is
16 * free of the rightful claim of any third person regarding infringement
17 * or the like. Any license provided herein, whether implied or
18 * otherwise, applies only to this software file. Patent licenses, if
19 * any, provided herein do not apply to combinations of this program with
20 * other software, or any other product whatsoever.
21 *
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with this library; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
26 * Contact information: MeVis Medical Solutions AG
27 * Universitätsallee 29, D-28359 Bremen, GERMANY, or:
28 *
29 * http://www.mevis.de
30 *
31 */
32
33/*
34 * Copyright (C) 2013 MeVis Medical Solutions AG
35 *
36 * \file SoProfiling.h
37 * \author Florian Link
38 * \date 02/2013
39 */
40
41#ifndef _SO_PROFILING_
42#define _SO_PROFILING_
43
45#include <Inventor/SbBasic.h>
46
47#define OIV_HAS_PROFILING
48
49class SoAction;
50class SoField;
52
56{
57
59
60 typedef void EnterScopeApplyActionCB(SoAction* action);
61 typedef void EnterScopeFieldNotifyCB(SoField* action);
62 typedef void EnterScopeFieldContainerNotifyCB(SoFieldContainer* action);
63 typedef void EnterScopeProcessDelayQueueCB();
64 typedef void EnterScopeProcessTimerQueueCB();
65
69 typedef void LeaveScopeCB();
71
72public:
74 static bool isEnabled() { return _enabled; }
76 static void setEnabled(bool flag) { _enabled = flag; }
77
78
80
81 static void setEnterScopeApplyActionCB(EnterScopeApplyActionCB* cb) { _enterScopeApplyActionCB = cb; }
82 static void setEnterScopeFieldNotifyCB(EnterScopeFieldNotifyCB* cb) { _enterScopeFieldNotifyCB = cb; }
83 static void setEnterScopeFieldContainerNotifyCB(EnterScopeFieldContainerNotifyCB* cb) { _enterScopeFieldContainerNotifyCB = cb; }
84 static void setEnterScopeProcessDelayQueueCB(EnterScopeProcessDelayQueueCB* cb) { _enterScopeProcessDelayQueueCB = cb; }
85 static void setEnterScopeProcessTimerQueueCB(EnterScopeProcessTimerQueueCB* cb) { _enterScopeProcessTimerQueueCB = cb; }
86 static void setLeaveScopeCB(LeaveScopeCB* cb) { _leaveScopeCB = cb; }
88
90
91 static EnterScopeApplyActionCB* getEnterScopeApplyActionCB() { return _enterScopeApplyActionCB; }
92 static EnterScopeFieldNotifyCB* getEnterScopeFieldNotifyCB() { return _enterScopeFieldNotifyCB; }
93 static EnterScopeFieldContainerNotifyCB* getEnterScopeFieldContainerNotifyCB() { return _enterScopeFieldContainerNotifyCB; }
94 static EnterScopeProcessDelayQueueCB* getEnterScopeProcessDelayQueueCB() { return _enterScopeProcessDelayQueueCB; }
95 static EnterScopeProcessTimerQueueCB* getEnterScopeProcessTimerQueueCB() { return _enterScopeProcessTimerQueueCB; }
96 static LeaveScopeCB* getLeaveScopeCB() { return _leaveScopeCB; }
98
99private:
100
101 static bool _enabled;
102
103 static EnterScopeApplyActionCB* _enterScopeApplyActionCB;
104 static EnterScopeFieldNotifyCB* _enterScopeFieldNotifyCB;
105 static EnterScopeFieldContainerNotifyCB* _enterScopeFieldContainerNotifyCB;
106 static EnterScopeProcessDelayQueueCB* _enterScopeProcessDelayQueueCB;
107 static EnterScopeProcessTimerQueueCB* _enterScopeProcessTimerQueueCB;
108 static LeaveScopeCB* _leaveScopeCB;
109
110};
111
112#endif
#define INVENTOR_API
Disable some annoying warnings on MSVC 6.
Definition SbSystem.h:77
Abstract base class for all actions.
Definition SoAction.h:179
Abstract base class for objects that contain fields.
Base class for all fields.
Definition SoField.h:185
Static class that offers profiling callbacks for a number of selected Open Inventor features,...
Definition SoProfiling.h:56
static EnterScopeApplyActionCB * getEnterScopeApplyActionCB()
Definition SoProfiling.h:91
static void setEnterScopeApplyActionCB(EnterScopeApplyActionCB *cb)
Definition SoProfiling.h:81
static void setEnterScopeProcessTimerQueueCB(EnterScopeProcessTimerQueueCB *cb)
Definition SoProfiling.h:85
static void setEnterScopeProcessDelayQueueCB(EnterScopeProcessDelayQueueCB *cb)
Definition SoProfiling.h:84
static LeaveScopeCB * getLeaveScopeCB()
Definition SoProfiling.h:96
static bool isEnabled()
returns if profiling is enabled (callbacks are only called if profiling is enabled)
Definition SoProfiling.h:74
static void setEnterScopeFieldNotifyCB(EnterScopeFieldNotifyCB *cb)
Definition SoProfiling.h:82
static EnterScopeFieldNotifyCB * getEnterScopeFieldNotifyCB()
Definition SoProfiling.h:92
static void setEnabled(bool flag)
enables/disabled the profiling (default is false)
Definition SoProfiling.h:76
static void setLeaveScopeCB(LeaveScopeCB *cb)
Definition SoProfiling.h:86
static EnterScopeProcessTimerQueueCB * getEnterScopeProcessTimerQueueCB()
Definition SoProfiling.h:95
static EnterScopeFieldContainerNotifyCB * getEnterScopeFieldContainerNotifyCB()
Definition SoProfiling.h:93
static void setEnterScopeFieldContainerNotifyCB(EnterScopeFieldContainerNotifyCB *cb)
Definition SoProfiling.h:83
static EnterScopeProcessDelayQueueCB * getEnterScopeProcessDelayQueueCB()
Definition SoProfiling.h:94