File: vtkAutoInit.h

package info (click to toggle)
paraview 5.11.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 497,236 kB
  • sloc: cpp: 3,171,290; ansic: 1,315,072; python: 134,290; xml: 103,324; sql: 65,887; sh: 5,286; javascript: 4,901; yacc: 4,383; java: 3,977; perl: 2,363; lex: 1,909; f90: 1,255; objc: 143; makefile: 119; tcl: 59; pascal: 50; fortran: 29
file content (101 lines) | stat: -rw-r--r-- 6,448 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/*=========================================================================

  Program:   Visualization Toolkit
  Module:    vtkAutoInit.h

  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
#ifndef vtkAutoInit_h
#define vtkAutoInit_h

#include "vtkABINamespace.h"
#include "vtkDebugLeaksManager.h" // DebugLeaks exists longer.
#include "vtkTimeStamp.h"         // Here so that TimeStamp Schwarz initializer works

#define VTK_MODULE_AUTOINIT VTK_AUTOINIT

#define VTK_AUTOINIT(M) VTK_AUTOINIT0(M, M##_AUTOINIT)
#define VTK_AUTOINIT0(M, T) VTK_AUTOINIT1(M, T)
#define VTK_AUTOINIT1(M, T)                                                                        \
  /* Declare every <mod>_AutoInit_Construct function.  */                                          \
  VTK_AUTOINIT_DECLARE_##T namespace                                                               \
  {                                                                                                \
    static struct M##_AutoInit                                                                     \
    {                                                                                              \
      /* Call every <mod>_AutoInit_Construct during initialization.  */                            \
      M##_AutoInit() { VTK_AUTOINIT_CONSTRUCT_##T }                                                \
    } M##_AutoInit_Instance;                                                                       \
  }

#define VTK_AUTOINIT_DECLARE_0()
#define VTK_AUTOINIT_DECLARE_1(t1) VTK_AUTOINIT_DECLARE_0() VTK_AUTOINIT_DECLARE(t1)
#define VTK_AUTOINIT_DECLARE_2(t1, t2) VTK_AUTOINIT_DECLARE_1(t1) VTK_AUTOINIT_DECLARE(t2)
#define VTK_AUTOINIT_DECLARE_3(t1, t2, t3) VTK_AUTOINIT_DECLARE_2(t1, t2) VTK_AUTOINIT_DECLARE(t3)
#define VTK_AUTOINIT_DECLARE_4(t1, t2, t3, t4)                                                     \
  VTK_AUTOINIT_DECLARE_3(t1, t2, t3) VTK_AUTOINIT_DECLARE(t4)
#define VTK_AUTOINIT_DECLARE_5(t1, t2, t3, t4, t5)                                                 \
  VTK_AUTOINIT_DECLARE_4(t1, t2, t3, t4) VTK_AUTOINIT_DECLARE(t5)
#define VTK_AUTOINIT_DECLARE_6(t1, t2, t3, t4, t5, t6)                                             \
  VTK_AUTOINIT_DECLARE_5(t1, t2, t3, t4, t5) VTK_AUTOINIT_DECLARE(t6)
#define VTK_AUTOINIT_DECLARE_7(t1, t2, t3, t4, t5, t6, t7)                                         \
  VTK_AUTOINIT_DECLARE_6(t1, t2, t3, t4, t5, t6) VTK_AUTOINIT_DECLARE(t7)
#define VTK_AUTOINIT_DECLARE_8(t1, t2, t3, t4, t5, t6, t7, t8)                                     \
  VTK_AUTOINIT_DECLARE_7(t1, t2, t3, t4, t5, t6, t7) VTK_AUTOINIT_DECLARE(t8)
#define VTK_AUTOINIT_DECLARE_9(t1, t2, t3, t4, t5, t6, t7, t8, t9)                                 \
  VTK_AUTOINIT_DECLARE_8(t1, t2, t3, t4, t5, t6, t7, t8) VTK_AUTOINIT_DECLARE(t9)
