ソースを参照

Move iostream library to lib/iostream and includes to include/iostream,
and update r.terraflow to use it - in preparation for introducing
r.viewshed.


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@32509 15284696-431f-4ddb-bdfa-cd5b030d7da7

Paul Kelly 17 年 前
コミット
bb484bec71
52 ファイル変更46 行追加72 行削除
  1. 3 0
      include/Make/Grass.make.in
  2. 0 0
      include/iostream/ami.h
  3. 0 0
      include/iostream/ami_config.h
  4. 0 0
      include/iostream/ami_sort.h
  5. 0 0
      include/iostream/ami_sort_impl.h
  6. 0 0
      include/iostream/ami_stream.h
  7. 0 0
      include/iostream/embuffer.h
  8. 0 0
      include/iostream/empq.h
  9. 0 0
      include/iostream/empq_adaptive.h
  10. 0 0
      include/iostream/empq_adaptive_impl.h
  11. 0 0
      include/iostream/empq_impl.h
  12. 0 0
      include/iostream/imbuffer.h
  13. 0 0
      include/iostream/mem_stream.h
  14. 0 0
      include/iostream/minmaxheap.h
  15. 0 0
      include/iostream/mm.h
  16. 0 0
      include/iostream/mm_utils.h
  17. 0 0
      include/iostream/pqheap.h
  18. 0 0
      include/iostream/queue.h
  19. 0 0
      include/iostream/quicksort.h
  20. 0 0
      include/iostream/replacementHeap.h
  21. 0 0
      include/iostream/replacementHeapBlock.h
  22. 0 0
      include/iostream/rtimer.h
  23. 7 0
      lib/Makefile
  24. 3 6
      raster/r.terraflow/IOStream/lib/src/Makefile
  25. 1 1
      raster/r.terraflow/IOStream/lib/src/ami_stream.cc
  26. 2 2
      raster/r.terraflow/IOStream/lib/src/minmaxheap_test.cc
  27. 1 1
      raster/r.terraflow/IOStream/lib/src/mm.cc
  28. 1 1
      raster/r.terraflow/IOStream/lib/src/mm_utils.cc
  29. 1 1
      raster/r.terraflow/IOStream/lib/src/rtimer.cc
  30. 1 1
      raster/r.terraflow/3scan.h
  31. 0 10
      raster/r.terraflow/IOStream/Makefile
  32. 0 10
      raster/r.terraflow/IOStream/lib/Makefile
  33. 7 20
      raster/r.terraflow/Makefile
  34. 1 1
      raster/r.terraflow/ccforest.h
  35. 1 1
      raster/r.terraflow/common.h
  36. 1 1
      raster/r.terraflow/direction.h
  37. 1 1
      raster/r.terraflow/fill.h
  38. 1 1
      raster/r.terraflow/filldepr.cc
  39. 1 1
      raster/r.terraflow/filldepr.h
  40. 1 1
      raster/r.terraflow/genericWindow.h
  41. 1 1
      raster/r.terraflow/grass2str.h
  42. 1 1
      raster/r.terraflow/grid.h
  43. 1 1
      raster/r.terraflow/nodata.cc
  44. 1 1
      raster/r.terraflow/nodata.h
  45. 1 1
      raster/r.terraflow/plateau.cc
  46. 1 1
      raster/r.terraflow/plateau.h
  47. 1 1
      raster/r.terraflow/sortutils.h
  48. 1 1
      raster/r.terraflow/stats.h
  49. 1 1
      raster/r.terraflow/streamutils.h
  50. 1 1
      raster/r.terraflow/sweep.cc
  51. 1 1
      raster/r.terraflow/sweep.h
  52. 1 1
      raster/r.terraflow/water.cc

+ 3 - 0
include/Make/Grass.make.in

@@ -112,6 +112,7 @@ IBTREE_LIBNAME        = grass_ibtree
 ICON_LIBNAME          = grass_icon
 IMAGERY_LIBNAME       = grass_imagery
 IORTHO_LIBNAME        = grass_Iortho
+IOSTREAM_LIBNAME      = grass_iostream
 ISMAP_LIBNAME         = grass_ismap
 LINKM_LIBNAME         = grass_linkm
 LOCK_LIBNAME          = grass_lock
