Debian Codegraph @

src/Base/Type.pyi

raw
1 # SPDX-License-Identifier: LGPL-2.1-or-later
2
3 from Metadata import export, forward_declarations, constmethod
4 from PyObjectBase import PyObjectBase
5 from typing import List, Final
6
7 @export(
8 Twin="BaseType",
9 TwinPointer="BaseType",
10 Delete=True,
11 )
12 @forward_declarations(
13 """
14 namespace Base {
15 using BaseType = Type;
16 }"""
17 )
18 class Type(PyObjectBase):
19 """
20 BaseTypePy class.
21
22 This class provides functionality related to type management in the Base module. It's not intended for direct instantiation but for accessing type information and creating instances of various types. Instantiation is possible for classes that inherit from the Base::BaseClass class and are not abstract.
23
24 Author: Juergen Riegel ([email protected])
25 Licence: LGPL
26 """
27
28 Name: Final[str] = ""
29 """The name of the type id."""
30
31 Key: Final[int] = 0
32 """The key of the type id."""
33
34 Module: Final[str] = ""
35 """Module in which this class is defined."""
36
37 @staticmethod
38 def fromName(name: str) -> "Type":
39 """
40 fromName(name) -> Base.BaseType
41
42 Returns a type object by name.
43
44 name : str
45 """
46 ...
47
48 @staticmethod
49 def fromKey(key: int) -> "Type":
50 """
51 fromKey(key) -> Base.BaseType
52
53 Returns a type id object by key.
54
55 key : int
56 """
57 ...
58
59 @staticmethod
60 def getNumTypes() -> int:
61 """
62 getNumTypes() -> int
63
64 Returns the number of type ids created so far.
65 """
66 ...
67
68 @staticmethod
69 def getBadType() -> "Type":
70 """
71 getBadType() -> Base.BaseType
72
73 Returns an invalid type id.
74 """
75 ...
76
77 @staticmethod
78 def getAllDerivedFrom(type: str) -> List[str]:
79 """
80 getAllDerivedFrom(type) -> list
81
82 Returns all descendants from the given type id.
83
84 type : str, Base.BaseType
85 """
86 ...
87
88 @constmethod
89 def getParent(self) -> "Type":
90 """
91 getParent() -> Base.BaseType
92
93 Returns the parent type id.
94 """
95 ...
96
97 @constmethod
98 def isBad(self) -> bool:
99 """
100 isBad() -> bool
101
102 Checks if the type id is invalid.
103 """
104 ...
105
106 @constmethod
107 def isDerivedFrom(self, type: str) -> bool:
108 """
109 isDerivedFrom(type) -> bool
110
111 Returns true if given type id is a father of this type id.
112
113 type : str, Base.BaseType
114 """
115 ...
116
117 @constmethod
118 def getAllDerived(self) -> List[object]:
119 """
120 getAllDerived() -> list
121
122 Returns all descendants from this type id.
123 """
124 ...
125
126 def createInstance(self) -> object:
127 """
128 createInstance() -> object
129
130 Creates an instance of this type id.
131 """
132 ...
133
134 @staticmethod
135 def createInstanceByName(name: str, load: bool = False) -> object:
136 """
137 createInstanceByName(name, load=False) -> object
138
139 Creates an instance of the named type id.
140
141 name : str
142 load : bool
143 Load named type id module.
144 """
145 ...