Skip to content

Commit

Permalink
add const parsing tokens for identifying EdaDataFile's subnet records…
Browse files Browse the repository at this point in the history
… and types
  • Loading branch information
nam20485 committed Oct 11, 2023
1 parent d5bcb8f commit 98a0130
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
12 changes: 6 additions & 6 deletions OdbDesignLib/EdaDataFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,13 +349,13 @@ namespace Odb::Lib::FileModel::Design

lineStream >> pCurrentNetRecord->attributesIdString;
}
else if (line.find(SUBNET_RECORD_TOKEN) == 0)
else if (line.find(NetRecord::SubnetRecord::RECORD_TOKEN) == 0)
{
// component record line
std::string token;

lineStream >> token;
if (token != SUBNET_RECORD_TOKEN) return false;
if (token != NetRecord::SubnetRecord::RECORD_TOKEN) return false;

if (pCurrentNetRecord != nullptr)
{
Expand All @@ -369,17 +369,17 @@ namespace Odb::Lib::FileModel::Design

// subnet type
lineStream >> token;
if (token == "VIA")
if (token == NetRecord::SubnetRecord::RECORD_TYPE_VIA_TOKEN)
{
pCurrentSubnetRecord = std::make_shared<NetRecord::SubnetRecord>();
pCurrentSubnetRecord->type = NetRecord::SubnetRecord::Type::Via;
}
else if (token == "TRC")
else if (token == NetRecord::SubnetRecord::RECORD_TYPE_TRACE_TOKEN)
{
pCurrentSubnetRecord = std::make_shared<NetRecord::SubnetRecord>();
pCurrentSubnetRecord->type = NetRecord::SubnetRecord::Type::Trace;
}
else if (token == "PLN")
else if (token == NetRecord::SubnetRecord::RECORD_TYPE_PLANE_TOKEN)
{
pCurrentSubnetRecord = std::make_shared<NetRecord::PlaneSubnetRecord>();
pCurrentSubnetRecord->type = NetRecord::SubnetRecord::Type::Plane;
Expand Down Expand Up @@ -425,7 +425,7 @@ namespace Odb::Lib::FileModel::Design
// fill size
lineStream >> std::dynamic_pointer_cast<NetRecord::PlaneSubnetRecord>(pCurrentSubnetRecord)->fillSize;
}
else if (token == "TOP")
else if (token == NetRecord::SubnetRecord::RECORD_TYPE_TOEPRINT_TOKEN)
{
pCurrentSubnetRecord = std::make_shared<NetRecord::ToeprintSubnetRecord>();
pCurrentSubnetRecord->type = NetRecord::SubnetRecord::Type::Toeprint;
Expand Down
9 changes: 8 additions & 1 deletion OdbDesignLib/EdaDataFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ namespace Odb::Lib::FileModel::Design

Type type;
FeatureIdRecord::Vector m_featureIdRecords;

inline static const std::string RECORD_TOKEN = "SNT";
inline static const std::string RECORD_TYPE_TRACE_TOKEN = "TRC";
inline static const std::string RECORD_TYPE_VIA_TOKEN = "VIA";
inline static const std::string RECORD_TYPE_TOEPRINT_TOKEN = "TOP";
inline static const std::string RECORD_TYPE_PLANE_TOKEN = "PLN";

}; // SubnetRecord

struct DECLSPEC ToeprintSubnetRecord : public SubnetRecord, public IProtoBuffable<odbdesign::proto::EdaDataFile::NetRecord::ToeprintSubnetRecord>
Expand Down Expand Up @@ -244,7 +251,7 @@ namespace Odb::Lib::FileModel::Design
inline static const std::string ATTRIBUTE_NAME_TOKEN = "@";
inline static const std::string ATTRIBUTE_VALUE_TOKEN = "&";
inline static const std::string NET_RECORD_TOKEN = "NET";
inline static const std::string SUBNET_RECORD_TOKEN = "SNT";
//inline static const std::string SUBNET_RECORD_TOKEN = "SNT";
inline static const std::string FEATURE_ID_RECORD_TOKEN = "FID";
inline static const std::string PACKAGE_RECORD_TOKEN = "PKG";
inline static const std::string PIN_RECORD_TOKEN = "PIN";
Expand Down

0 comments on commit 98a0130

Please sign in to comment.