forked from Kitware/VTK
/
vtkParseMerge.h
82 lines (67 loc) · 2.76 KB
/
vtkParseMerge.h
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
/*=========================================================================
Program: Visualization Toolkit
Module: vtkParseMerge.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.
=========================================================================*/
/*-------------------------------------------------------------------------
Copyright (c) 2010,2015 David Gobbi
Contributed to the VisualizationToolkit by the author in March 2015
under the terms of the Visualization Toolkit 2015 copyright.
-------------------------------------------------------------------------*/
/**
This file contains utility functions for merging together the
methods for a class with those inherited from all superclasses.
*/
#ifndef vtkParseMerge_h
#define vtkParseMerge_h
#include "vtkParseData.h"
#include "vtkParseHierarchy.h"
/**
* This struct is meant to supplement ClassInfo, it gives information
* about which class (or classes) each method was inherited from
*/
typedef struct _MergeInfo
{
int NumberOfClasses; /* number of classes in geneology */
const char **ClassNames; /* class name */
int NumberOfFunctions; /* must match FunctionInfo */
int *NumberOfOverrides; /* n classes that define this function */
int **OverrideClasses; /* class for the override */
} MergeInfo;
#ifdef __cplusplus
extern "C" {
#endif
/**
* Merge all inherited methods into the ClassInfo.
* This will find and parse the header files for all the superclasses,
* and recursively add all inherited superclass methods into one ClassInfo.
* The returned MergeInfo object provides information about which class
* each inherited method was inherited from.
*/
MergeInfo *vtkParseMerge_MergeSuperClasses(
FileInfo *finfo, NamespaceInfo *data, ClassInfo *classInfo);
/**
* Free the MergeInfo object.
*/
void vtkParseMerge_FreeMergeInfo(MergeInfo *info);
/**
* Recursive suproutine to inherit methods from "classname".
* The class named by "classname" should be a superclass of the ClassInfo.
* If the MergeInfo is not provided (if it is NULL), then the only methods
* that are brought into the class are ones that are explicitly named
* by using declarations. The hintfile can also be NULL, if there is
* no hints file.
*/
void vtkParseMerge_MergeHelper(
FileInfo *finfo, const NamespaceInfo *data, const HierarchyInfo *hinfo,
const char *classname, int nhintfiles, char **hintfiles, MergeInfo *info,
ClassInfo *merge);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif