[Avida-cvs] [Avida2-svn] r336 - in trunk: Avida2.xcodeproj source/bindings/Boost.Python source/main source/testsuites/unit_testsuites source/testsuites/unit_testsuites/level_0 source/tools
brysonda@myxo.css.msu.edu
brysonda at myxo.css.msu.edu
Thu Oct 6 17:35:44 PDT 2005
Author: brysonda
Date: 2005-10-06 20:35:44 -0400 (Thu, 06 Oct 2005)
New Revision: 336
Added:
trunk/source/tools/cDataEntry.cc
trunk/source/tools/cDataEntry.h
trunk/source/tools/cDataFile.cc
trunk/source/tools/cDataFile.h
trunk/source/tools/cDataFileManager.cc
trunk/source/tools/cDataFileManager.h
trunk/source/tools/cDataManager_Base.cc
trunk/source/tools/cDataManager_Base.h
trunk/source/tools/cDefaultMessageDisplay.cc
trunk/source/tools/cDefaultMessageDisplay.h
trunk/source/tools/cDoubleSum.cc
trunk/source/tools/cDoubleSum.h
Removed:
trunk/source/tools/data_entry.cc
trunk/source/tools/data_entry.hh
trunk/source/tools/data_file.cc
trunk/source/tools/data_file.hh
trunk/source/tools/data_file_manager.cc
trunk/source/tools/data_file_manager.hh
trunk/source/tools/data_manager_base.cc
trunk/source/tools/data_manager_base.hh
trunk/source/tools/default_message_display.cc
trunk/source/tools/default_message_display.hh
trunk/source/tools/double_sum.cc
trunk/source/tools/double_sum.hh
Modified:
trunk/Avida2.xcodeproj/project.pbxproj
trunk/source/bindings/Boost.Python/data_entry.pyste
trunk/source/bindings/Boost.Python/data_file.pyste
trunk/source/bindings/Boost.Python/data_file_manager.pyste
trunk/source/bindings/Boost.Python/data_manager_base.pyste
trunk/source/bindings/Boost.Python/double_sum.pyste
trunk/source/bindings/Boost.Python/stats.pyste
trunk/source/main/cAnalyze.cc
trunk/source/main/cAnalyze.h
trunk/source/main/cGenotype.h
trunk/source/main/cInjectGenebank.cc
trunk/source/main/cPopulation.cc
trunk/source/main/cStats.cc
trunk/source/main/cStats.h
trunk/source/testsuites/unit_testsuites/data_entry.t.cc
trunk/source/testsuites/unit_testsuites/data_file.t.cc
trunk/source/testsuites/unit_testsuites/data_file_manager.t.cc
trunk/source/testsuites/unit_testsuites/data_manager_base.t.cc
trunk/source/testsuites/unit_testsuites/default_message_display.t.cc
trunk/source/testsuites/unit_testsuites/level_0/double_sum.t.cc
trunk/source/tools/CMakeLists.txt
trunk/source/tools/message_display_hdrs.hh
trunk/source/tools/tDataEntryBase.hh
trunk/source/tools/tDataManager.hh
trunk/source/tools/tools.pri
Log:
Rename tools/d*
Modified: trunk/Avida2.xcodeproj/project.pbxproj
===================================================================
--- trunk/Avida2.xcodeproj/project.pbxproj 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/Avida2.xcodeproj/project.pbxproj 2005-10-07 00:35:44 UTC (rev 336)
@@ -11,12 +11,6 @@
700E2AF8085DE50C00CF158A /* avida.cc in Sources */ = {isa = PBXBuildFile; fileRef = DCC3109C0762539E008F7A48 /* avida.cc */; };
700E2B43085DE50C00CF158A /* weighted_index.cc in Sources */ = {isa = PBXBuildFile; fileRef = DCC315B3076253A5008F7A48 /* weighted_index.cc */; };
700E2B44085DE50C00CF158A /* tools.cc in Sources */ = {isa = PBXBuildFile; fileRef = DCC315AA076253A4008F7A48 /* tools.cc */; };
- 700E2B49085DE50C00CF158A /* data_entry.cc in Sources */ = {isa = PBXBuildFile; fileRef = DCC31550076253A4008F7A48 /* data_entry.cc */; };
- 700E2B4A085DE50C00CF158A /* data_file.cc in Sources */ = {isa = PBXBuildFile; fileRef = DCC31552076253A4008F7A48 /* data_file.cc */; };
- 700E2B4B085DE50C00CF158A /* data_file_manager.cc in Sources */ = {isa = PBXBuildFile; fileRef = DCC31554076253A4008F7A48 /* data_file_manager.cc */; };
- 700E2B4C085DE50C00CF158A /* data_manager_base.cc in Sources */ = {isa = PBXBuildFile; fileRef = DCC31556076253A4008F7A48 /* data_manager_base.cc */; };
- 700E2B4D085DE50C00CF158A /* default_message_display.cc in Sources */ = {isa = PBXBuildFile; fileRef = DCC31558076253A4008F7A48 /* default_message_display.cc */; };
- 700E2B4E085DE50C00CF158A /* double_sum.cc in Sources */ = {isa = PBXBuildFile; fileRef = DCC3155A076253A4008F7A48 /* double_sum.cc */; };
700E2B4F085DE50C00CF158A /* file.cc in Sources */ = {isa = PBXBuildFile; fileRef = DCC3155C076253A4008F7A48 /* file.cc */; };
700E2B50085DE50C00CF158A /* fixed_block.cc in Sources */ = {isa = PBXBuildFile; fileRef = DCC3155E076253A4008F7A48 /* fixed_block.cc */; };
700E2B51085DE50C00CF158A /* genesis.cc in Sources */ = {isa = PBXBuildFile; fileRef = DCC31562076253A4008F7A48 /* genesis.cc */; };
@@ -172,6 +166,18 @@
70B087E508F5F4BA00FC65FE /* cChangeList.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B087DF08F5F4BA00FC65FE /* cChangeList.cc */; };
70B087E608F5F4BA00FC65FE /* cConstSchedule.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B087E008F5F4BA00FC65FE /* cConstSchedule.cc */; };
70B087E708F5F4BA00FC65FE /* cCountTracker.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B087E108F5F4BA00FC65FE /* cCountTracker.cc */; };
+ 70B0885408F5FE5800FC65FE /* cDataEntry.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0884E08F5FE5800FC65FE /* cDataEntry.cc */; };
+ 70B0885508F5FE5800FC65FE /* cDataFile.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0884F08F5FE5800FC65FE /* cDataFile.cc */; };
+ 70B0885608F5FE5800FC65FE /* cDataFileManager.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0885008F5FE5800FC65FE /* cDataFileManager.cc */; };
+ 70B0885708F5FE5800FC65FE /* cDataManager_Base.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0885108F5FE5800FC65FE /* cDataManager_Base.cc */; };
+ 70B0885808F5FE5800FC65FE /* cDefaultMessageDisplay.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0885208F5FE5800FC65FE /* cDefaultMessageDisplay.cc */; };
+ 70B0885908F5FE5800FC65FE /* cDoubleSum.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0885308F5FE5800FC65FE /* cDoubleSum.cc */; };
+ 70B0885A08F5FE5800FC65FE /* cDataEntry.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0884E08F5FE5800FC65FE /* cDataEntry.cc */; };
+ 70B0885B08F5FE5800FC65FE /* cDataFile.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0884F08F5FE5800FC65FE /* cDataFile.cc */; };
+ 70B0885C08F5FE5800FC65FE /* cDataFileManager.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0885008F5FE5800FC65FE /* cDataFileManager.cc */; };
+ 70B0885D08F5FE5800FC65FE /* cDataManager_Base.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0885108F5FE5800FC65FE /* cDataManager_Base.cc */; };
+ 70B0885E08F5FE5800FC65FE /* cDefaultMessageDisplay.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0885208F5FE5800FC65FE /* cDefaultMessageDisplay.cc */; };
+ 70B0885F08F5FE5800FC65FE /* cDoubleSum.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0885308F5FE5800FC65FE /* cDoubleSum.cc */; };
70C1EF4808C393BA00F50912 /* cCodeLabel.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70C1EF4608C393BA00F50912 /* cCodeLabel.cc */; };
70C1EF4A08C393BA00F50912 /* cCodeLabel.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70C1EF4608C393BA00F50912 /* cCodeLabel.cc */; };
70C1EF5908C3948C00F50912 /* cCPUMemory.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70C1EF5808C3948C00F50912 /* cCPUMemory.cc */; };
@@ -256,12 +262,6 @@
DCC3166107628531008F7A48 /* avida.cc in Sources */ = {isa = PBXBuildFile; fileRef = DCC3109C0762539E008F7A48 /* avida.cc */; };
DCC316B807628742008F7A48 /* weighted_index.cc in Sources */ = {isa = PBXBuildFile; fileRef = DCC315B3076253A5008F7A48 /* weighted_index.cc */; };
DCC316B907628744008F7A48 /* tools.cc in Sources */ = {isa = PBXBuildFile; fileRef = DCC315AA076253A4008F7A48 /* tools.cc */; };
- DCC316BE0762874D008F7A48 /* data_entry.cc in Sources */ = {isa = PBXBuildFile; fileRef = DCC31550076253A4008F7A48 /* data_entry.cc */; };
- DCC316BF0762874E008F7A48 /* data_file.cc in Sources */ = {isa = PBXBuildFile; fileRef = DCC31552076253A4008F7A48 /* data_file.cc */; };
- DCC316C00762874F008F7A48 /* data_file_manager.cc in Sources */ = {isa = PBXBuildFile; fileRef = DCC31554076253A4008F7A48 /* data_file_manager.cc */; };
- DCC316C107628750008F7A48 /* data_manager_base.cc in Sources */ = {isa = PBXBuildFile; fileRef = DCC31556076253A4008F7A48 /* data_manager_base.cc */; };
- DCC316C207628751008F7A48 /* default_message_display.cc in Sources */ = {isa = PBXBuildFile; fileRef = DCC31558076253A4008F7A48 /* default_message_display.cc */; };
- DCC316C307628752008F7A48 /* double_sum.cc in Sources */ = {isa = PBXBuildFile; fileRef = DCC3155A076253A4008F7A48 /* double_sum.cc */; };
DCC316C407628753008F7A48 /* file.cc in Sources */ = {isa = PBXBuildFile; fileRef = DCC3155C076253A4008F7A48 /* file.cc */; };
DCC316C507628754008F7A48 /* fixed_block.cc in Sources */ = {isa = PBXBuildFile; fileRef = DCC3155E076253A4008F7A48 /* fixed_block.cc */; };
DCC316C607628755008F7A48 /* genesis.cc in Sources */ = {isa = PBXBuildFile; fileRef = DCC31562076253A4008F7A48 /* genesis.cc */; };
@@ -483,6 +483,18 @@
70B087DF08F5F4BA00FC65FE /* cChangeList.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cChangeList.cc; sourceTree = "<group>"; };
70B087E008F5F4BA00FC65FE /* cConstSchedule.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cConstSchedule.cc; sourceTree = "<group>"; };
70B087E108F5F4BA00FC65FE /* cCountTracker.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cCountTracker.cc; sourceTree = "<group>"; };
+ 70B0884808F5FE4500FC65FE /* cDataEntry.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cDataEntry.h; sourceTree = "<group>"; };
+ 70B0884908F5FE4500FC65FE /* cDataFile.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cDataFile.h; sourceTree = "<group>"; };
+ 70B0884A08F5FE4500FC65FE /* cDataFileManager.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cDataFileManager.h; sourceTree = "<group>"; };
+ 70B0884B08F5FE4500FC65FE /* cDataManager_Base.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cDataManager_Base.h; sourceTree = "<group>"; };
+ 70B0884C08F5FE4500FC65FE /* cDefaultMessageDisplay.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cDefaultMessageDisplay.h; sourceTree = "<group>"; };
+ 70B0884D08F5FE4500FC65FE /* cDoubleSum.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cDoubleSum.h; sourceTree = "<group>"; };
+ 70B0884E08F5FE5800FC65FE /* cDataEntry.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cDataEntry.cc; sourceTree = "<group>"; };
+ 70B0884F08F5FE5800FC65FE /* cDataFile.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cDataFile.cc; sourceTree = "<group>"; };
+ 70B0885008F5FE5800FC65FE /* cDataFileManager.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cDataFileManager.cc; sourceTree = "<group>"; };
+ 70B0885108F5FE5800FC65FE /* cDataManager_Base.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cDataManager_Base.cc; sourceTree = "<group>"; };
+ 70B0885208F5FE5800FC65FE /* cDefaultMessageDisplay.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cDefaultMessageDisplay.cc; sourceTree = "<group>"; };
+ 70B0885308F5FE5800FC65FE /* cDoubleSum.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cDoubleSum.cc; sourceTree = "<group>"; };
70C1EF4608C393BA00F50912 /* cCodeLabel.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cCodeLabel.cc; sourceTree = "<group>"; };
70C1EF4708C393BA00F50912 /* cCodeLabel.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cCodeLabel.h; sourceTree = "<group>"; };
70C1EF5808C3948C00F50912 /* cCPUMemory.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cCPUMemory.cc; sourceTree = "<group>"; };
@@ -1282,18 +1294,6 @@
DCC314D7076253A2008F7A48 /* text_test_interpreter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = text_test_interpreter.h; sourceTree = "<group>"; };
DCC31547076253A4008F7A48 /* cCycleCheck.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cCycleCheck.cc; sourceTree = "<group>"; };
DCC3154A076253A4008F7A48 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
- DCC31550076253A4008F7A48 /* data_entry.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = data_entry.cc; sourceTree = "<group>"; };
- DCC31551076253A4008F7A48 /* data_entry.hh */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = data_entry.hh; sourceTree = "<group>"; };
- DCC31552076253A4008F7A48 /* data_file.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = data_file.cc; sourceTree = "<group>"; };
- DCC31553076253A4008F7A48 /* data_file.hh */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = data_file.hh; sourceTree = "<group>"; };
- DCC31554076253A4008F7A48 /* data_file_manager.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = data_file_manager.cc; sourceTree = "<group>"; };
- DCC31555076253A4008F7A48 /* data_file_manager.hh */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = data_file_manager.hh; sourceTree = "<group>"; };
- DCC31556076253A4008F7A48 /* data_manager_base.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = data_manager_base.cc; sourceTree = "<group>"; };
- DCC31557076253A4008F7A48 /* data_manager_base.hh */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = data_manager_base.hh; sourceTree = "<group>"; };
- DCC31558076253A4008F7A48 /* default_message_display.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = default_message_display.cc; sourceTree = "<group>"; };
- DCC31559076253A4008F7A48 /* default_message_display.hh */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = default_message_display.hh; sourceTree = "<group>"; };
- DCC3155A076253A4008F7A48 /* double_sum.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = double_sum.cc; sourceTree = "<group>"; };
- DCC3155B076253A4008F7A48 /* double_sum.hh */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = double_sum.hh; sourceTree = "<group>"; };
DCC3155C076253A4008F7A48 /* file.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = file.cc; sourceTree = "<group>"; };
DCC3155D076253A4008F7A48 /* file.hh */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = file.hh; sourceTree = "<group>"; };
DCC3155E076253A4008F7A48 /* fixed_block.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = fixed_block.cc; sourceTree = "<group>"; };
@@ -2715,6 +2715,18 @@
DCC314D8076253A2008F7A48 /* tools */ = {
isa = PBXGroup;
children = (
+ 70B0884E08F5FE5800FC65FE /* cDataEntry.cc */,
+ 70B0884F08F5FE5800FC65FE /* cDataFile.cc */,
+ 70B0885008F5FE5800FC65FE /* cDataFileManager.cc */,
+ 70B0885108F5FE5800FC65FE /* cDataManager_Base.cc */,
+ 70B0885208F5FE5800FC65FE /* cDefaultMessageDisplay.cc */,
+ 70B0885308F5FE5800FC65FE /* cDoubleSum.cc */,
+ 70B0884808F5FE4500FC65FE /* cDataEntry.h */,
+ 70B0884908F5FE4500FC65FE /* cDataFile.h */,
+ 70B0884A08F5FE4500FC65FE /* cDataFileManager.h */,
+ 70B0884B08F5FE4500FC65FE /* cDataManager_Base.h */,
+ 70B0884C08F5FE4500FC65FE /* cDefaultMessageDisplay.h */,
+ 70B0884D08F5FE4500FC65FE /* cDoubleSum.h */,
70B087DF08F5F4BA00FC65FE /* cChangeList.cc */,
70B087E008F5F4BA00FC65FE /* cConstSchedule.cc */,
70B087E108F5F4BA00FC65FE /* cCountTracker.cc */,
@@ -2729,18 +2741,6 @@
70FB868608BFA02D00BDF589 /* tHashTable.hh */,
DCC31547076253A4008F7A48 /* cCycleCheck.cc */,
DCC3154A076253A4008F7A48 /* CMakeLists.txt */,
- DCC31550076253A4008F7A48 /* data_entry.cc */,
- DCC31551076253A4008F7A48 /* data_entry.hh */,
- DCC31552076253A4008F7A48 /* data_file.cc */,
- DCC31553076253A4008F7A48 /* data_file.hh */,
- DCC31554076253A4008F7A48 /* data_file_manager.cc */,
- DCC31555076253A4008F7A48 /* data_file_manager.hh */,
- DCC31556076253A4008F7A48 /* data_manager_base.cc */,
- DCC31557076253A4008F7A48 /* data_manager_base.hh */,
- DCC31558076253A4008F7A48 /* default_message_display.cc */,
- DCC31559076253A4008F7A48 /* default_message_display.hh */,
- DCC3155A076253A4008F7A48 /* double_sum.cc */,
- DCC3155B076253A4008F7A48 /* double_sum.hh */,
DCC3155C076253A4008F7A48 /* file.cc */,
DCC3155D076253A4008F7A48 /* file.hh */,
DCC3155E076253A4008F7A48 /* fixed_block.cc */,
@@ -3030,12 +3030,6 @@
700E2AF8085DE50C00CF158A /* avida.cc in Sources */,
700E2B43085DE50C00CF158A /* weighted_index.cc in Sources */,
700E2B44085DE50C00CF158A /* tools.cc in Sources */,
- 700E2B49085DE50C00CF158A /* data_entry.cc in Sources */,
- 700E2B4A085DE50C00CF158A /* data_file.cc in Sources */,
- 700E2B4B085DE50C00CF158A /* data_file_manager.cc in Sources */,
- 700E2B4C085DE50C00CF158A /* data_manager_base.cc in Sources */,
- 700E2B4D085DE50C00CF158A /* default_message_display.cc in Sources */,
- 700E2B4E085DE50C00CF158A /* double_sum.cc in Sources */,
700E2B4F085DE50C00CF158A /* file.cc in Sources */,
700E2B50085DE50C00CF158A /* fixed_block.cc in Sources */,
700E2B51085DE50C00CF158A /* genesis.cc in Sources */,
@@ -3156,6 +3150,12 @@
70B087E508F5F4BA00FC65FE /* cChangeList.cc in Sources */,
70B087E608F5F4BA00FC65FE /* cConstSchedule.cc in Sources */,
70B087E708F5F4BA00FC65FE /* cCountTracker.cc in Sources */,
+ 70B0885A08F5FE5800FC65FE /* cDataEntry.cc in Sources */,
+ 70B0885B08F5FE5800FC65FE /* cDataFile.cc in Sources */,
+ 70B0885C08F5FE5800FC65FE /* cDataFileManager.cc in Sources */,
+ 70B0885D08F5FE5800FC65FE /* cDataManager_Base.cc in Sources */,
+ 70B0885E08F5FE5800FC65FE /* cDefaultMessageDisplay.cc in Sources */,
+ 70B0885F08F5FE5800FC65FE /* cDoubleSum.cc in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -3166,12 +3166,6 @@
DCC3166107628531008F7A48 /* avida.cc in Sources */,
DCC316B807628742008F7A48 /* weighted_index.cc in Sources */,
DCC316B907628744008F7A48 /* tools.cc in Sources */,
- DCC316BE0762874D008F7A48 /* data_entry.cc in Sources */,
- DCC316BF0762874E008F7A48 /* data_file.cc in Sources */,
- DCC316C00762874F008F7A48 /* data_file_manager.cc in Sources */,
- DCC316C107628750008F7A48 /* data_manager_base.cc in Sources */,
- DCC316C207628751008F7A48 /* default_message_display.cc in Sources */,
- DCC316C307628752008F7A48 /* double_sum.cc in Sources */,
DCC316C407628753008F7A48 /* file.cc in Sources */,
DCC316C507628754008F7A48 /* fixed_block.cc in Sources */,
DCC316C607628755008F7A48 /* genesis.cc in Sources */,
@@ -3282,6 +3276,12 @@
70B087E208F5F4BA00FC65FE /* cChangeList.cc in Sources */,
70B087E308F5F4BA00FC65FE /* cConstSchedule.cc in Sources */,
70B087E408F5F4BA00FC65FE /* cCountTracker.cc in Sources */,
+ 70B0885408F5FE5800FC65FE /* cDataEntry.cc in Sources */,
+ 70B0885508F5FE5800FC65FE /* cDataFile.cc in Sources */,
+ 70B0885608F5FE5800FC65FE /* cDataFileManager.cc in Sources */,
+ 70B0885708F5FE5800FC65FE /* cDataManager_Base.cc in Sources */,
+ 70B0885808F5FE5800FC65FE /* cDefaultMessageDisplay.cc in Sources */,
+ 70B0885908F5FE5800FC65FE /* cDoubleSum.cc in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Modified: trunk/source/bindings/Boost.Python/data_entry.pyste
===================================================================
--- trunk/source/bindings/Boost.Python/data_entry.pyste 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/bindings/Boost.Python/data_entry.pyste 2005-10-07 00:35:44 UTC (rev 336)
@@ -1,5 +1,5 @@
-cDataEntry = Class("cDataEntry", "data_entry.hh")
+cDataEntry = Class("cDataEntry", "cDataEntry.h")
exclude(cDataEntry.operator['<<'])
# vim: set ft=python:
Modified: trunk/source/bindings/Boost.Python/data_file.pyste
===================================================================
--- trunk/source/bindings/Boost.Python/data_file.pyste 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/bindings/Boost.Python/data_file.pyste 2005-10-07 00:35:44 UTC (rev 336)
@@ -1,5 +1,5 @@
-cDataFile = Class("cDataFile", "data_file.hh")
+cDataFile = Class("cDataFile", "cDataFile.h")
set_policy(cDataFile.GetOFStream, return_internal_reference())
# vim: set ft=python:
Modified: trunk/source/bindings/Boost.Python/data_file_manager.pyste
===================================================================
--- trunk/source/bindings/Boost.Python/data_file_manager.pyste 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/bindings/Boost.Python/data_file_manager.pyste 2005-10-07 00:35:44 UTC (rev 336)
@@ -1,8 +1,8 @@
-Include("data_file.hh")
+Include("cDataFile.h")
Include("string.hh")
-cDataFileManager = Class("cDataFileManager", "data_file_manager.hh")
+cDataFileManager = Class("cDataFileManager", "cDataFileManager.h")
exclude(cDataFileManager.GetOFStream)
set_policy(cDataFileManager.Get, return_internal_reference())
Modified: trunk/source/bindings/Boost.Python/data_manager_base.pyste
===================================================================
--- trunk/source/bindings/Boost.Python/data_manager_base.pyste 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/bindings/Boost.Python/data_manager_base.pyste 2005-10-07 00:35:44 UTC (rev 336)
@@ -1,5 +1,5 @@
-Include("data_file.hh")
+Include("cDataFile.h")
-cDataManager_Base = Class("cDataManager_Base", "data_manager_base.hh")
+cDataManager_Base = Class("cDataManager_Base", "cDataManager_Base.h")
# vim: set ft=python:
Modified: trunk/source/bindings/Boost.Python/double_sum.pyste
===================================================================
--- trunk/source/bindings/Boost.Python/double_sum.pyste 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/bindings/Boost.Python/double_sum.pyste 2005-10-07 00:35:44 UTC (rev 336)
@@ -1,4 +1,4 @@
-cDoubleSum = Class("cDoubleSum", "double_sum.hh")
+cDoubleSum = Class("cDoubleSum", "cDoubleSum.h")
# vim: set ft=python:
Modified: trunk/source/bindings/Boost.Python/stats.pyste
===================================================================
--- trunk/source/bindings/Boost.Python/stats.pyste 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/bindings/Boost.Python/stats.pyste 2005-10-07 00:35:44 UTC (rev 336)
@@ -1,5 +1,5 @@
-Include("data_file.hh")
+Include("cDataFile.h")
Include("cGenotype.h")
Include("cInjectGenotype.h")
Modified: trunk/source/main/cAnalyze.cc
===================================================================
--- trunk/source/main/cAnalyze.cc 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/main/cAnalyze.cc 2005-10-07 00:35:44 UTC (rev 336)
@@ -21,7 +21,7 @@
#include "cAnalyzeFunction.h"
#include "cAnalyzeGenotype.h"
#include "cConfig.h"
-#include "data_file.hh"
+#include "cDataFile.h"
#include "cEnvironment.h"
#include "cFitnessMatrix.h"
#include "cGenomeUtil.h"
Modified: trunk/source/main/cAnalyze.h
===================================================================
--- trunk/source/main/cAnalyze.h 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/main/cAnalyze.h 2005-10-07 00:35:44 UTC (rev 336)
@@ -11,7 +11,7 @@
#include <vector>
#ifndef DATA_FILE_MANAGER_HH
-#include "data_file_manager.hh"
+#include "cDataFileManager.h"
#endif
#ifndef GENOTYPE_BATCH_HH
#include "cGenotypeBatch.h"
Modified: trunk/source/main/cGenotype.h
===================================================================
--- trunk/source/main/cGenotype.h 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/main/cGenotype.h 2005-10-07 00:35:44 UTC (rev 336)
@@ -11,7 +11,7 @@
#include <fstream>
#ifndef DOUBLE_SUM_HH
-#include "double_sum.hh"
+#include "cDoubleSum.h"
#endif
#ifndef GENOME_HH
#include "cGenome.h"
Modified: trunk/source/main/cInjectGenebank.cc
===================================================================
--- trunk/source/main/cInjectGenebank.cc 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/main/cInjectGenebank.cc 2005-10-07 00:35:44 UTC (rev 336)
@@ -13,7 +13,7 @@
#include "cConfig.h"
#endif
#ifndef DATA_FILE_HH
-#include "data_file.hh"
+#include "cDataFile.h"
#endif
#ifndef GENOME_HH
#include "cGenome.h"
Modified: trunk/source/main/cPopulation.cc
===================================================================
--- trunk/source/main/cPopulation.cc 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/main/cPopulation.cc 2005-10-07 00:35:44 UTC (rev 336)
@@ -10,7 +10,7 @@
#include "cChangeList.h"
#include "cConfig.h"
#include "cConstSchedule.h"
-#include "data_file.hh"
+#include "cDataFile.h"
#include "cEnvironment.h"
#include "functions.hh"
#include "cGenebank.h"
Modified: trunk/source/main/cStats.cc
===================================================================
--- trunk/source/main/cStats.cc 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/main/cStats.cc 2005-10-07 00:35:44 UTC (rev 336)
@@ -8,7 +8,7 @@
#include "cStats.h"
#include "cConfig.h"
-#include "data_file.hh"
+#include "cDataFile.h"
#include "functions.hh"
#include "string_util.hh"
#include "tDataEntry.hh"
Modified: trunk/source/main/cStats.h
===================================================================
--- trunk/source/main/cStats.h 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/main/cStats.h 2005-10-07 00:35:44 UTC (rev 336)
@@ -16,10 +16,10 @@
#include "defs.hh"
#endif
#ifndef DATA_FILE_MANAGER_HH
-#include "data_file_manager.hh"
+#include "cDataFileManager.h"
#endif
#ifndef DOUBLE_SUM_HH
-#include "double_sum.hh"
+#include "cDoubleSum.h"
#endif
#ifndef FUNCTIONS_HH
#include "functions.hh"
Modified: trunk/source/testsuites/unit_testsuites/data_entry.t.cc
===================================================================
--- trunk/source/testsuites/unit_testsuites/data_entry.t.cc 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/testsuites/unit_testsuites/data_entry.t.cc 2005-10-07 00:35:44 UTC (rev 336)
@@ -1,7 +1,7 @@
#include <iostream>
#ifndef DATA_ENTRY_HH
-#include "data_entry.hh"
+#include "cDataEntry.h"
#endif
#ifndef TEST_CASE_H
#include "third-party/yaktest/cTestCase.hh"
Modified: trunk/source/testsuites/unit_testsuites/data_file.t.cc
===================================================================
--- trunk/source/testsuites/unit_testsuites/data_file.t.cc 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/testsuites/unit_testsuites/data_file.t.cc 2005-10-07 00:35:44 UTC (rev 336)
@@ -1,7 +1,7 @@
#include <iostream>
#ifndef DATA_FILE_HH
-#include "data_file.hh"
+#include "cDataFile.h"
#endif
#ifndef TEST_CASE_H
#include "third-party/yaktest/cTestCase.hh"
Modified: trunk/source/testsuites/unit_testsuites/data_file_manager.t.cc
===================================================================
--- trunk/source/testsuites/unit_testsuites/data_file_manager.t.cc 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/testsuites/unit_testsuites/data_file_manager.t.cc 2005-10-07 00:35:44 UTC (rev 336)
@@ -1,7 +1,7 @@
#include <iostream>
#ifndef DATA_FILE_MANAGER_HH
-#include "data_file_manager.hh"
+#include "cDataFileManager.h"
#endif
#ifndef TEST_CASE_H
#include "third-party/yaktest/cTestCase.hh"
Modified: trunk/source/testsuites/unit_testsuites/data_manager_base.t.cc
===================================================================
--- trunk/source/testsuites/unit_testsuites/data_manager_base.t.cc 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/testsuites/unit_testsuites/data_manager_base.t.cc 2005-10-07 00:35:44 UTC (rev 336)
@@ -1,7 +1,7 @@
#include <iostream>
#ifndef DATA_MANAGER_BASE_HH
-#include "data_manager_base.hh"
+#include "cDataManager_Base.h"
#endif
#ifndef TEST_CASE_H
#include "third-party/yaktest/cTestCase.hh"
Modified: trunk/source/testsuites/unit_testsuites/default_message_display.t.cc
===================================================================
--- trunk/source/testsuites/unit_testsuites/default_message_display.t.cc 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/testsuites/unit_testsuites/default_message_display.t.cc 2005-10-07 00:35:44 UTC (rev 336)
@@ -1,7 +1,7 @@
#include <iostream>
#ifndef DEFAULT_MESSAGE_DISPLAY_HH
-#include "default_message_display.hh"
+#include "cDefaultMessageDisplay.h"
#endif
#ifndef TEST_CASE_H
#include "third-party/yaktest/cTestCase.hh"
Modified: trunk/source/testsuites/unit_testsuites/level_0/double_sum.t.cc
===================================================================
--- trunk/source/testsuites/unit_testsuites/level_0/double_sum.t.cc 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/testsuites/unit_testsuites/level_0/double_sum.t.cc 2005-10-07 00:35:44 UTC (rev 336)
@@ -1,5 +1,5 @@
#ifndef DOUBLE_SUM_HH
-#include "double_sum.hh"
+#include "cDoubleSum.h"
#endif
#ifndef TEST_CASE_H
Modified: trunk/source/tools/CMakeLists.txt
===================================================================
--- trunk/source/tools/CMakeLists.txt 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/tools/CMakeLists.txt 2005-10-07 00:35:44 UTC (rev 336)
@@ -3,12 +3,12 @@
cChangeList.cc
cConstSchedule.cc
cCountTracker.cc
- data_entry.cc
- data_file.cc
- data_file_manager.cc
- data_manager_base.cc
- default_message_display.cc
- double_sum.cc
+ cDataEntry.cc
+ cDataFile.cc
+ cDataFileManager.cc
+ cDataManager_Base.cc
+ cDefaultMessageDisplay.cc
+ cDoubleSum.cc
file.cc
fixed_block.cc
genesis.cc
Copied: trunk/source/tools/cDataEntry.cc (from rev 331, trunk/source/tools/data_entry.cc)
===================================================================
--- trunk/source/tools/data_entry.cc 2005-10-05 23:40:31 UTC (rev 331)
+++ trunk/source/tools/cDataEntry.cc 2005-10-07 00:35:44 UTC (rev 336)
@@ -0,0 +1,17 @@
+//////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 1993 - 2003 California Institute of Technology //
+// //
+// Read the COPYING and README files, or contact 'avida at alife.org', //
+// before continuing. SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE. //
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef DATA_ENTRY_HH
+#include "cDataEntry.h"
+#endif
+
+
+std::ostream & operator << (std::ostream & out, cDataEntry & entry)
+{
+ entry.Print(out);
+ return out;
+}
Copied: trunk/source/tools/cDataEntry.h (from rev 331, trunk/source/tools/data_entry.hh)
Copied: trunk/source/tools/cDataFile.cc (from rev 331, trunk/source/tools/data_file.cc)
===================================================================
--- trunk/source/tools/data_file.cc 2005-10-05 23:40:31 UTC (rev 331)
+++ trunk/source/tools/cDataFile.cc 2005-10-07 00:35:44 UTC (rev 336)
@@ -0,0 +1,145 @@
+//////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 1993 - 2003 California Institute of Technology //
+// //
+// Read the COPYING and README files, or contact 'avida at alife.org', //
+// before continuing. SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE. //
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef DATA_FILE_HH
+#include "cDataFile.h"
+#endif
+
+#ifndef STRING_UTIL_HH
+#include "string_util.hh"
+#endif
+
+extern "C" {
+#include <stdio.h>
+#include <time.h>
+}
+
+using namespace std;
+
+void cDataFile::Init()
+{
+ m_descr_written = false;
+ num_cols = 0;
+}
+
+cDataFile::cDataFile()
+{
+ Init();
+}
+
+cDataFile::cDataFile(cString name) : m_name(name)
+{
+ Init();
+
+ if( fopen(name,"r") ){
+ // cout << "File " << name() << " exists and is being overwritten" << endl;
+ }
+ m_fp.open(name);
+ assert(m_fp.good());
+ m_descr_written = false;
+}
+
+
+void cDataFile::Write( double x, const char * descr )
+{
+ if ( !m_descr_written ){
+ m_data += cStringUtil::Stringf( "%f ", x );
+ WriteColumnDesc(descr);
+ }
+ else m_fp << x << " ";
+}
+
+
+void cDataFile::Write( int i, const char * descr )
+{
+ if ( !m_descr_written ){
+ m_data += cStringUtil::Stringf( "%i ", i );
+ WriteColumnDesc(descr);
+ }
+ else m_fp << i << " ";
+}
+
+
+void cDataFile::Write( const char * data_str, const char * descr )
+{
+ if ( !m_descr_written ) {
+ m_data += cStringUtil::Stringf( "%s ", data_str );
+ WriteColumnDesc(descr);
+ }
+ else m_fp << data_str << " ";
+}
+
+
+void cDataFile::WriteBlockElement(double x, int element, int x_size)
+{
+ m_fp << x << " ";
+ if (((element + 1) % x_size) == 0) {
+ m_fp << "\n";
+ }
+}
+
+void cDataFile::WriteBlockElement(int i, int element, int x_size)
+{
+ m_fp << i << " ";
+ if (((element + 1) % x_size) == 0) {
+ m_fp << "\n";
+ }
+}
+
+void cDataFile::WriteColumnDesc( const char * descr )
+{
+ if ( !m_descr_written ){
+ num_cols++;
+ m_descr += cStringUtil::Stringf( "# %2d: %s\n", num_cols, descr );
+ }
+}
+
+void cDataFile::WriteComment( const char * descr )
+{
+ if ( !m_descr_written ) m_descr += cStringUtil::Stringf( "# %s\n", descr );
+}
+
+
+void cDataFile::WriteRawComment( const char * descr )
+{
+ if ( !m_descr_written ) m_descr += cStringUtil::Stringf( "%s\n", descr );
+}
+
+void cDataFile::WriteRaw( const char * descr )
+{
+ m_fp << cStringUtil::Stringf( "%s\n", descr );
+}
+
+
+
+
+void cDataFile::WriteTimeStamp()
+{
+ if ( !m_descr_written ){
+ time_t time_p = time( 0 );
+ m_descr += cStringUtil::Stringf( "# %s", ctime( &time_p ) );
+ }
+}
+
+void cDataFile::FlushComments()
+{
+ if ( !m_descr_written ){
+ m_fp << m_descr;
+ m_descr_written = true;
+ }
+}
+
+
+void cDataFile::Endl()
+{
+ if ( !m_descr_written ){
+ m_fp << m_descr << endl;
+ m_fp << m_data << endl;
+ m_descr_written = true;
+ }
+ else m_fp << endl;
+}
Copied: trunk/source/tools/cDataFile.h (from rev 331, trunk/source/tools/data_file.hh)
===================================================================
--- trunk/source/tools/data_file.hh 2005-10-05 23:40:31 UTC (rev 331)
+++ trunk/source/tools/cDataFile.h 2005-10-07 00:35:44 UTC (rev 336)
@@ -0,0 +1,158 @@
+//////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 1993 - 2003 California Institute of Technology //
+// //
+// Read the COPYING and README files, or contact 'avida at alife.org', //
+// before continuing. SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE. //
+//////////////////////////////////////////////////////////////////////////////
+
+/* cDataFile.h ****************************************************************
+ cDataFile
+
+ charles at krl.caltech.edu & travc at ugcs.caltech.edu
+ Time-stamp: <1999-01-07 10:02:09 travc>
+
+ cString: basic string class
+******************************************************************************/
+
+#ifndef DATA_FILE_HH
+#define DATA_FILE_HH
+
+#include <fstream>
+
+#ifndef STRING_HH
+#include "string.hh"
+#endif
+
+/**
+ * This class encapsulates file handling for the class @ref cDataFileManager.
+ * The files it creates are write only. Reading of files is handled by
+ * @ref cFile.
+ */
+
+class cString; // aggregate
+
+class cDataFile {
+
+private:
+ cDataFile(const cDataFile &); // not implemented.
+private:
+ cString m_name;
+ cString m_data;
+ cString m_descr;
+ int num_cols;
+
+ bool m_descr_written;
+
+ std::ofstream m_fp;
+
+ void Init();
+public:
+ /**
+ * The empty constructor does nothing.
+ **/
+ cDataFile();
+
+ /**
+ * This constructor opens a file of the given name, and makes sure
+ * the file is usable.
+ *
+ * @param _name The name of the file to open.
+ **/
+ cDataFile(cString name);
+
+ /**
+ * The desctructor automatically closes the file.
+ **/
+ ~cDataFile(){ m_fp.close(); }
+
+ /**
+ * @return The file name used
+ **/
+ const cString & GetName() const { return m_name; }
+
+ /**
+ * @return A bool that indicates whether the file is actually usable.
+ **/
+ bool Good() const { return m_fp.good(); }
+
+ /**
+ * This function allows low-level write access to the file. Although
+ * sometimes usefull, it provides the possibility to circumvent the
+ * automatic documentation. Use with care.
+ *
+ * @return The output stream corresponding to the file.
+ **/
+ std::ofstream & GetOFStream() { return m_fp; }
+
+ /**
+ * Outputs a value into the data file.
+ *
+ * @param x The value to write (as double, int, or char *)
+ *
+ * @param descr A string that describes the meaning of the value. The string
+ * will be written only once, before the first data line has been finished.
+ **/
+
+ void Write( double x, const char * descr );
+ void Write( int i, const char * descr );
+ void Write( const char * data_str, const char * descr );
+ void WriteBlockElement (double x, int element, int x_size );
+ void WriteBlockElement (int i, int element, int x_size );
+
+ /**
+ * Writes a descriptive string into a data file. The string is only
+ * written if the first data line hasn't been completed (Endl() hasn't
+ * been called. This allows to output initial comments into a file.
+ **/
+ void WriteComment( const char * descr );
+
+ /**
+ * Same as WriteComment, but doesn't automatically include the # in the
+ * front of the line. This should only be used in special circumstances
+ * where something outside of a typical comment needs to be at the top.
+ **/
+ void WriteRawComment( const char * descr );
+
+ /**
+ * Writes text string any where in the data file. This should only be used
+ * in special circumstances where something outside of a typical comment
+ * needs to be placed in the file.
+ **/
+ void WriteRaw( const char * descr );
+
+ /**
+ * Writes the description for a single column; keeps track of column numbers.
+ **/
+ void WriteColumnDesc(const char * descr );
+
+ /**
+ * Writes the current time into the data file. The time string is only
+ * written if the first data line hasn't been completed (Endl() hasn't
+ * been called.
+ **/
+ void WriteTimeStamp();
+
+ /**
+ * This function writes the comments that have accumulated. There should
+ * normally be no reason to call this function. Endl() does the same thing
+ * in a safer way.
+ **/
+ void FlushComments();
+
+ /**
+ * Write all data to disk and start a new line.
+ **/
+ void Endl();
+
+ /**
+ * Has the header been written to the file yet?
+ **/
+ bool HeaderDone() { return m_descr_written; }
+
+ /**
+ * This function makes sure that all cached data is written to the disk.
+ **/
+ void Flush(){ m_fp.flush(); }
+};
+
+#endif
Copied: trunk/source/tools/cDataFileManager.cc (from rev 331, trunk/source/tools/data_file_manager.cc)
===================================================================
--- trunk/source/tools/data_file_manager.cc 2005-10-05 23:40:31 UTC (rev 331)
+++ trunk/source/tools/cDataFileManager.cc 2005-10-07 00:35:44 UTC (rev 336)
@@ -0,0 +1,99 @@
+//////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 1993 - 2003 California Institute of Technology //
+// //
+// Read the COPYING and README files, or contact 'avida at alife.org', //
+// before continuing. SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE. //
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef DATA_FILE_MANAGER_HH
+#include "cDataFileManager.h"
+#endif
+
+#ifndef DATA_FILE_HH
+#include "cDataFile.h"
+#endif
+
+using namespace std;
+
+//////////////////////
+// cDataFileManager
+//////////////////////
+
+
+cDataFileManager::~cDataFileManager()
+{
+ while (data_file_list.GetSize()) {
+ delete data_file_list.Pop();
+ }
+}
+
+
+cDataFile * cDataFileManager::InternalFind(const cString & name)
+{
+ tListIterator<cDataFile> list_it(data_file_list);
+ while (list_it.Next() != NULL) {
+ if (list_it.Get()->GetName() == name) return list_it.Get();
+ }
+ return NULL;
+}
+
+
+cDataFile & cDataFileManager::Get(const cString & name)
+{
+ // Find the file by this name...
+ cDataFile * found_file = InternalFind(name);
+
+ // If it hasn't been found, create it...
+ if (found_file == NULL) {
+ found_file = new cDataFile(name);
+ data_file_list.Push(found_file);
+ }
+
+ // Make sure we got the name right...
+ assert( found_file->GetName() == name );
+
+ // and return it.
+ return *found_file;
+}
+
+
+ofstream & cDataFileManager::GetOFStream(const cString & name)
+{
+ // Find the file by this name...
+ cDataFile * found_file = InternalFind(name);
+
+ // If it hasn't been found, create it...
+ if (found_file == NULL) {
+ found_file = new cDataFile(name);
+ data_file_list.Push(found_file);
+ }
+
+ // Make sure we got the name right...
+ assert( found_file->GetName() == name );
+
+ // And return the releven stream...
+ return found_file->GetOFStream();
+}
+
+bool cDataFileManager::IsOpen(const cString & name)
+{
+ if (InternalFind(name) == NULL) return false;
+ return true;
+}
+
+
+void cDataFileManager::FlushAll()
+{
+ tListIterator<cDataFile> list_it(data_file_list);
+ while (list_it.Next() != NULL) list_it.Get()->Flush();
+}
+
+
+bool cDataFileManager::Remove(const cString & name)
+{
+ cDataFile * found_file = InternalFind(name);
+ if (found_file == NULL) return false;
+
+ delete found_file;
+ return true;
+}
Copied: trunk/source/tools/cDataFileManager.h (from rev 331, trunk/source/tools/data_file_manager.hh)
===================================================================
--- trunk/source/tools/data_file_manager.hh 2005-10-05 23:40:31 UTC (rev 331)
+++ trunk/source/tools/cDataFileManager.h 2005-10-07 00:35:44 UTC (rev 336)
@@ -0,0 +1,80 @@
+//////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 1993 - 2003 California Institute of Technology //
+// //
+// Read the COPYING and README files, or contact 'avida at alife.org', //
+// before continuing. SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE. //
+//////////////////////////////////////////////////////////////////////////////
+
+/* cDataFileManager.h ********************************************************
+ cDataFileManager
+
+ charles at krl.caltech.edu & travc at ugcs.caltech.edu
+ Time-stamp: <1999-01-07 10:02:09 travc>
+
+ cString: basic string class
+******************************************************************************/
+
+#ifndef DATA_FILE_MANAGER_HH
+#define DATA_FILE_MANAGER_HH
+
+#include <fstream>
+
+#ifndef TLIST_HH
+#include "tList.hh"
+#endif
+
+/**
+ * This class helps to manage a collection of data files. It is possible
+ * to add files, to remove files, and to access existing files by name.
+ **/
+
+class cDataFile;
+class cString;
+template <class T> class tList; // aggregate
+
+class cDataFileManager {
+private:
+ tList<cDataFile> data_file_list;
+
+ cDataFile * InternalFind(const cString & name);
+
+private:
+ // disabled copy constructor.
+ cDataFileManager(const cDataFileManager &);
+public:
+ cDataFileManager() { ; }
+ ~cDataFileManager();
+
+ /**
+ * Looks up the @ref cDataFile corresponding to the given name. If that
+ * file hasn't been created previously, it is created now.
+ *
+ * @return The @ref cDataFile.
+ * @param name The name of the file to look up/create.
+ **/
+ cDataFile & Get(const cString & name);
+
+ /**
+ * Looks up the ofstream corresponding to the file of the given name.
+ * If that file hasn't been created previously, it is created now.
+ *
+ * Read the cautionary remarks about the function with the same name in
+ * @ref cDataFile.
+ *
+ * @return The ofstream.
+ * @param name The name of the file to look up/create.
+ **/
+ std::ofstream & GetOFStream(const cString & name);
+
+ bool IsOpen(const cString & name);
+
+ void FlushAll();
+
+ /** Removes the given file, thereby closing it.
+ *
+ * @return true if file existed, otherwise false.
+ **/
+ bool Remove(const cString & name);
+};
+
+#endif
Copied: trunk/source/tools/cDataManager_Base.cc (from rev 331, trunk/source/tools/data_manager_base.cc)
===================================================================
--- trunk/source/tools/data_manager_base.cc 2005-10-05 23:40:31 UTC (rev 331)
+++ trunk/source/tools/cDataManager_Base.cc 2005-10-07 00:35:44 UTC (rev 336)
@@ -0,0 +1,81 @@
+//////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 1993 - 2001 California Institute of Technology //
+// //
+// Read the COPYING and README files, or contact 'avida at alife.org', //
+// before continuing. SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE. //
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef DATA_MANAGER_BASE_HH
+#include "cDataManager_Base.h"
+#endif
+
+#include "cDataFile.h"
+
+
+using namespace std;
+
+
+cDataManager_Base::~cDataManager_Base()
+{
+}
+
+
+bool cDataManager_Base::PrintRow(cDataFile & data_file,
+ cString row_entries, char sep)
+{
+ bool result = true;
+
+ row_entries.CompressWhitespace();
+
+ // If we haven't output the header for this file yet, do so.
+ if ( data_file.HeaderDone() == false ) {
+ // Setup the format string for the top...
+ cString format(row_entries);
+ cString out_filetype(filetype);
+
+ // Make sure its space seperated...
+ if (sep != ' ') {
+ int pos = -1;
+ while ( (pos = format.Find(sep)) != -1 ) format[pos] = ' ';
+ }
+
+ // Write out the filetype and format strip
+ out_filetype.Insert("#filetype ");
+ format.Insert("#format ");
+ data_file.WriteRawComment(out_filetype);
+ data_file.WriteRawComment(format);
+
+ // Setup the human-readable description...
+ cString header_entries(row_entries);
+ cString cur_desc;
+ data_file.WriteComment(" ");
+ data_file.WriteComment("Legend:");
+ while (header_entries.GetSize() > 0) {
+ cString cur_entry( header_entries.Pop(sep) );
+ if ( GetDesc(cur_entry, cur_desc) == false ) {
+ result = false;
+ continue;
+ }
+ data_file.WriteColumnDesc(cur_desc);
+ }
+ data_file.FlushComments();
+ data_file.Endl();
+ }
+
+
+ ofstream & fp = data_file.GetOFStream();
+ while (row_entries.GetSize() > 0) {
+ cString cur_entry( row_entries.Pop(sep) );
+ if ( Print(cur_entry, fp) == false ) {
+ cerr << "Data manager unable to find entry '"
+ << cur_entry << "'" << endl;
+ result = false;
+ continue;
+ }
+ fp << " ";
+ }
+ fp << endl;
+
+ return result;
+}
+
Copied: trunk/source/tools/cDataManager_Base.h (from rev 331, trunk/source/tools/data_manager_base.hh)
Copied: trunk/source/tools/cDefaultMessageDisplay.cc (from rev 331, trunk/source/tools/default_message_display.cc)
===================================================================
--- trunk/source/tools/default_message_display.cc 2005-10-05 23:40:31 UTC (rev 331)
+++ trunk/source/tools/cDefaultMessageDisplay.cc 2005-10-07 00:35:44 UTC (rev 336)
@@ -0,0 +1,29 @@
+//////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 1993 - 2003 California Institute of Technology //
+// //
+// Read the COPYING and README files, or contact 'avida at alife.org', //
+// before continuing. SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE. //
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef DEFAULT_MESSAGE_DISPLAY_HH
+#include "cDefaultMessageDisplay.h"
+#endif
+
+#ifndef STRING_HH
+#include "string.hh"
+#endif
+
+using namespace std;
+
+void cDefaultMessageDisplay::out(cString &final_msg)
+{ *_out << final_msg << endl; _out->flush(); }
+
+/*
+default instantiations of cDefaultMessageDisplay...
+*/
+cDefaultMessageDisplay s_info_msg_cout(&cout);
+cDefaultMessageDisplay s_debug_msg_cerr(&cerr);
+cDefaultMessageDisplay s_error_msg_cerr(&cerr);
+cDefaultMessageDisplay s_fatal_msg_cerr(&cerr);
+cDefaultMessageDisplay s_noprefix_msg_cout(&cout);
+
Copied: trunk/source/tools/cDefaultMessageDisplay.h (from rev 331, trunk/source/tools/default_message_display.hh)
Copied: trunk/source/tools/cDoubleSum.cc (from rev 331, trunk/source/tools/double_sum.cc)
===================================================================
--- trunk/source/tools/double_sum.cc 2005-10-05 23:40:31 UTC (rev 331)
+++ trunk/source/tools/cDoubleSum.cc 2005-10-07 00:35:44 UTC (rev 336)
@@ -0,0 +1,14 @@
+//////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 1993 - 2003 California Institute of Technology //
+// //
+// Read the COPYING and README files, or contact 'avida at alife.org', //
+// before continuing. SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE. //
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef DOUBLE_SUM_HH
+#include "cDoubleSum.h"
+#endif
+
+// cDoubleSum ////////////////////////////////////////////////////////////////
+
+const double cDoubleSum::INF_ERR = 0;
Copied: trunk/source/tools/cDoubleSum.h (from rev 331, trunk/source/tools/double_sum.hh)
Deleted: trunk/source/tools/data_entry.cc
===================================================================
--- trunk/source/tools/data_entry.cc 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/tools/data_entry.cc 2005-10-07 00:35:44 UTC (rev 336)
@@ -1,17 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 California Institute of Technology //
-// //
-// Read the COPYING and README files, or contact 'avida at alife.org', //
-// before continuing. SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE. //
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef DATA_ENTRY_HH
-#include "data_entry.hh"
-#endif
-
-
-std::ostream & operator << (std::ostream & out, cDataEntry & entry)
-{
- entry.Print(out);
- return out;
-}
Deleted: trunk/source/tools/data_entry.hh
===================================================================
--- trunk/source/tools/data_entry.hh 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/tools/data_entry.hh 2005-10-07 00:35:44 UTC (rev 336)
@@ -1,43 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 California Institute of Technology //
-// //
-// Read the COPYING and README files, or contact 'avida at alife.org', //
-// before continuing. SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE. //
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef DATA_ENTRY_HH
-#define DATA_ENTRY_HH
-
-#include <iostream>
-
-#ifndef STRING_HH
-#include "string.hh"
-#endif
-
-class cString; // aggregate
-
-class cDataEntry {
-private:
- cString name; // Short Name
- cString desc; // Descriptive Name
- cString null_value; // Value when "off", such as "0", "Inf.", or "N/A"
- cString html_table_flags; // String to include in <td> entry in html mode.
-public:
- cDataEntry(const cString & _name, const cString & _desc,
- const cString & _null="0",
- const cString & _html_cell="align=center")
- : name(_name), desc(_desc), null_value(_null),
- html_table_flags(_html_cell) { ; }
- virtual ~cDataEntry() { ; }
-
- const cString & GetName() const { return name; }
- const cString & GetDesc() const { return desc; }
- const cString & GetNull() const { return null_value; }
- const cString & GetHtmlCellFlags() const { return html_table_flags; }
-
- virtual bool Print(std::ostream & fp) const { (void) fp; return false; }
-};
-
-std::ostream & operator << (std::ostream & out, cDataEntry & entry);
-
-#endif
Deleted: trunk/source/tools/data_file.cc
===================================================================
--- trunk/source/tools/data_file.cc 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/tools/data_file.cc 2005-10-07 00:35:44 UTC (rev 336)
@@ -1,145 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 California Institute of Technology //
-// //
-// Read the COPYING and README files, or contact 'avida at alife.org', //
-// before continuing. SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE. //
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef DATA_FILE_HH
-#include "data_file.hh"
-#endif
-
-#ifndef STRING_UTIL_HH
-#include "string_util.hh"
-#endif
-
-extern "C" {
-#include <stdio.h>
-#include <time.h>
-}
-
-using namespace std;
-
-void cDataFile::Init()
-{
- m_descr_written = false;
- num_cols = 0;
-}
-
-cDataFile::cDataFile()
-{
- Init();
-}
-
-cDataFile::cDataFile(cString name) : m_name(name)
-{
- Init();
-
- if( fopen(name,"r") ){
- // cout << "File " << name() << " exists and is being overwritten" << endl;
- }
- m_fp.open(name);
- assert(m_fp.good());
- m_descr_written = false;
-}
-
-
-void cDataFile::Write( double x, const char * descr )
-{
- if ( !m_descr_written ){
- m_data += cStringUtil::Stringf( "%f ", x );
- WriteColumnDesc(descr);
- }
- else m_fp << x << " ";
-}
-
-
-void cDataFile::Write( int i, const char * descr )
-{
- if ( !m_descr_written ){
- m_data += cStringUtil::Stringf( "%i ", i );
- WriteColumnDesc(descr);
- }
- else m_fp << i << " ";
-}
-
-
-void cDataFile::Write( const char * data_str, const char * descr )
-{
- if ( !m_descr_written ) {
- m_data += cStringUtil::Stringf( "%s ", data_str );
- WriteColumnDesc(descr);
- }
- else m_fp << data_str << " ";
-}
-
-
-void cDataFile::WriteBlockElement(double x, int element, int x_size)
-{
- m_fp << x << " ";
- if (((element + 1) % x_size) == 0) {
- m_fp << "\n";
- }
-}
-
-void cDataFile::WriteBlockElement(int i, int element, int x_size)
-{
- m_fp << i << " ";
- if (((element + 1) % x_size) == 0) {
- m_fp << "\n";
- }
-}
-
-void cDataFile::WriteColumnDesc( const char * descr )
-{
- if ( !m_descr_written ){
- num_cols++;
- m_descr += cStringUtil::Stringf( "# %2d: %s\n", num_cols, descr );
- }
-}
-
-void cDataFile::WriteComment( const char * descr )
-{
- if ( !m_descr_written ) m_descr += cStringUtil::Stringf( "# %s\n", descr );
-}
-
-
-void cDataFile::WriteRawComment( const char * descr )
-{
- if ( !m_descr_written ) m_descr += cStringUtil::Stringf( "%s\n", descr );
-}
-
-void cDataFile::WriteRaw( const char * descr )
-{
- m_fp << cStringUtil::Stringf( "%s\n", descr );
-}
-
-
-
-
-void cDataFile::WriteTimeStamp()
-{
- if ( !m_descr_written ){
- time_t time_p = time( 0 );
- m_descr += cStringUtil::Stringf( "# %s", ctime( &time_p ) );
- }
-}
-
-void cDataFile::FlushComments()
-{
- if ( !m_descr_written ){
- m_fp << m_descr;
- m_descr_written = true;
- }
-}
-
-
-void cDataFile::Endl()
-{
- if ( !m_descr_written ){
- m_fp << m_descr << endl;
- m_fp << m_data << endl;
- m_descr_written = true;
- }
- else m_fp << endl;
-}
Deleted: trunk/source/tools/data_file.hh
===================================================================
--- trunk/source/tools/data_file.hh 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/tools/data_file.hh 2005-10-07 00:35:44 UTC (rev 336)
@@ -1,158 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 California Institute of Technology //
-// //
-// Read the COPYING and README files, or contact 'avida at alife.org', //
-// before continuing. SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE. //
-//////////////////////////////////////////////////////////////////////////////
-
-/* data_file.hh ****************************************************************
- cDataFile
-
- charles at krl.caltech.edu & travc at ugcs.caltech.edu
- Time-stamp: <1999-01-07 10:02:09 travc>
-
- cString: basic string class
-******************************************************************************/
-
-#ifndef DATA_FILE_HH
-#define DATA_FILE_HH
-
-#include <fstream>
-
-#ifndef STRING_HH
-#include "string.hh"
-#endif
-
-/**
- * This class encapsulates file handling for the class @ref cDataFileManager.
- * The files it creates are write only. Reading of files is handled by
- * @ref cFile.
- */
-
-class cString; // aggregate
-
-class cDataFile {
-
-private:
- cDataFile(const cDataFile &); // not implemented.
-private:
- cString m_name;
- cString m_data;
- cString m_descr;
- int num_cols;
-
- bool m_descr_written;
-
- std::ofstream m_fp;
-
- void Init();
-public:
- /**
- * The empty constructor does nothing.
- **/
- cDataFile();
-
- /**
- * This constructor opens a file of the given name, and makes sure
- * the file is usable.
- *
- * @param _name The name of the file to open.
- **/
- cDataFile(cString name);
-
- /**
- * The desctructor automatically closes the file.
- **/
- ~cDataFile(){ m_fp.close(); }
-
- /**
- * @return The file name used
- **/
- const cString & GetName() const { return m_name; }
-
- /**
- * @return A bool that indicates whether the file is actually usable.
- **/
- bool Good() const { return m_fp.good(); }
-
- /**
- * This function allows low-level write access to the file. Although
- * sometimes usefull, it provides the possibility to circumvent the
- * automatic documentation. Use with care.
- *
- * @return The output stream corresponding to the file.
- **/
- std::ofstream & GetOFStream() { return m_fp; }
-
- /**
- * Outputs a value into the data file.
- *
- * @param x The value to write (as double, int, or char *)
- *
- * @param descr A string that describes the meaning of the value. The string
- * will be written only once, before the first data line has been finished.
- **/
-
- void Write( double x, const char * descr );
- void Write( int i, const char * descr );
- void Write( const char * data_str, const char * descr );
- void WriteBlockElement (double x, int element, int x_size );
- void WriteBlockElement (int i, int element, int x_size );
-
- /**
- * Writes a descriptive string into a data file. The string is only
- * written if the first data line hasn't been completed (Endl() hasn't
- * been called. This allows to output initial comments into a file.
- **/
- void WriteComment( const char * descr );
-
- /**
- * Same as WriteComment, but doesn't automatically include the # in the
- * front of the line. This should only be used in special circumstances
- * where something outside of a typical comment needs to be at the top.
- **/
- void WriteRawComment( const char * descr );
-
- /**
- * Writes text string any where in the data file. This should only be used
- * in special circumstances where something outside of a typical comment
- * needs to be placed in the file.
- **/
- void WriteRaw( const char * descr );
-
- /**
- * Writes the description for a single column; keeps track of column numbers.
- **/
- void WriteColumnDesc(const char * descr );
-
- /**
- * Writes the current time into the data file. The time string is only
- * written if the first data line hasn't been completed (Endl() hasn't
- * been called.
- **/
- void WriteTimeStamp();
-
- /**
- * This function writes the comments that have accumulated. There should
- * normally be no reason to call this function. Endl() does the same thing
- * in a safer way.
- **/
- void FlushComments();
-
- /**
- * Write all data to disk and start a new line.
- **/
- void Endl();
-
- /**
- * Has the header been written to the file yet?
- **/
- bool HeaderDone() { return m_descr_written; }
-
- /**
- * This function makes sure that all cached data is written to the disk.
- **/
- void Flush(){ m_fp.flush(); }
-};
-
-#endif
Deleted: trunk/source/tools/data_file_manager.cc
===================================================================
--- trunk/source/tools/data_file_manager.cc 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/tools/data_file_manager.cc 2005-10-07 00:35:44 UTC (rev 336)
@@ -1,99 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 California Institute of Technology //
-// //
-// Read the COPYING and README files, or contact 'avida at alife.org', //
-// before continuing. SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE. //
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef DATA_FILE_MANAGER_HH
-#include "data_file_manager.hh"
-#endif
-
-#ifndef DATA_FILE_HH
-#include "data_file.hh"
-#endif
-
-using namespace std;
-
-//////////////////////
-// cDataFileManager
-//////////////////////
-
-
-cDataFileManager::~cDataFileManager()
-{
- while (data_file_list.GetSize()) {
- delete data_file_list.Pop();
- }
-}
-
-
-cDataFile * cDataFileManager::InternalFind(const cString & name)
-{
- tListIterator<cDataFile> list_it(data_file_list);
- while (list_it.Next() != NULL) {
- if (list_it.Get()->GetName() == name) return list_it.Get();
- }
- return NULL;
-}
-
-
-cDataFile & cDataFileManager::Get(const cString & name)
-{
- // Find the file by this name...
- cDataFile * found_file = InternalFind(name);
-
- // If it hasn't been found, create it...
- if (found_file == NULL) {
- found_file = new cDataFile(name);
- data_file_list.Push(found_file);
- }
-
- // Make sure we got the name right...
- assert( found_file->GetName() == name );
-
- // and return it.
- return *found_file;
-}
-
-
-ofstream & cDataFileManager::GetOFStream(const cString & name)
-{
- // Find the file by this name...
- cDataFile * found_file = InternalFind(name);
-
- // If it hasn't been found, create it...
- if (found_file == NULL) {
- found_file = new cDataFile(name);
- data_file_list.Push(found_file);
- }
-
- // Make sure we got the name right...
- assert( found_file->GetName() == name );
-
- // And return the releven stream...
- return found_file->GetOFStream();
-}
-
-bool cDataFileManager::IsOpen(const cString & name)
-{
- if (InternalFind(name) == NULL) return false;
- return true;
-}
-
-
-void cDataFileManager::FlushAll()
-{
- tListIterator<cDataFile> list_it(data_file_list);
- while (list_it.Next() != NULL) list_it.Get()->Flush();
-}
-
-
-bool cDataFileManager::Remove(const cString & name)
-{
- cDataFile * found_file = InternalFind(name);
- if (found_file == NULL) return false;
-
- delete found_file;
- return true;
-}
Deleted: trunk/source/tools/data_file_manager.hh
===================================================================
--- trunk/source/tools/data_file_manager.hh 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/tools/data_file_manager.hh 2005-10-07 00:35:44 UTC (rev 336)
@@ -1,80 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 California Institute of Technology //
-// //
-// Read the COPYING and README files, or contact 'avida at alife.org', //
-// before continuing. SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE. //
-//////////////////////////////////////////////////////////////////////////////
-
-/* data_file_manager.hh ********************************************************
- cDataFileManager
-
- charles at krl.caltech.edu & travc at ugcs.caltech.edu
- Time-stamp: <1999-01-07 10:02:09 travc>
-
- cString: basic string class
-******************************************************************************/
-
-#ifndef DATA_FILE_MANAGER_HH
-#define DATA_FILE_MANAGER_HH
-
-#include <fstream>
-
-#ifndef TLIST_HH
-#include "tList.hh"
-#endif
-
-/**
- * This class helps to manage a collection of data files. It is possible
- * to add files, to remove files, and to access existing files by name.
- **/
-
-class cDataFile;
-class cString;
-template <class T> class tList; // aggregate
-
-class cDataFileManager {
-private:
- tList<cDataFile> data_file_list;
-
- cDataFile * InternalFind(const cString & name);
-
-private:
- // disabled copy constructor.
- cDataFileManager(const cDataFileManager &);
-public:
- cDataFileManager() { ; }
- ~cDataFileManager();
-
- /**
- * Looks up the @ref cDataFile corresponding to the given name. If that
- * file hasn't been created previously, it is created now.
- *
- * @return The @ref cDataFile.
- * @param name The name of the file to look up/create.
- **/
- cDataFile & Get(const cString & name);
-
- /**
- * Looks up the ofstream corresponding to the file of the given name.
- * If that file hasn't been created previously, it is created now.
- *
- * Read the cautionary remarks about the function with the same name in
- * @ref cDataFile.
- *
- * @return The ofstream.
- * @param name The name of the file to look up/create.
- **/
- std::ofstream & GetOFStream(const cString & name);
-
- bool IsOpen(const cString & name);
-
- void FlushAll();
-
- /** Removes the given file, thereby closing it.
- *
- * @return true if file existed, otherwise false.
- **/
- bool Remove(const cString & name);
-};
-
-#endif
Deleted: trunk/source/tools/data_manager_base.cc
===================================================================
--- trunk/source/tools/data_manager_base.cc 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/tools/data_manager_base.cc 2005-10-07 00:35:44 UTC (rev 336)
@@ -1,81 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2001 California Institute of Technology //
-// //
-// Read the COPYING and README files, or contact 'avida at alife.org', //
-// before continuing. SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE. //
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef DATA_MANAGER_BASE_HH
-#include "data_manager_base.hh"
-#endif
-
-#include "data_file.hh"
-
-
-using namespace std;
-
-
-cDataManager_Base::~cDataManager_Base()
-{
-}
-
-
-bool cDataManager_Base::PrintRow(cDataFile & data_file,
- cString row_entries, char sep)
-{
- bool result = true;
-
- row_entries.CompressWhitespace();
-
- // If we haven't output the header for this file yet, do so.
- if ( data_file.HeaderDone() == false ) {
- // Setup the format string for the top...
- cString format(row_entries);
- cString out_filetype(filetype);
-
- // Make sure its space seperated...
- if (sep != ' ') {
- int pos = -1;
- while ( (pos = format.Find(sep)) != -1 ) format[pos] = ' ';
- }
-
- // Write out the filetype and format strip
- out_filetype.Insert("#filetype ");
- format.Insert("#format ");
- data_file.WriteRawComment(out_filetype);
- data_file.WriteRawComment(format);
-
- // Setup the human-readable description...
- cString header_entries(row_entries);
- cString cur_desc;
- data_file.WriteComment(" ");
- data_file.WriteComment("Legend:");
- while (header_entries.GetSize() > 0) {
- cString cur_entry( header_entries.Pop(sep) );
- if ( GetDesc(cur_entry, cur_desc) == false ) {
- result = false;
- continue;
- }
- data_file.WriteColumnDesc(cur_desc);
- }
- data_file.FlushComments();
- data_file.Endl();
- }
-
-
- ofstream & fp = data_file.GetOFStream();
- while (row_entries.GetSize() > 0) {
- cString cur_entry( row_entries.Pop(sep) );
- if ( Print(cur_entry, fp) == false ) {
- cerr << "Data manager unable to find entry '"
- << cur_entry << "'" << endl;
- result = false;
- continue;
- }
- fp << " ";
- }
- fp << endl;
-
- return result;
-}
-
Deleted: trunk/source/tools/data_manager_base.hh
===================================================================
--- trunk/source/tools/data_manager_base.hh 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/tools/data_manager_base.hh 2005-10-07 00:35:44 UTC (rev 336)
@@ -1,35 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 California Institute of Technology //
-// //
-// Read the COPYING and README files, or contact 'avida at alife.org', //
-// before continuing. SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE. //
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef DATA_MANAGER_BASE_HH
-#define DATA_MANAGER_BASE_HH
-
-#include <iostream>
-
-#ifndef STRING_HH
-#include "string.hh"
-#endif
-
-class cDataFile;
-class cString; // aggregate
-
-class cDataManager_Base {
-private:
- cString filetype;
-public:
- cDataManager_Base(const cString & in_filetype) : filetype(in_filetype) { ; }
- virtual ~cDataManager_Base();
-
- const cString & GetFiletype() const { return filetype; }
-
- virtual bool Print(const cString & name, std::ostream & fp) = 0;
- virtual bool GetDesc(const cString & name, cString & out_desc) = 0;
-
- bool PrintRow(cDataFile & data_file, cString row_entries, char sep=' ');
-};
-
-#endif
Deleted: trunk/source/tools/default_message_display.cc
===================================================================
--- trunk/source/tools/default_message_display.cc 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/tools/default_message_display.cc 2005-10-07 00:35:44 UTC (rev 336)
@@ -1,29 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 California Institute of Technology //
-// //
-// Read the COPYING and README files, or contact 'avida at alife.org', //
-// before continuing. SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE. //
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef DEFAULT_MESSAGE_DISPLAY_HH
-#include "default_message_display.hh"
-#endif
-
-#ifndef STRING_HH
-#include "string.hh"
-#endif
-
-using namespace std;
-
-void cDefaultMessageDisplay::out(cString &final_msg)
-{ *_out << final_msg << endl; _out->flush(); }
-
-/*
-default instantiations of cDefaultMessageDisplay...
-*/
-cDefaultMessageDisplay s_info_msg_cout(&cout);
-cDefaultMessageDisplay s_debug_msg_cerr(&cerr);
-cDefaultMessageDisplay s_error_msg_cerr(&cerr);
-cDefaultMessageDisplay s_fatal_msg_cerr(&cerr);
-cDefaultMessageDisplay s_noprefix_msg_cout(&cout);
-
Deleted: trunk/source/tools/default_message_display.hh
===================================================================
--- trunk/source/tools/default_message_display.hh 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/tools/default_message_display.hh 2005-10-07 00:35:44 UTC (rev 336)
@@ -1,48 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 California Institute of Technology //
-// //
-// Read the COPYING and README files, or contact 'avida at alife.org', //
-// before continuing. SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE. //
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef DEFAULT_MESSAGE_DISPLAY_HH
-#define DEFAULT_MESSAGE_DISPLAY_HH
-
-#include <iostream>
-
-#ifndef MESSAGE_DISPLAY_HH
-#include "message_display.hh"
-#endif
-
-/*
-This subclass of cMessageDisplay just prints to stdout and stderr.
-
-cMessageDisplay displays the message "final_msg" to the user/programmer.
-cMessageDisplay is meant to be subclassed, where
- out(string final_msg)
-is reimplemented to display "final_msg" in the desired manner.
-
-Instances of the subclass may then be passed to
- setStandardOutDisplay(cMessageDisplay &)
-and
- setStandardErrDisplay(cMessageDisplay &)
-with expected results.
-*/
-
-class cString;
-
-class cDefaultMessageDisplay : public cMessageDisplay{
-private:
- std::ostream *_out;
-public:
- cDefaultMessageDisplay(std::ostream *stream):_out(stream){}
- void out(cString &final_msg);
-};
-
-extern cDefaultMessageDisplay s_info_msg_cout;
-extern cDefaultMessageDisplay s_debug_msg_cerr;
-extern cDefaultMessageDisplay s_error_msg_cerr;
-extern cDefaultMessageDisplay s_fatal_msg_cerr;
-extern cDefaultMessageDisplay s_noprefix_msg_cout;
-
-#endif
Deleted: trunk/source/tools/double_sum.cc
===================================================================
--- trunk/source/tools/double_sum.cc 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/tools/double_sum.cc 2005-10-07 00:35:44 UTC (rev 336)
@@ -1,14 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 California Institute of Technology //
-// //
-// Read the COPYING and README files, or contact 'avida at alife.org', //
-// before continuing. SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE. //
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef DOUBLE_SUM_HH
-#include "double_sum.hh"
-#endif
-
-// cDoubleSum ////////////////////////////////////////////////////////////////
-
-const double cDoubleSum::INF_ERR = 0;
Deleted: trunk/source/tools/double_sum.hh
===================================================================
--- trunk/source/tools/double_sum.hh 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/tools/double_sum.hh 2005-10-07 00:35:44 UTC (rev 336)
@@ -1,89 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 California Institute of Technology //
-// //
-// Read the COPYING and README files, or contact 'avida at alife.org', //
-// before continuing. SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE. //
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef DOUBLE_SUM_HH
-#define DOUBLE_SUM_HH
-
-#include <math.h>
-#include <limits.h>
-
-class cDoubleSum {
-private:
- double s1; // Sum (x)
- double s2; // Sum of squares (x^2)
- double s3; // Sum of cubes (x^3)
- double s4; // Sum of x^4
- double n;
-
-public:
- static const double INF_ERR; // Value Returned by StdError if Infinate
-
- cDoubleSum(){ Clear(); }
-
- void Clear(){ s1=0; s2=0; s3=0; s4=0; n=0; }
-
- double Count() const { return n; }
- double N() const { return n; }
- double Sum() const { return s1; }
- double S1() const { return s1; }
- double SumOfSquares() const { return s2; }
- double S2() const { return s2; }
- double SumOfCubes() const { return s3; }
- double S3() const { return s3; }
- double S4() const { return s4; }
-
- double Average() const { return ( n >1 ) ? (s1/n) : 0; }
-
- double Variance() const { return ( n > 1 ) ?
- (s2 - s1*s1/n) / (n-1) : INF_ERR; }
- //n*(s2/n - s1/n*s1/n) / (n-1) : INF_ERR; }
- double StdDeviation() const { return sqrt(Variance()); }
- double StdError() const { return (n > 1) ?
- sqrt(Variance()/n) : INF_ERR; }
-
-// old formula, implemented by TCC, not sure how it relates to
-// the real Standard Error
-// sqrt(s2 / (n * (n-1))) : INF_ERR; }
-
- double Skewness() const { return ( n > 2 ) ?
- (n*s3 - 3*s2*s1 + 2*s1*s1*s1/n) / ((n-1)*(n-2)) : INF_ERR; }
- //n*n*(s3/n - 3*s2/n*s1/n + 2*s1/n*s1/n*s1/n)/((n-1)*(n-2)) : INF_ERR; }
-
- double Kurtosis() const { return ( n > 3 ) ?
- //n*n*(n+1)*(s4/n - 4*s3/n*s1/n + 6*s2/n*s1/n*s1/n -
- //3*s1/n*s1/n*s1/n*s1/n)/((n-1)*(n-2)*(n-3)) :
- (n+1)*(n*s4 - 4*s3*s1 + 6*s2*s1*s1/n - 3*s1*s1*s1/n*s1/n) /
- ((n-1)*(n-2)*(n-3)) :
- INF_ERR; }
-
- // Notation Shortcuts
- double Ave() const { return Average(); }
- double Var() const { return Variance(); }
- double Kur() const { return Kurtosis(); }
- double Skw() const { return Skewness(); }
-
-
- void Add(double value, double weight=1){
- double w_val = value * weight;
- n += weight;
- s1 += w_val;
- s2 += w_val * w_val;
- s3 += w_val * w_val * w_val;
- s4 += w_val * w_val * w_val * w_val;
- }
-
- void Subtract(double value, double weight=1){
- double w_val = value * weight;
- n -= weight;
- s1 -= w_val;
- s2 -= w_val * w_val;
- s3 -= w_val * w_val * w_val;
- s4 -= w_val * w_val * w_val * w_val;
- }
-};
-
-#endif
Modified: trunk/source/tools/message_display_hdrs.hh
===================================================================
--- trunk/source/tools/message_display_hdrs.hh 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/tools/message_display_hdrs.hh 2005-10-07 00:35:44 UTC (rev 336)
@@ -5,7 +5,7 @@
#include <iostream>
#endif
#ifndef DEFAULT_MESSAGE_DISPLAY_HH
-#include "default_message_display.hh"
+#include "cDefaultMessageDisplay.h"
#endif
#ifndef MESSAGE_CLASS_HH
#include "message_class.hh"
Modified: trunk/source/tools/tDataEntryBase.hh
===================================================================
--- trunk/source/tools/tDataEntryBase.hh 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/tools/tDataEntryBase.hh 2005-10-07 00:35:44 UTC (rev 336)
@@ -12,7 +12,7 @@
#include <sstream>
#ifndef DATA_ENTRY_HH
-#include "data_entry.hh"
+#include "cDataEntry.h"
#endif
using namespace std;
Modified: trunk/source/tools/tDataManager.hh
===================================================================
--- trunk/source/tools/tDataManager.hh 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/tools/tDataManager.hh 2005-10-07 00:35:44 UTC (rev 336)
@@ -11,7 +11,7 @@
#include <iostream>
#ifndef DATA_MANAGER_BASE_HH
-#include "data_manager_base.hh"
+#include "cDataManager_Base.h"
#endif
#ifndef TDATAENTRYBASE_HH
#include "tDataEntryBase.hh"
Modified: trunk/source/tools/tools.pri
===================================================================
--- trunk/source/tools/tools.pri 2005-10-07 00:16:06 UTC (rev 335)
+++ trunk/source/tools/tools.pri 2005-10-07 00:35:44 UTC (rev 336)
@@ -2,9 +2,9 @@
tools {
HEADERS += $$TOOLS_HH/indexed_block_struct.hh \
$$TOOLS_HH/cBlockStruct.h \
- $$TOOLS_HH/data_entry.hh \
- $$TOOLS_HH/data_manager_base.hh \
- $$TOOLS_HH/data_file.hh \
+ $$TOOLS_HH/cDataEntry.h \
+ $$TOOLS_HH/cDataManager_Base.h \
+ $$TOOLS_HH/cDataFile.h \
$$TOOLS_HH/file.hh \
$$TOOLS_HH/fixed_block.hh \
$$TOOLS_HH/functions.hh \
@@ -30,12 +30,12 @@
SOURCES += $$TOOLS_CC/cBlockStruct.cc \
$$TOOLS_CC/cConstSchedule.cc \
$$TOOLS_CC/cCountTracker.cc \
- $$TOOLS_CC/data_entry.cc \
- $$TOOLS_CC/data_file.cc \
- $$TOOLS_CC/data_file_manager.cc \
- $$TOOLS_CC/data_manager_base.cc \
- $$TOOLS_CC/default_message_display.cc \
- $$TOOLS_CC/double_sum.cc \
+ $$TOOLS_CC/cDataEntry.cc \
+ $$TOOLS_CC/cDataFile.cc \
+ $$TOOLS_CC/cDataFileManager.cc \
+ $$TOOLS_CC/cDataManager_Base.cc \
+ $$TOOLS_CC/cDefaultMessageDisplay.cc \
+ $$TOOLS_CC/cDoubleSum.cc \
$$TOOLS_CC/file.cc \
$$TOOLS_CC/fixed_block.cc \
$$TOOLS_CC/genesis.cc \
More information about the Avida-cvs
mailing list