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
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
/// 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
\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
\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
\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
\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
\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
\r
/**\r
Get record array only contains DYNAMIC or DYNAMIC_EX type PCD.\r
- \r
+\r
@return ArrayList\r
*/\r
private ArrayList getDynamicRecordArray() {\r
\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
}\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
}\r
}\r
}\r
- \r
+\r
if (!found) {\r
if (token.isDynamicPCD && token.consumers.size() == 0) {\r
dxe.add(token);\r
/**\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
\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
\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