@@ -209,6 +210,7 @@ IBTREELIB     = -l$(IBTREE_LIBNAME)
 ICONLIB       = -l$(ICON_LIBNAME)
 IMAGERYLIB    = -l$(IMAGERY_LIBNAME) $(GISLIB) 
 IORTHOLIB     = -l$(IORTHO_LIBNAME) $(IMAGERYLIB) $(GISLIB) 
+IOSTREAMLIB   = -l$(IOSTREAM_LIBNAME)
 ISMAPLIB      = -l$(ISMAP_LIBNAME)
 LINKMLIB      = -l$(LINKM_LIBNAME)
 LOCKLIB       = -l$(LOCK_LIBNAME)
@@ -307,6 +309,7 @@ IBTREEDEP   = $(ARCH_LIBDIR)/$(LIB_PREFIX)$(IBTREE_LIBNAME)$(LIB_SUFFIX)
 ICONDEP     = $(ARCH_LIBDIR)/$(LIB_PREFIX)$(ICON_LIBNAME)$(LIB_SUFFIX)
 IMAGERYDEP  = $(ARCH_LIBDIR)/$(LIB_PREFIX)$(IMAGERY_LIBNAME)$(LIB_SUFFIX)
 IORTHODEP   = $(ARCH_LIBDIR)/$(LIB_PREFIX)$(IORTHO_LIBNAME)$(LIB_SUFFIX)
+IOSTREAMDEP = $(ARCH_LIBDIR)/$(LIB_PREFIX)$(IOSTREAM_LIBNAME)$(LIB_SUFFIX)
 LINKMDEP    = $(ARCH_LIBDIR)/$(LIB_PREFIX)$(LINKM_LIBNAME)$(LIB_SUFFIX)
 LOCKDEP     = $(ARCH_LIBDIR)/$(LIB_PREFIX)$(LOCK_LIBNAME)$(LIB_SUFFIX)
 RASTERDEP   = $(ARCH_LIBDIR)/$(LIB_PREFIX)$(RASTER_LIBNAME)$(LIB_SUFFIX)

raster/r.terraflow/IOStream/include/ami.h → include/iostream/ami.h


raster/r.terraflow/IOStream/include/ami_config.h → include/iostream/ami_config.h


raster/r.terraflow/IOStream/include/ami_sort.h → include/iostream/ami_sort.h


raster/r.terraflow/IOStream/include/ami_sort_impl.h → include/iostream/ami_sort_impl.h


raster/r.terraflow/IOStream/include/ami_stream.h → include/iostream/ami_stream.h


raster/r.terraflow/IOStream/include/embuffer.h → include/iostream/embuffer.h


raster/r.terraflow/IOStream/include/empq.h → include/iostream/empq.h


raster/r.terraflow/IOStream/include/empq_adaptive.h → include/iostream/empq_adaptive.h


raster/r.terraflow/IOStream/include/empq_adaptive_impl.h → include/iostream/empq_adaptive_impl.h


raster/r.terraflow/IOStream/include/empq_impl.h → include/iostream/empq_impl.h


raster/r.terraflow/IOStream/include/imbuffer.h → include/iostream/imbuffer.h


raster/r.terraflow/IOStream/include/mem_stream.h → include/iostream/mem_stream.h


raster/r.terraflow/IOStream/include/minmaxheap.h → include/iostream/minmaxheap.h


raster/r.terraflow/IOStream/include/mm.h → include/iostream/mm.h


raster/r.terraflow/IOStream/include/mm_utils.h → include/iostream/mm_utils.h


raster/r.terraflow/IOStream/include/pqheap.h → include/iostream/pqheap.h


raster/r.terraflow/IOStream/include/queue.h → include/iostream/queue.h


raster/r.terraflow/IOStream/include/quicksort.h → include/iostream/quicksort.h


raster/r.terraflow/IOStream/include/replacementHeap.h → include/iostream/replacementHeap.h


raster/r.terraflow/IOStream/include/replacementHeapBlock.h → include/iostream/replacementHeapBlock.h


raster/r.terraflow/IOStream/include/rtimer.h → include/iostream/rtimer.h


+ 7 - 0
lib/Makefile

@@ -53,6 +53,11 @@ ifneq ($(USE_CAIRO),)
     SUBDIRS += cairodriver
 endif
 
