]> git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/Python/UPT/Object/POM/ModuleObject.py
Sync BaseTools Branch (version r2271) to EDKII main trunk.
[mirror_edk2.git] / BaseTools / Source / Python / UPT / Object / POM / ModuleObject.py
1 ## @file
2 # This file is used to define a class object to describe a module
3 #
4 # Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
5 #
6 # This program and the accompanying materials are licensed and made available
7 # under the terms and conditions of the BSD License which accompanies this
8 # distribution. The full text of the license may be found at
9 # http://opensource.org/licenses/bsd-license.php
10 #
11 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 '''
15 ModuleObject
16 '''
17
18 ##
19 # Import Modules
20 #
21 from Object.POM.CommonObject import CommonPropertiesObject
22 from Object.POM.CommonObject import IdentificationObject
23 from Object.POM.CommonObject import CommonHeaderObject
24 from Object.POM.CommonObject import HelpTextListObject
25 from Object.POM.CommonObject import GuidVersionObject
26
27
28 ##
29 # BootModeObject
30 #
31 class BootModeObject(CommonPropertiesObject, HelpTextListObject):
32 def __init__(self):
33 self.SupportedBootModes = ''
34 CommonPropertiesObject.__init__(self)
35 HelpTextListObject.__init__(self)
36
37 def SetSupportedBootModes(self, SupportedBootModes):
38 self.SupportedBootModes = SupportedBootModes
39
40 def GetSupportedBootModes(self):
41 return self.SupportedBootModes
42
43 ##
44 # EventObject
45 #
46 class EventObject(CommonPropertiesObject, HelpTextListObject):
47 def __init__(self):
48 self.EventType = ''
49 CommonPropertiesObject.__init__(self)
50 HelpTextListObject.__init__(self)
51
52 def SetEventType(self, EventType):
53 self.EventType = EventType
54
55 def GetEventType(self):
56 return self.EventType
57
58 ##
59 # HobObject
60 #
61 class HobObject(CommonPropertiesObject, HelpTextListObject):
62 def __init__(self):
63 self.HobType = ''
64 CommonPropertiesObject.__init__(self)
65 HelpTextListObject.__init__(self)
66
67 def SetHobType(self, HobType):
68 self.HobType = HobType
69
70 def GetHobType(self):
71 return self.HobType
72
73 ##
74 # SpecObject
75 #
76 class SpecObject(object):
77 def __init__(self):
78 self.Spec = ''
79 self.Version = ''
80
81 def SetSpec(self, Spec):
82 self.Spec = Spec
83
84 def GetSpec(self):
85 return self.Spec
86
87 def SetVersion(self, Version):
88 self.Version = Version
89
90 def GetVersion(self):
91 return self.Version
92
93 ## ModuleHeaderObject
94 #
95 # This class defined header items used in Module file
96 #
97 class ModuleHeaderObject(IdentificationObject, CommonHeaderObject):
98 def __init__(self):
99 self.IsLibrary = False
100 self.IsLibraryModList = []
101 self.ModuleType = ''
102 self.BinaryModule = False
103 self.PcdIsDriver = ''
104 self.PiSpecificationVersion = ''
105 self.UefiSpecificationVersion = ''
106 #
107 # SpecObject
108 #
109 self.SpecList = []
110 #
111 # BootModeObject
112 #
113 self.BootModeList = []
114 #
115 # EventObject
116 #
117 self.EventList = []
118 #
119 # HobObject
120 #
121 self.HobList = []
122 #
123 # LibraryClassObject
124 #
125 self.LibraryClassList = []
126 self.SupArchList = []
127 IdentificationObject.__init__(self)
128 CommonHeaderObject.__init__(self)
129
130 def SetIsLibrary(self, IsLibrary):
131 self.IsLibrary = IsLibrary
132
133 def GetIsLibrary(self):
134 return self.IsLibrary
135
136 def SetIsLibraryModList(self, IsLibraryModList):
137 self.IsLibraryModList = IsLibraryModList
138
139 def GetIsLibraryModList(self):
140 return self.IsLibraryModList
141
142 def SetModuleType(self, ModuleType):
143 self.ModuleType = ModuleType
144
145 def GetModuleType(self):
146 return self.ModuleType
147
148 def SetBinaryModule(self, BinaryModule):
149 self.BinaryModule = BinaryModule
150
151 def GetBinaryModule(self):
152 return self.BinaryModule
153
154 def SetPcdIsDriver(self, PcdIsDriver):
155 self.PcdIsDriver = PcdIsDriver
156
157 def GetPcdIsDriver(self):
158 return self.PcdIsDriver
159
160 def SetPiSpecificationVersion(self, PiSpecificationVersion):
161 self.PiSpecificationVersion = PiSpecificationVersion
162
163 def GetPiSpecificationVersion(self):
164 return self.PiSpecificationVersion
165
166 def SetUefiSpecificationVersion(self, UefiSpecificationVersion):
167 self.UefiSpecificationVersion = UefiSpecificationVersion
168
169 def GetUefiSpecificationVersion(self):
170 return self.UefiSpecificationVersion
171
172 def SetSpecList(self, SpecList):
173 self.SpecList = SpecList
174
175 def GetSpecList(self):
176 return self.SpecList
177
178 def SetBootModeList(self, BootModeList):
179 self.BootModeList = BootModeList
180
181 def GetBootModeList(self):
182 return self.BootModeList
183
184 def SetEventList(self, EventList):
185 self.EventList = EventList
186
187 def GetEventList(self):
188 return self.EventList
189
190 def SetHobList(self, HobList):
191 self.HobList = HobList
192
193 def GetHobList(self):
194 return self.HobList
195
196 def SetLibraryClassList(self, LibraryClassList):
197 self.LibraryClassList = LibraryClassList
198
199 def GetLibraryClassList(self):
200 return self.LibraryClassList
201
202 def SetSupArchList(self, SupArchList):
203 self.SupArchList = SupArchList
204
205 def GetSupArchList(self):
206 return self.SupArchList
207
208 ##
209 # SourceFileObject
210 #
211 class SourceFileObject(CommonPropertiesObject):
212 def __init__(self):
213 CommonPropertiesObject.__init__(self)
214 self.SourceFile = ''
215 self.TagName = ''
216 self.ToolCode = ''
217 self.Family = ''
218 self.FileType = ''
219
220 def SetSourceFile(self, SourceFile):
221 self.SourceFile = SourceFile
222
223 def GetSourceFile(self):
224 return self.SourceFile
225
226 def SetTagName(self, TagName):
227 self.TagName = TagName
228
229 def GetTagName(self):
230 return self.TagName
231
232 def SetToolCode(self, ToolCode):
233 self.ToolCode = ToolCode
234
235 def GetToolCode(self):
236 return self.ToolCode
237
238 def SetFamily(self, Family):
239 self.Family = Family
240
241 def GetFamily(self):
242 return self.Family
243
244 def SetFileType(self, FileType):
245 self.FileType = FileType
246
247 def GetFileType(self):
248 return self.FileType
249
250
251 ##
252 # BinaryFileObject
253 #
254 class BinaryFileObject(CommonPropertiesObject):
255 def __init__(self):
256 self.FileNamList = []
257 self.AsBuiltList = []
258 CommonPropertiesObject.__init__(self)
259
260 def SetFileNameList(self, FileNamList):
261 self.FileNamList = FileNamList
262
263 def GetFileNameList(self):
264 return self.FileNamList
265
266 def SetAsBuiltList(self, AsBuiltList):
267 self.AsBuiltList = AsBuiltList
268
269 def GetAsBuiltList(self):
270 return self.AsBuiltList
271
272
273 ##
274 # AsBuildLibraryClassObject
275 #
276 class AsBuildLibraryClassObject(object):
277 def __init__(self):
278 self.LibGuid = ''
279 self.LibVersion = ''
280
281 def SetLibGuid(self, LibGuid):
282 self.LibGuid = LibGuid
283 def GetLibGuid(self):
284 return self.LibGuid
285
286 def SetLibVersion(self, LibVersion):
287 self.LibVersion = LibVersion
288 def GetLibVersion(self):
289 return self.LibVersion
290
291 ##
292 # AsBuiltObject
293 #
294 class AsBuiltObject(object):
295 def __init__(self):
296 #
297 # list of PcdObject
298 #
299 self.PatchPcdList = []
300 #
301 # list of PcdObject
302 #
303 self.PcdExValueList = []
304 #
305 # list of GuidVersionObject
306 #
307 self.LibraryInstancesList = []
308 #
309 # List of BinaryBuildFlag object
310 #
311 self.BinaryBuildFlagList = ''
312
313 def SetPatchPcdList(self, PatchPcdList):
314 self.PatchPcdList = PatchPcdList
315
316 def GetPatchPcdList(self):
317 return self.PatchPcdList
318
319 def SetPcdExList(self, PcdExValueList):
320 self.PcdExValueList = PcdExValueList
321
322 def GetPcdExList(self):
323 return self.PcdExValueList
324
325 def SetLibraryInstancesList(self, LibraryInstancesList):
326 self.LibraryInstancesList = LibraryInstancesList
327
328 def GetLibraryInstancesList(self):
329 return self.LibraryInstancesList
330
331 def SetBuildFlagsList(self, BinaryBuildFlagList):
332 self.BinaryBuildFlagList = BinaryBuildFlagList
333
334 def GetBuildFlagsList(self):
335 return self.BinaryBuildFlagList
336
337 ##
338 # BinaryBuildFlag, this object will include those fields that are not
339 # covered by the UPT Spec BinaryFile field
340 #
341 class BinaryBuildFlagObject(object):
342 def __init__(self):
343 self.Target = ''
344 self.TagName = ''
345 self.Family = ''
346 self.AsBuiltOptionFlags = ''
347
348 def SetTarget(self, Target):
349 self.Target = Target
350
351 def GetTarget(self):
352 return self.Target
353
354 def SetTagName(self, TagName):
355 self.TagName = TagName
356
357 def GetTagName(self):
358 return self.TagName
359
360 def SetFamily(self, Family):
361 self.Family = Family
362
363 def GetFamily(self):
364 return self.Family
365
366 def SetAsBuiltOptionFlags(self, AsBuiltOptionFlags):
367 self.AsBuiltOptionFlags = AsBuiltOptionFlags
368 def GetAsBuiltOptionFlags(self):
369 return self.AsBuiltOptionFlags
370
371 ##
372 # ExternObject
373 #
374 class ExternObject(CommonPropertiesObject):
375 def __init__(self):
376 self.EntryPoint = ''
377 self.UnloadImage = ''
378 self.Constructor = ''
379 self.Destructor = ''
380 self.SupModList = []
381 CommonPropertiesObject.__init__(self)
382
383 def SetEntryPoint(self, EntryPoint):
384 self.EntryPoint = EntryPoint
385
386 def GetEntryPoint(self):
387 return self.EntryPoint
388
389 def SetUnloadImage(self, UnloadImage):
390 self.UnloadImage = UnloadImage
391
392 def GetUnloadImage(self):
393 return self.UnloadImage
394
395 def SetConstructor(self, Constructor):
396 self.Constructor = Constructor
397
398 def GetConstructor(self):
399 return self.Constructor
400
401 def SetDestructor(self, Destructor):
402 self.Destructor = Destructor
403
404 def GetDestructor(self):
405 return self.Destructor
406
407 def SetSupModList(self, SupModList):
408 self.SupModList = SupModList
409 def GetSupModList(self):
410 return self.SupModList
411
412 ##
413 # DepexObject
414 #
415 class DepexObject(CommonPropertiesObject):
416 def __init__(self):
417 self.Depex = ''
418 self.ModuelType = ''
419 CommonPropertiesObject.__init__(self)
420
421 def SetDepex(self, Depex):
422 self.Depex = Depex
423
424 def GetDepex(self):
425 return self.Depex
426
427 def SetModuleType(self, ModuleType):
428 self.ModuelType = ModuleType
429
430 def GetModuleType(self):
431 return self.ModuelType
432
433 ##
434 # PackageDependencyObject
435 #
436 class PackageDependencyObject(GuidVersionObject, CommonPropertiesObject):
437 def __init__(self):
438 self.Package = ''
439 self.PackageFilePath = ''
440 GuidVersionObject.__init__(self)
441 CommonPropertiesObject.__init__(self)
442
443 def SetPackageFilePath(self, PackageFilePath):
444 self.PackageFilePath = PackageFilePath
445
446 def GetPackageFilePath(self):
447 return self.PackageFilePath
448
449 def SetPackage(self, Package):
450 self.Package = Package
451
452 def GetPackage(self):
453 return self.Package
454
455 ##
456 # BuildOptionObject
457 #
458 class BuildOptionObject(CommonPropertiesObject):
459 def __init__(self):
460 CommonPropertiesObject.__init__(self)
461 self.BuildOption = ''
462
463 def SetBuildOption(self, BuildOption):
464 self.BuildOption = BuildOption
465
466 def GetBuildOption(self):
467 return self.BuildOption
468
469 ##
470 # ModuleObject
471 #
472 class ModuleObject(ModuleHeaderObject):
473 def __init__(self):
474 #
475 # {Arch : ModuleHeaderObject}
476 #
477 self.HeaderDict = {}
478 #
479 # LibraryClassObject
480 #
481 self.LibraryClassList = []
482 #
483 # SourceFileObject
484 #
485 self.SourceFileList = []
486 #
487 # BinaryFileObject
488 #
489 self.BinaryFileList = []
490 #
491 # PackageDependencyObject
492 #
493 self.PackageDependencyList = []
494 #
495 # DepexObject
496 #
497 self.PeiDepex = []
498 #
499 # DepexObject
500 #
501 self.DxeDepex = []
502 #
503 # DepexObject
504 #
505 self.SmmDepex = []
506 #
507 # ProtocolObject
508 #
509 self.ProtocolList = []
510 #
511 # PpiObject
512 #
513 self.PpiList = []
514 #
515 # GuidObject
516 #
517 self.GuidList = []
518 #
519 # PcdObject
520 #
521 self.PcdList = []
522 #
523 # ExternObject
524 #
525 self.ExternList = []
526 #
527 # BuildOptionObject
528 #
529 self.BuildOptionList = []
530 #
531 # UserExtensionObject
532 #
533 self.UserExtensionList = []
534 #
535 # MiscFileObject
536 #
537 self.MiscFileList = []
538 #
539 # ClonedFromObject
540 #
541 self.ClonedFrom = None
542
543 ModuleHeaderObject.__init__(self)
544
545 def SetHeaderDict(self, HeaderDict):
546 self.HeaderDict = HeaderDict
547
548 def GetHeaderDict(self):
549 return self.HeaderDict
550
551 def SetLibraryClassList(self, LibraryClassList):
552 self.LibraryClassList = LibraryClassList
553
554 def GetLibraryClassList(self):
555 return self.LibraryClassList
556
557 def SetSourceFileList(self, SourceFileList):
558 self.SourceFileList = SourceFileList
559
560 def GetSourceFileList(self):
561 return self.SourceFileList
562
563 def SetBinaryFileList(self, BinaryFileList):
564 self.BinaryFileList = BinaryFileList
565
566 def GetBinaryFileList(self):
567 return self.BinaryFileList
568
569 def SetPackageDependencyList(self, PackageDependencyList):
570 self.PackageDependencyList = PackageDependencyList
571
572 def GetPackageDependencyList(self):
573 return self.PackageDependencyList
574
575 def SetPeiDepex(self, PeiDepex):
576 self.PeiDepex = PeiDepex
577
578 def GetPeiDepex(self):
579 return self.PeiDepex
580
581 def SetDxeDepex(self, DxeDepex):
582 self.DxeDepex = DxeDepex
583
584 def GetDxeDepex(self):
585 return self.DxeDepex
586
587 def SetSmmDepex(self, SmmDepex):
588 self.SmmDepex = SmmDepex
589
590 def GetSmmDepex(self):
591 return self.SmmDepex
592
593 def SetPpiList(self, PpiList):
594 self.PpiList = PpiList
595
596 def GetPpiList(self):
597 return self.PpiList
598
599 def SetProtocolList(self, ProtocolList):
600 self.ProtocolList = ProtocolList
601
602 def GetProtocolList(self):
603 return self.ProtocolList
604
605 def SetPcdList(self, PcdList):
606 self.PcdList = PcdList
607
608 def GetPcdList(self):
609 return self.PcdList
610
611 def SetGuidList(self, GuidList):
612 self.GuidList = GuidList
613
614 def GetGuidList(self):
615 return self.GuidList
616
617 def SetExternList(self, ExternList):
618 self.ExternList = ExternList
619
620 def GetExternList(self):
621 return self.ExternList
622
623 def SetBuildOptionList(self, BuildOptionList):
624 self.BuildOptionList = BuildOptionList
625
626 def GetBuildOptionList(self):
627 return self.BuildOptionList
628
629 def SetUserExtensionList(self, UserExtensionList):
630 self.UserExtensionList = UserExtensionList
631
632 def GetUserExtensionList(self):
633 return self.UserExtensionList
634
635 def SetMiscFileList(self, MiscFileList):
636 self.MiscFileList = MiscFileList
637
638 def GetMiscFileList(self):
639 return self.MiscFileList
640
641 def SetClonedFrom(self, ClonedFrom):
642 self.ClonedFrom = ClonedFrom
643
644 def GetClonedFrom(self):
645 return self.ClonedFrom