[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [4936] Rename an enum to improve concinnity
From: |
Greg Chicares |
Subject: |
[lmi-commits] [4936] Rename an enum to improve concinnity |
Date: |
Sun, 09 May 2010 14:03:53 +0000 |
Revision: 4936
http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=4936
Author: chicares
Date: 2010-05-09 14:03:53 +0000 (Sun, 09 May 2010)
Log Message:
-----------
Rename an enum to improve concinnity
Modified Paths:
--------------
lmi/trunk/database_document.cpp
lmi/trunk/database_document.hpp
lmi/trunk/database_view.cpp
lmi/trunk/dbnames.hpp
Modified: lmi/trunk/database_document.cpp
===================================================================
--- lmi/trunk/database_document.cpp 2010-05-09 12:22:45 UTC (rev 4935)
+++ lmi/trunk/database_document.cpp 2010-05-09 14:03:53 UTC (rev 4936)
@@ -90,7 +90,7 @@
{
}
-database_entity& DatabaseDocument::GetTDBValue(DatabaseNames index)
+database_entity& DatabaseDocument::GetTDBValue(e_database_key index)
{
if(dict_.find(index) == dict_.end())
{
Modified: lmi/trunk/database_document.hpp
===================================================================
--- lmi/trunk/database_document.hpp 2010-05-09 12:22:45 UTC (rev 4935)
+++ lmi/trunk/database_document.hpp 2010-05-09 14:03:53 UTC (rev 4936)
@@ -40,7 +40,7 @@
DatabaseDocument();
virtual ~DatabaseDocument();
- database_entity& GetTDBValue(DatabaseNames index);
+ database_entity& GetTDBValue(e_database_key index);
private:
// ProductEditorDocument overrides.
Modified: lmi/trunk/database_view.cpp
===================================================================
--- lmi/trunk/database_view.cpp 2010-05-09 12:22:45 UTC (rev 4935)
+++ lmi/trunk/database_view.cpp 2010-05-09 14:03:53 UTC (rev 4936)
@@ -54,17 +54,17 @@
/// - Rename 'id' to something like 'database_key' (and 'id_'
/// similarly).
///
-/// - Change the type of 'id_' to (enum) DatabaseNames.
+/// - Change the type of 'id_' to (enum) e_database_key.
///
/// However, shouldn't we rewrite this class completely instead?
///
/// Its purpose is to represent the information in struct db_names,
/// while deriving from class wxTreeItemData. Yet it contains only two
/// of that struct's four members--these:
-/// DatabaseNames Idx;
+/// e_database_key Idx;
/// char const* LongName;
/// but not these:
-/// DatabaseNames ParentIdx;
+/// e_database_key ParentIdx;
/// char const* ShortName;
/// The fields not included are of course accessed by indexing a
/// db_names object from the vector returned by this function:
@@ -81,7 +81,7 @@
///
/// I see two other designs to consider:
///
-/// (1) This class holds only a DatabaseNames enum. That's enough to
+/// (1) This class holds only an e_database_key enum. That's enough to
/// find the corresponding struct db_names in the vector returned by
/// std::vector<db_names> const& LMI_SO GetDBNames();
/// and we can then access that struct's members directly. And we
@@ -181,7 +181,7 @@
void DatabaseView::SetupControls()
{
std::vector<db_names> const& names = GetDBNames();
- std::map<DatabaseNames, wxTreeItemId> name_to_id;
+ std::map<e_database_key, wxTreeItemId> name_to_id;
wxTreeCtrl& tree_ctrl = tree();
Modified: lmi/trunk/dbnames.hpp
===================================================================
--- lmi/trunk/dbnames.hpp 2010-05-09 12:22:45 UTC (rev 4935)
+++ lmi/trunk/dbnames.hpp 2010-05-09 14:03:53 UTC (rev 4936)
@@ -33,7 +33,7 @@
/// See 'dbnames.xpp' for the definition of each entity.
-enum DatabaseNames
+enum e_database_key
{DB_FIRST
,DB_Topic_Underwriting
@@ -440,8 +440,8 @@
struct db_names
{
- DatabaseNames Idx;
- DatabaseNames ParentIdx;
+ e_database_key Idx;
+ e_database_key ParentIdx;
char const* ShortName;
char const* LongName;
};
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi-commits] [4936] Rename an enum to improve concinnity,
Greg Chicares <=