+#compile if C++ compiler present:
+ifneq ($(strip $(CXX)),)
+    SUBDIRS += iostream
+endif
+
 #doxygen:
 DOXNAME=grass
 
@@ -66,9 +71,11 @@ headers:
 	if [ ! -d $(GISBASE)/include ]; then $(MKDIR) $(GISBASE)/include; fi
 	if [ ! -d $(GISBASE)/include/grass ]; then $(MKDIR) $(GISBASE)/include/grass; fi
 	if [ ! -d $(GISBASE)/include/grass/vect ]; then $(MKDIR) $(GISBASE)/include/grass/vect; fi
+	if [ ! -d $(GISBASE)/include/grass/iostream ]; then $(MKDIR) $(GISBASE)/include/grass/iostream; fi
 	if [ ! -d $(GISBASE)/include/Make ]; then $(MKDIR) $(GISBASE)/include/Make; fi
 	for file in ../include/*.h ; do $(INSTALL_DATA) $$file $(GISBASE)/include/grass/ ; done
 	for file in ../include/vect/*.h ; do $(INSTALL_DATA) $$file $(GISBASE)/include/grass/vect/ ; done
+	for file in ../include/iostream/*.h ; do $(INSTALL_DATA) $$file $(GISBASE)/include/grass/iostream/ ; done
 	for file in ../include/Make/*.make ; do $(INSTALL_DATA) $$file $(GISBASE)/include/Make/ ; done
 
 clean: cleansubdirs

+ 3 - 6
raster/r.terraflow/IOStream/lib/src/Makefile

@@ -1,15 +1,12 @@
-MODULE_TOPDIR = ../../../../..
+MODULE_TOPDIR = ../..
 
 LIB_OBJS = mm.o mm_utils.o ami_stream.o rtimer.o
-LIB_NAME = iostream
+LIB_NAME = $(IOSTREAM_LIBNAME)
 
 include $(MODULE_TOPDIR)/include/Make/Lib.make
 
-TPIEINC = ../../include
-EXTRA_INC = -I$(TPIEINC)
 ifneq ($(USE_LARGEFILES),)
 	EXTRA_CFLAGS = -D_FILE_OFFSET_BITS=64
 endif
 
-default: stlib
-
+default: lib

+ 1 - 1
raster/r.terraflow/IOStream/lib/src/ami_stream.cc

@@ -26,7 +26,7 @@
 #include <errno.h>
 #include <unistd.h>
 
-#include <ami_stream.h>
+#include <grass/iostream/ami_stream.h>
 
 /**********************************************************************/
 /* creates a random file name, opens the file for reading and writing

+ 2 - 2
raster/r.terraflow/IOStream/lib/src/minmaxheap_test.cc

@@ -16,8 +16,8 @@
  *
  *****************************************************************************/
 
-#include <ami.h>
-#include <minmaxheap.h>
+#include <grass/iostream/ami.h>
+#include <grass/iostream/minmaxheap.h>
 
 #if(0)
 #define TEST_SIZE (1<<20)

+ 1 - 1
raster/r.terraflow/IOStream/lib/src/mm.cc

@@ -24,7 +24,7 @@
 #include <assert.h>
 #include <iostream>
 using namespace std;
-#include <mm.h>
+#include <grass/iostream/mm.h>
 
 #define MM_DEBUG if(0)
 

+ 1 - 1
raster/r.terraflow/IOStream/lib/src/mm_utils.cc

@@ -29,7 +29,7 @@
 using namespace std;
 #include <stdio.h>
 
-#include <mm.h>
+#include <grass/iostream/mm.h>
 
 
 void 

+ 1 - 1
raster/r.terraflow/IOStream/lib/src/rtimer.cc

@@ -22,7 +22,7 @@
 #include <string.h>
 #include <strings.h>
 