#define VTK_AUTOINIT_DECLARE(M)                                                                    \
  VTK_ABI_NAMESPACE_BEGIN void M##_AutoInit_Construct();                                           \
  VTK_ABI_NAMESPACE_END

#define VTK_AUTOINIT_CONSTRUCT_0()
#define VTK_AUTOINIT_CONSTRUCT_1(t1) VTK_AUTOINIT_CONSTRUCT_0() VTK_AUTOINIT_CONSTRUCT(t1)
#define VTK_AUTOINIT_CONSTRUCT_2(t1, t2) VTK_AUTOINIT_CONSTRUCT_1(t1) VTK_AUTOINIT_CONSTRUCT(t2)
#define VTK_AUTOINIT_CONSTRUCT_3(t1, t2, t3)                                                       \
  VTK_AUTOINIT_CONSTRUCT_2(t1, t2) VTK_AUTOINIT_CONSTRUCT(t3)
#define VTK_AUTOINIT_CONSTRUCT_4(t1, t2, t3, t4)                                                   \
  VTK_AUTOINIT_CONSTRUCT_3(t1, t2, t3) VTK_AUTOINIT_CONSTRUCT(t4)
#define VTK_AUTOINIT_CONSTRUCT_5(t1, t2, t3, t4, t5)                                               \
  VTK_AUTOINIT_CONSTRUCT_4(t1, t2, t3, t4) VTK_AUTOINIT_CONSTRUCT(t5)
#define VTK_AUTOINIT_CONSTRUCT_6(t1, t2, t3, t4, t5, t6)                                           \
  VTK_AUTOINIT_CONSTRUCT_5(t1, t2, t3, t4, t5) VTK_AUTOINIT_CONSTRUCT(t6)
#define VTK_AUTOINIT_CONSTRUCT_7(t1, t2, t3, t4, t5, t6, t7)                                       \
  VTK_AUTOINIT_CONSTRUCT_6(t1, t2, t3, t4, t5, t6) VTK_AUTOINIT_CONSTRUCT(t7)
#define VTK_AUTOINIT_CONSTRUCT_8(t1, t2, t3, t4, t5, t6, t7, t8)                                   \
  VTK_AUTOINIT_CONSTRUCT_7(t1, t2, t3, t4, t5, t6, t7) VTK_AUTOINIT_CONSTRUCT(t8)
#define VTK_AUTOINIT_CONSTRUCT_9(t1, t2, t3, t4, t5, t6, t7, t8, t9)                               \
  VTK_AUTOINIT_CONSTRUCT_8(t1, t2, t3, t4, t5, t6, t7, t8) VTK_AUTOINIT_CONSTRUCT(t9)
#define VTK_AUTOINIT_CONSTRUCT(M) M##_AutoInit_Construct();

// Description:
// Initialize the named module, ensuring its object factory is correctly
// registered. This call must be made in global scope in the
// translation unit of your executable (which can include a shared library, but
// will not work as expected in a static library).
//
// @code{.cpp}
// #include "vtkAutoInit.h"
// VTK_MODULE_INIT(vtkRenderingOpenGL2);
// @endcode
//
// The above snippet if included in the global scope will ensure the object
// factories for vtkRenderingOpenGL2 are correctly registered and unregistered.
#define VTK_MODULE_INIT(M)                                                                         \
  VTK_AUTOINIT_DECLARE(M)                                                                          \
  namespace                                                                                        \
  {                                                                                                \
  static struct M##_ModuleInit                                                                     \
  {                                                                                                \
    /* Call <mod>_AutoInit_Construct during initialization.  */                                    \
    M##_ModuleInit() { VTK_AUTOINIT_CONSTRUCT(M) }                                                 \
  } M##_ModuleInit_Instance;                                                                       \
  }

#endif
// VTK-HeaderTest-Exclude: vtkAutoInit.h