]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/PcdTools/org/tianocore/pcd/entity/MemoryDatabaseManager.java
Abstract the logic of Platform pcd preprocess according to FPD file to a class. And...
[mirror_edk2.git] / Tools / Source / PcdTools / org / tianocore / pcd / entity / MemoryDatabaseManager.java
index 7a874699677801b08a5ab0c6ec2149604f249039..90d0db4aaa62599ebed0b0057316e471a28a9c5b 100644 (file)
@@ -2,13 +2,13 @@
   MemoryDatabaseManager class.\r
 \r
   Database hold all PCD information comes from SPD, MSA, FPD file in memory.\r
\r
+\r
 Copyright (c) 2006, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 http://opensource.org/licenses/bsd-license.php\r
\r
+\r
 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
@@ -19,12 +19,12 @@ import java.util.ArrayList;
 import java.util.HashMap;\r
 import java.util.List;\r
 import java.util.Map;\r
-import java.util.UUID;\r
 \r
 import org.tianocore.pcd.entity.UsageIdentification;\r
 import org.tianocore.pcd.exception.EntityException;\r
 \r
-/** Database hold all PCD information comes from SPD, MSA, FPD file in memory.\r
+/**\r
+  Database hold all PCD information comes from SPD, MSA, FPD file in memory.\r
 **/\r
 public class MemoryDatabaseManager {\r
     ///\r
@@ -37,18 +37,18 @@ public class MemoryDatabaseManager {
     /// Before build a module, the used libary will be build firstly, the PCD of these\r
     /// libarry is inheritted by the module, so stored module's PCD information as PCD\r
     /// context of building libary.\r
-    /// \r
+    ///\r
     public static List<UsageInstance> UsageInstanceContext = null;\r
 \r
     ///\r
     /// Current module name, if now is buiding library, this value indicate this library\r
     /// is for building what module.\r
-    /// \r
+    ///\r
     public static String CurrentModuleName                 = null;\r
 \r
     ///\r
     /// String for PCD PEIM and DXE autogen file\r
-    /// \r
+    ///\r
     public static String PcdPeimHString                    = "";\r
     public static String PcdPeimCString                    = "";\r
     public static String PcdDxeHString                     = "";\r
@@ -68,9 +68,9 @@ public class MemoryDatabaseManager {
 \r
     /**\r
       Judege whether token exists in memory database\r
-      \r
+\r
       @param primaryKey    the primaryKey for searching token\r
-      \r
+\r
       @retval  TRUE  - token already exist in database.\r
       @retval  FALSE - token does not exist in database.\r
     **/\r
@@ -80,7 +80,7 @@ public class MemoryDatabaseManager {
 \r
     /**\r
       Add a pcd token into memory database.\r
-      \r
+\r
       @param primaryKey   the primary key for searching token\r
       @param token        token instance\r
     **/\r
@@ -90,9 +90,9 @@ public class MemoryDatabaseManager {
 \r
     /**\r
       Get a token instance from memory database with primary key.\r
-  \r
+\r
       @param primaryKey   the primary key for searching token\r
-    \r
+\r
       @return token instance.\r
     **/\r
     public Token getTokenByKey(String primaryKey) {\r
@@ -101,7 +101,7 @@ public class MemoryDatabaseManager {
 \r
     /**\r
       Get the number of PCD token record in memory database.\r
-      \r
+\r
       @return the number of PCD token record in memory database.\r
     **/\r
     public int getDBSize() {\r
@@ -110,7 +110,7 @@ public class MemoryDatabaseManager {
 \r
     /**\r
       Get the token record array contained all PCD token in memory database.\r
-      \r
+\r
       @return the token record array contained all PCD token in memory database.\r
     **/\r
     public Token[] getRecordArray() {\r
@@ -135,7 +135,7 @@ public class MemoryDatabaseManager {
 \r
     /**\r
        Get record array only contains DYNAMIC or DYNAMIC_EX type PCD.\r
-       \r
+\r
        @return ArrayList\r
      */\r
     private ArrayList getDynamicRecordArray() {\r
@@ -155,12 +155,12 @@ public class MemoryDatabaseManager {
 \r
     /**\r
       Get the token record array contained all PCD token referenced by PEI phase.\r
-          The output array is sorted based on descending order of the size of alignment for each feilds.\r
+      The output array is sorted based on descending order of the size of alignment for each feilds.\r
 \r
       @return the token record array contained all PCD token referenced in PEI phase.\r
       @throws EntityException\r
     **/\r
-    public void getTwoPhaseDynamicRecordArray(ArrayList<Token> pei, ArrayList<Token> dxe) \r
+    public void getTwoPhaseDynamicRecordArray(ArrayList<Token> pei, ArrayList<Token> dxe)\r
         throws EntityException {\r
         int                     usageInstanceIndex  =   0;\r
         int                     index               =   0;\r
@@ -187,8 +187,8 @@ public class MemoryDatabaseManager {
             }\r
 \r
             //\r
-            // If no PEI components reference the PCD entry, \r
-            // we check if it is referenced in DXE driver. \r
+            // If no PEI components reference the PCD entry,\r
+            // we check if it is referenced in DXE driver.\r
             //\r
             if (!found) {\r
                 if (token.consumers != null) {\r
@@ -202,7 +202,7 @@ public class MemoryDatabaseManager {
                         }\r
                     }\r
                 }\r
-                \r
+\r
                 if (!found) {\r
                     if (token.isDynamicPCD && token.consumers.size() == 0) {\r
                         dxe.add(token);\r
@@ -223,9 +223,9 @@ public class MemoryDatabaseManager {
     /**\r
       Get all PCD record for a module according to module's name, module's GUID,\r
       package name, package GUID, arch, version information.\r
-     \r
+\r
       @param usageId   the id of UsageInstance.\r
-      \r
+\r
       @return  all usage instance for this module in memory database.\r
     **/\r
     public List<UsageInstance> getUsageInstanceArrayByModuleName(UsageIdentification usageId) {\r
@@ -237,14 +237,14 @@ public class MemoryDatabaseManager {
 \r
     /**\r
        Get all PCD token for a usage instance according to primary key.\r
-       \r
+\r
        @param primaryKey    the primary key of usage instance.\r
-       \r
+\r
        @return List<UsageInstance>\r
      */\r
     public List<UsageInstance> getUsageInstanceArrayByKeyString(String primaryKey) {\r
         Token[]               tokenArray          = null;\r
-        int                   recordIndex         = 0; \r
+        int                   recordIndex         = 0;\r
         UsageInstance         usageInstance       = null;\r
         List<UsageInstance>   returnArray         = new ArrayList<UsageInstance>();\r
 \r
@@ -267,7 +267,7 @@ public class MemoryDatabaseManager {
 \r
     /**\r
       Get all modules name who contains PCD information\r
-     \r
+\r
       @return Array for module name\r
     **/\r
     public List<String> getAllModuleArray()\r