-#include <rtimer.h>
+#include <grass/iostream/rtimer.h>
 
 char *
 rt_sprint_safe(char *buf, Rtimer rt) {

+ 1 - 1
raster/r.terraflow/3scan.h

@@ -22,7 +22,7 @@
 #include <iostream>
 using namespace std;
 
-#include <ami.h>
+#include <grass/iostream/ami.h>
 #include "types.h"
 
 

+ 0 - 10
raster/r.terraflow/IOStream/Makefile

@@ -1,10 +0,0 @@
-MODULE_TOPDIR = ../../..
-
-SUBDIRS = lib
-
-include $(MODULE_TOPDIR)/include/Make/Dir.make
-
-default: parsubdirs
-
-clean: cleansubdirs
-

+ 0 - 10
raster/r.terraflow/IOStream/lib/Makefile

@@ -1,10 +0,0 @@
-MODULE_TOPDIR = ../../../..
-
-SUBDIRS = src
-
-include $(MODULE_TOPDIR)/include/Make/Dir.make
-
-default: parsubdirs
-
-clean: cleansubdirs
-

+ 7 - 20
raster/r.terraflow/Makefile

@@ -14,20 +14,11 @@ OBJARCH=OBJ.$(ARCH)
 FLOAT_OBJ := $(patsubst %.cc, $(OBJARCH)/FLOAT/%.o, $(SOURCES))
 SHORT_OBJ := $(patsubst %.cc, $(OBJARCH)/SHORT/%.o, $(SOURCES))
 
-IOSTREAM_LIBNAME = iostream
-IOSTREAM_DIR = IOStream
-IOSTREAM_INC = $(IOSTREAM_DIR)/include
-IOSTREAM_LIB =  -l$(IOSTREAM_LIBNAME)
-IOSTREAM_DEPLIB = $(ARCH_LIBDIR)/$(STLIB_PREFIX)$(IOSTREAM_LIBNAME)$(STLIB_SUFFIX)
-
-CXXFLAGS += -I$(IOSTREAM_INC) \
-		-DUSER=\"$(USER)\" \
+CXXFLAGS += -DUSER=\"$(USER)\" \
 		-DNODATA_FIX -D_FILE_OFFSET_BITS=64
 
-LIBS = $(GISLIB) 
-DEPLIBS = $(DEPGISLIB)
-
-CLEAN_SUBDIRS = $(IOSTREAM_DIR)
+LIBS = $(GISLIB) $(IOSTREAMLIB)
+DEPLIBS = $(GISDEP) $(IOSTREAMDEP)
 
 #Note: 	if a header file is modified, the .o files do not get rebuilt..
 #		header files should be included as prerequisites, but does not work 
@@ -55,14 +46,10 @@ $(OBJARCH)/FLOAT:
 $(OBJARCH)/SHORT:
 	$(MKDIR) $@
 
-$(BIN)/$(PGM)$(EXE): $(FLOAT_OBJ) $(DEPLIBS) $(IOSTREAM_DEPLIB)
+$(BIN)/$(PGM)$(EXE): $(FLOAT_OBJ) $(DEPLIBS)
 	$(CXX) -DELEV_FLOAT $(LDFLAGS) -o $@ $(FLOAT_OBJ) $(LIBS) $(MATHLIB) \
-	$(XDRLIB) $(IOSTREAM_LIB)
+	$(XDRLIB)
 
-$(BIN)/$(PGM).short$(EXE): $(SHORT_OBJ) $(DEPLIBS) $(IOSTREAM_DEPLIB)
+$(BIN)/$(PGM).short$(EXE): $(SHORT_OBJ) $(DEPLIBS)
 	$(CXX) -DELEV_SHORT $(LDFLAGS) -o $@ $(SHORT_OBJ) $(LIBS) $(MATHLIB) \
-	$(XDRLIB) $(IOSTREAM_LIB)
-
-$(IOSTREAM_DEPLIB):
-	$(MAKE) -C $(IOSTREAM_DIR)
-
+	$(XDRLIB)

+ 1 - 1
raster/r.terraflow/ccforest.h

@@ -24,7 +24,7 @@
 #include <iostream>
 using namespace std;
 
-#include <ami.h>
+#include <grass/iostream/ami.h>
 
 
 #define DEBUG_CCFOREST if(0)

+ 1 - 1
raster/r.terraflow/common.h

@@ -24,7 +24,7 @@
 #include <iostream>
 using namespace std;
 
-#include <ami.h>
+#include <grass/iostream/ami.h>
 
 #include "stats.h"
 #include "option.h"

+ 1 - 1
raster/r.terraflow/direction.h

@@ -30,7 +30,7 @@
 
 using namespace std;
 
-#include <ami.h>
+#include <grass/iostream/ami.h>
 
 #include "types.h"
 #include "genericWindow.h"

+ 1 - 1
raster/r.terraflow/fill.h

@@ -19,7 +19,7 @@
 #ifndef _fill_h
 #define _fill_h
 
-#include <ami.h>
+#include <grass/iostream/ami.h>
 #include "common.h"
 #include "water.h"
 

+ 1 - 1
raster/r.terraflow/filldepr.cc

@@ -18,7 +18,7 @@
 
 #include <assert.h>
 
-#include <ami.h>
+#include <grass/iostream/ami.h>
 #include "filldepr.h"
 #include "unionFind.h"
 #include "common.h"

+ 1 - 1
raster/r.terraflow/filldepr.h

@@ -19,7 +19,7 @@
 #ifndef __FILL_DEPR_H
 #define __FILL_DEPR_H
 
-#include <ami.h>
+#include <grass/iostream/ami.h>
 #include "types.h"
 #include "water.h"
 

+ 1 - 1
raster/r.terraflow/genericWindow.h

@@ -21,7 +21,7 @@
 
 #include <stdio.h>
 
-#include <ami.h>
+#include <grass/iostream/ami.h>
 #include "types.h"
 
 

+ 1 - 1
raster/r.terraflow/grass2str.h

@@ -20,7 +20,7 @@
 #ifndef _gras2str_H
 #define _gras2str_H
 
-#include <ami.h>
+#include <grass/iostream/ami.h>
 #include "option.h"
 #include "types.h"
 #include "common.h"

+ 1 - 1
raster/r.terraflow/grid.h

@@ -20,7 +20,7 @@
 #ifndef GRID_H
 #define GRID_H
 
-#include <ami.h>
+#include <grass/iostream/ami.h>
 #include "types.h"
 #include "plateau.h"
 #include "water.h"

+ 1 - 1
raster/r.terraflow/nodata.cc

@@ -16,7 +16,7 @@
  *
  *****************************************************************************/
 
-#include <ami.h> 
+#include <grass/iostream/ami.h> 
 
 #include "nodata.h"
 #include "common.h"

+ 1 - 1
raster/r.terraflow/nodata.h

@@ -22,7 +22,7 @@
 
 #include <assert.h>
 
-#include <ami.h>
+#include <grass/iostream/ami.h>
 #include "types.h"
 #include "option.h"
 

+ 1 - 1
raster/r.terraflow/plateau.cc

@@ -16,7 +16,7 @@
  *
  *****************************************************************************/
 
-#include <ami.h> /* for queue */
+#include <grass/iostream/ami.h> /* for queue */
 
 #include "plateau.h"
 #include "common.h"

+ 1 - 1
raster/r.terraflow/plateau.h

@@ -22,7 +22,7 @@
 
 #include <assert.h>
 
-#include <ami.h>
+#include <grass/iostream/ami.h>
 
 #include "types.h"
 #include "direction.h"

+ 1 - 1
raster/r.terraflow/sortutils.h

@@ -22,7 +22,7 @@
 #include <fstream>
 using namespace std;
 
-#include <ami.h>
+#include <grass/iostream/ami.h>
 #include "common.h"
 
 

+ 1 - 1
raster/r.terraflow/stats.h

@@ -26,7 +26,7 @@
 #include <iostream>
 using namespace std;
 
-#include <ami.h>
+#include <grass/iostream/ami.h>
 
 
 

+ 1 - 1
raster/r.terraflow/streamutils.h

@@ -22,7 +22,7 @@
 #include <fstream>
 using namespace std;
 
-#include <ami.h>
+#include <grass/iostream/ami.h>
 #include "types.h"
 #include "common.h"
 

+ 1 - 1
raster/r.terraflow/sweep.cc

@@ -23,7 +23,7 @@
 #include <unistd.h>
 #include <string.h>
 
-#include <ami.h>
+#include <grass/iostream/ami.h>
 
 #include "option.h"
 #include "stats.h"

+ 1 - 1
raster/r.terraflow/sweep.h

@@ -22,7 +22,7 @@
 
 
 
-#include <ami.h>
+#include <grass/iostream/ami.h>
 
 #include "option.h"
 #include "types.h"

+ 1 - 1
raster/r.terraflow/water.cc

@@ -21,7 +21,7 @@
 #include <iostream>
 using namespace std;
 
-#include <ami.h>
+#include <grass/iostream/ami.h>
 
 
 #include "3scan.h"