diff options
Diffstat (limited to 'docs/tutorials/019')
-rw-r--r-- | docs/tutorials/019/019-client.dsp | 105 | ||||
-rw-r--r-- | docs/tutorials/019/019-client2.dsp | 105 | ||||
-rw-r--r-- | docs/tutorials/019/019-server.dsp | 105 | ||||
-rw-r--r-- | docs/tutorials/019/019-server2.dsp | 105 | ||||
-rw-r--r-- | docs/tutorials/019/Makefile | 79 | ||||
-rw-r--r-- | docs/tutorials/019/client.cpp | 74 | ||||
-rw-r--r-- | docs/tutorials/019/client2.cpp | 47 | ||||
-rw-r--r-- | docs/tutorials/019/combine.shar | 358 | ||||
-rw-r--r-- | docs/tutorials/019/page01.html | 61 | ||||
-rw-r--r-- | docs/tutorials/019/page02.html | 155 | ||||
-rw-r--r-- | docs/tutorials/019/page03.html | 97 | ||||
-rw-r--r-- | docs/tutorials/019/page04.html | 151 | ||||
-rw-r--r-- | docs/tutorials/019/page05.html | 124 | ||||
-rw-r--r-- | docs/tutorials/019/page06.html | 28 | ||||
-rw-r--r-- | docs/tutorials/019/server.cpp | 126 | ||||
-rw-r--r-- | docs/tutorials/019/server2.cpp | 66 | ||||
-rw-r--r-- | docs/tutorials/019/shmem.cpp | 52 | ||||
-rw-r--r-- | docs/tutorials/019/shmem.h | 45 |
18 files changed, 0 insertions, 1883 deletions
diff --git a/docs/tutorials/019/019-client.dsp b/docs/tutorials/019/019-client.dsp deleted file mode 100644 index aae33177cd5..00000000000 --- a/docs/tutorials/019/019-client.dsp +++ /dev/null @@ -1,105 +0,0 @@ -# Microsoft Developer Studio Project File - Name="019 client" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=019 client - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "019 client.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "019 client.mak" CFG="019 client - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "019 client - Win32 Release" (based on\
- "Win32 (x86) Console Application")
-!MESSAGE "019 client - Win32 Debug" (based on\
- "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "019 client - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ace.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\ace"
-
-!ELSEIF "$(CFG)" == "019 client - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 aced.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\ace"
-
-!ENDIF
-
-# Begin Target
-
-# Name "019 client - Win32 Release"
-# Name "019 client - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\client.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\shmem.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\shmem.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/docs/tutorials/019/019-client2.dsp b/docs/tutorials/019/019-client2.dsp deleted file mode 100644 index d1f6e685c92..00000000000 --- a/docs/tutorials/019/019-client2.dsp +++ /dev/null @@ -1,105 +0,0 @@ -# Microsoft Developer Studio Project File - Name="019 client2" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=019 client2 - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "019 client2.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "019 client2.mak" CFG="019 client2 - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "019 client2 - Win32 Release" (based on\
- "Win32 (x86) Console Application")
-!MESSAGE "019 client2 - Win32 Debug" (based on\
- "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "019 client2 - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ace.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\ace"
-
-!ELSEIF "$(CFG)" == "019 client2 - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 aced.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\ace"
-
-!ENDIF
-
-# Begin Target
-
-# Name "019 client2 - Win32 Release"
-# Name "019 client2 - Win32 Debug"
-# Begin Group "Header Files"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\shmem.h
-# End Source File
-# End Group
-# Begin Group "Source Files"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\client2.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\shmem.cpp
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/docs/tutorials/019/019-server.dsp b/docs/tutorials/019/019-server.dsp deleted file mode 100644 index 789431e0ba8..00000000000 --- a/docs/tutorials/019/019-server.dsp +++ /dev/null @@ -1,105 +0,0 @@ -# Microsoft Developer Studio Project File - Name="019 server" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=019 server - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "019 server.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "019 server.mak" CFG="019 server - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "019 server - Win32 Release" (based on\
- "Win32 (x86) Console Application")
-!MESSAGE "019 server - Win32 Debug" (based on\
- "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "019 server - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ace.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\ace"
-
-!ELSEIF "$(CFG)" == "019 server - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 aced.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\ace"
-
-!ENDIF
-
-# Begin Target
-
-# Name "019 server - Win32 Release"
-# Name "019 server - Win32 Debug"
-# Begin Group "Header Files"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\shmem.h
-# End Source File
-# End Group
-# Begin Group "Source Files"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\server.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\shmem.cpp
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/docs/tutorials/019/019-server2.dsp b/docs/tutorials/019/019-server2.dsp deleted file mode 100644 index f3b72b718a6..00000000000 --- a/docs/tutorials/019/019-server2.dsp +++ /dev/null @@ -1,105 +0,0 @@ -# Microsoft Developer Studio Project File - Name="019 server2" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=019 server2 - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "019 server2.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "019 server2.mak" CFG="019 server2 - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "019 server2 - Win32 Release" (based on\
- "Win32 (x86) Console Application")
-!MESSAGE "019 server2 - Win32 Debug" (based on\
- "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "019 server2 - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ace.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\ace"
-
-!ELSEIF "$(CFG)" == "019 server2 - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 aced.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\ace"
-
-!ENDIF
-
-# Begin Target
-
-# Name "019 server2 - Win32 Release"
-# Name "019 server2 - Win32 Debug"
-# Begin Group "Header Files"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\shmem.h
-# End Source File
-# End Group
-# Begin Group "Source Files"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\server2.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\shmem.cpp
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/docs/tutorials/019/Makefile b/docs/tutorials/019/Makefile deleted file mode 100644 index 897c0f8d9ac..00000000000 --- a/docs/tutorials/019/Makefile +++ /dev/null @@ -1,79 +0,0 @@ - -# $Id$ - -#---------------------------------------------------------------------------- -# Local macros -#---------------------------------------------------------------------------- - -BIN = client server client2 server2 - -FILES = shmem - -BUILD = $(VBIN) - -BSRC = $(addsuffix .cpp,$(BIN)) - -SRC += $(addsuffix .cpp,$(FILES)) - -#---------------------------------------------------------------------------- -# Include macros and targets -#---------------------------------------------------------------------------- - -include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU -include $(ACE_ROOT)/include/makeinclude/macros.GNU -include $(ACE_ROOT)/include/makeinclude/rules.common.GNU -include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU -include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU -include $(ACE_ROOT)/include/makeinclude/rules.local.GNU - -#---------------------------------------------------------------------------- -# Local targets -#---------------------------------------------------------------------------- - -rename : # - for i in *.cxx ; do \ - n=`expr "$$i" : "\(.*\).cxx"` ;\ - mv $$i $$n.cpp ;\ - done - -Indent : # - for i in $(SRC) $(HDR) ; do \ - indent -npsl -l80 -fca -fc1 -cli0 -cdb -ts2 -bl -bli0 < $$i | \ - sed -e 's/: :/::/g' \ - -e 's/^.*\(public:\)/\1/' \ - -e 's/^.*\(protected:\)/\1/' \ - -e 's/^.*\(private:\)/\1/' \ - -e 's/:\(public\)/ : \1/' \ - -e 's/:\(protected\)/ : \1/' \ - -e 's/:\(private\)/ : \1/' \ - -e 's/ / /g' \ - > $$i~ ;\ - mv $$i~ $$i ;\ - done - -Depend : # - $(MAKE) SRC="$(SRC) $(BSRC)" depend - perl ../fix.Makefile - -.depend : # - touch .depend - -HTML : # - [ -f hdr ] || $(MAKE) UNSHAR - perl ../combine *.pre - -SHAR : # - [ ! -f combine.shar ] || exit 1 - shar -T hdr bodies *.pre > combine.shar && $(RM) hdr bodies *.pre - -UNSHAR : # - sh combine.shar - -CLEAN : realclean - $(RM) hdr bodies *.pre *.pst .depend - -#---------------------------------------------------------------------------- -# Dependencies -#---------------------------------------------------------------------------- - -include .depend diff --git a/docs/tutorials/019/client.cpp b/docs/tutorials/019/client.cpp deleted file mode 100644 index cf57b8ec2ec..00000000000 --- a/docs/tutorials/019/client.cpp +++ /dev/null @@ -1,74 +0,0 @@ -// $Id$ - -// Again, the common stuff -#include "shmem.h" - -#if defined(ACE_LACKS_SYSV_SHMEM) -int -main (int, char *[]) -{ - ACE_ERROR_RETURN ((LM_ERROR, - "System V Shared Memory not available on this platform\n"), - 100); -} -#else // ACE_LACKS_SYSV_SHMEM -int -main (int, char *[]) -{ - /* - Attach ourselves to the shared memory segment. - */ - ACE_Shared_Memory_SV shm_client (SHM_KEY, SHMSZ); - - /* - Get our reference to the segment... - */ - char *shm = (char *) shm_client.malloc (); - - /* - If the segment identified by SHM_KEY didn't exist then we'll - get back a 0 from malloc(). You should do this check even - if you include the CREATE flag 'cause you never know when it - might fail. - */ - if (shm == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "(%P|%t) Could not get the segment!\n"), - 100); - - /* - Does this match what your server said? - */ - ACE_DEBUG ((LM_INFO, - "(%P|%t) Shared Memory is at 0x%x\n", - shm )); - - /* - Show the shared data to the user and convert it all to - uppper-case along the way. - */ - for (char *s = shm; *s != '\0'; s++) - { - putchar (*s); - *s = toupper(*s); - } - - putchar ('\n'); - - /* - Flag the server that we're done. - */ - *shm = '*'; - - /* - Here, we use close() instead of remove(). Remember, that - will just remove our attachment to the segment. Look - closely at the 'nattch' column of the ipcs output & you'll - see that this decrements it by one. - */ - shm_client.close(); - - return 0; -} - -#endif /* ACE_LACKS_SYSV_SHMEM */ diff --git a/docs/tutorials/019/client2.cpp b/docs/tutorials/019/client2.cpp deleted file mode 100644 index e58d55e32d7..00000000000 --- a/docs/tutorials/019/client2.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// $Id$ - -#include "shmem.h" - -#if defined(ACE_LACKS_SYSV_SHMEM) -int -main (int, char *[]) -{ - ACE_ERROR_RETURN ((LM_ERROR, - "System V Shared Memory not available on this platform\n"), - 100); -} -#else // ACE_LACKS_SYSV_SHMEM -int -main (int, char *[]) -{ - ACE_Shared_Memory_SV shm_client (SHM_KEY, - sizeof (SharedData)); - - char *shm = (char *) shm_client.malloc (); - - ACE_DEBUG ((LM_INFO, - "(%P|%t) Shared Memory is at 0x%x\n", - shm)); - - /* - More placement new. The constructor parameter prevents - clobbering what the server may have written with it's show() - method. - */ - SharedData *sd = new (shm) SharedData (0); - - // Show it - sd->show (); - - // Change it - sd->set (); - - // Advertise it - sd->available (1); - - shm_client.close (); - - return 0; -} - -#endif /* ACE_LACKS_SYSV_SHMEM */ diff --git a/docs/tutorials/019/combine.shar b/docs/tutorials/019/combine.shar deleted file mode 100644 index 321d6243edd..00000000000 --- a/docs/tutorials/019/combine.shar +++ /dev/null @@ -1,358 +0,0 @@ -#!/bin/sh -# This is a shell archive (produced by GNU sharutils 4.2). -# To extract the files from this archive, save it to some FILE, remove -# everything before the `!/bin/sh' line above, then type `sh FILE'. -# -# Made on 1999-09-21 22:49 EDT by <jcej@chiroptera.tragus.org>. -# Source directory was `/home/jcej/projects/ACE_wrappers/docs/tutorials/019'. -# -# Existing files will *not* be overwritten unless `-c' is specified. -# -# This shar contains: -# length mode name -# ------ ---------- ------------------------------------------ -# 409 -rw-rw-r-- hdr -# 71 -rw-rw-r-- bodies -# 2010 -rw-rw-r-- page01.pre -# 563 -rw-rw-r-- page02.pre -# 219 -rw-rw-r-- page03.pre -# 676 -rw-rw-r-- page04.pre -# 178 -rw-rw-r-- page05.pre -# 401 -rw-rw-r-- page06.pre -# -save_IFS="${IFS}" -IFS="${IFS}:" -gettext_dir=FAILED -locale_dir=FAILED -first_param="$1" -for dir in $PATH -do - if test "$gettext_dir" = FAILED && test -f $dir/gettext \ - && ($dir/gettext --version >/dev/null 2>&1) - then - set `$dir/gettext --version 2>&1` - if test "$3" = GNU - then - gettext_dir=$dir - fi - fi - if test "$locale_dir" = FAILED && test -f $dir/shar \ - && ($dir/shar --print-text-domain-dir >/dev/null 2>&1) - then - locale_dir=`$dir/shar --print-text-domain-dir` - fi -done -IFS="$save_IFS" -if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED -then - echo=echo -else - TEXTDOMAINDIR=$locale_dir - export TEXTDOMAINDIR - TEXTDOMAIN=sharutils - export TEXTDOMAIN - echo="$gettext_dir/gettext -s" -fi -touch -am 1231235999 $$.touch >/dev/null 2>&1 -if test ! -f 1231235999 && test -f $$.touch; then - shar_touch=touch -else - shar_touch=: - echo - $echo 'WARNING: not restoring timestamps. Consider getting and' - $echo "installing GNU \`touch', distributed in GNU File Utilities..." - echo -fi -rm -f 1231235999 $$.touch -# -if mkdir _sh05234; then - $echo 'x -' 'creating lock directory' -else - $echo 'failed to create lock directory' - exit 1 -fi -# ============= hdr ============== -if test -f 'hdr' && test "$first_param" != -c; then - $echo 'x -' SKIPPING 'hdr' '(file already exists)' -else - $echo 'x -' extracting 'hdr' '(text)' - sed 's/^X//' << 'SHAR_EOF' > 'hdr' && -<HTML> -<HEAD> -X <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> -X <META NAME="Author" CONTENT="James CE Johnson"> -X <TITLE>ACE Tutorial 019</TITLE> -</HEAD> -<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#000FFF" VLINK="#FF0F0F"> -X -<CENTER><B><FONT SIZE=+2>ACE Tutorial 019</FONT></B></CENTER> -X -<CENTER><B><FONT SIZE=+2>Sharing your Memories</FONT></B></CENTER> -X -<P> -<HR WIDTH="100%"> -SHAR_EOF - $shar_touch -am 1220184898 'hdr' && - chmod 0664 'hdr' || - $echo 'restore of' 'hdr' 'failed' - if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ - && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then - md5sum -c << SHAR_EOF >/dev/null 2>&1 \ - || $echo 'hdr:' 'MD5 check failed' -3b7d0df272c309b4b8d67d872956bae3 hdr -SHAR_EOF - else - shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'hdr'`" - test 409 -eq "$shar_count" || - $echo 'hdr:' 'original size' '409,' 'current size' "$shar_count!" - fi -fi -# ============= bodies ============== -if test -f 'bodies' && test "$first_param" != -c; then - $echo 'x -' SKIPPING 'bodies' '(file already exists)' -else - $echo 'x -' extracting 'bodies' '(text)' - sed 's/^X//' << 'SHAR_EOF' > 'bodies' && -PAGE=2 -server.cpp -client.cpp -server2.cpp client2.cpp -shmem.h shmem.cpp -SHAR_EOF - $shar_touch -am 1228162198 'bodies' && - chmod 0664 'bodies' || - $echo 'restore of' 'bodies' 'failed' - if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ - && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then - md5sum -c << SHAR_EOF >/dev/null 2>&1 \ - || $echo 'bodies:' 'MD5 check failed' -7eebfcd7b463404b494b4c97107f9d14 bodies -SHAR_EOF - else - shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'bodies'`" - test 71 -eq "$shar_count" || - $echo 'bodies:' 'original size' '71,' 'current size' "$shar_count!" - fi -fi -# ============= page01.pre ============== -if test -f 'page01.pre' && test "$first_param" != -c; then - $echo 'x -' SKIPPING 'page01.pre' '(file already exists)' -else - $echo 'x -' extracting 'page01.pre' '(text)' - sed 's/^X//' << 'SHAR_EOF' > 'page01.pre' && -X Did you ever wish you could read someone's mind? Or that they could -X read yours? -X <p> -X Well, we won't be doing that here but we'll try to get close by -X letting your code do something similar: Shared Memory. -X <p> -X What we're going to do is ask the operating system to set -X aside a part of RAM that we can share with another process. By -X doing this, we can allow our applications to swap data very -X efficiently. -X <p> -X Along the way, we'll have to come up with some sort of -X coordination betweent the processes. That is the most -X difficult part of a shared memory system. In the tutorial we're -X just going to take a simplistic approach (eg -- busy loop) but -X real-world applications will need to take a serious look at -X process-level synch mechanisms such as ACE_*_Semaphore. -X <P> -X Caveat: I've barely begun to use shared memory -X myself. This tutorial and the next are very simple-minded and -X primitive. Anyone who wants to provide more realistic -X replacements is encouraged to drop me a note -X (<A HREF="mailto:jcej@lads.com">jcej@lads.com</A>). -<P> -A tutorial wouldn't be complete without Kirthika's abstract: -<UL> -This tutorial shows how to use memory as a shared resource between the -client and server processes. ACE_Shared_Memory_SV has been used for -creating -the shared memory segment. Two different approaches have been used. One -uses the malloc () method to allocate memory while the other uses the -placement new expression (C++) of allocating a memory chunk in advance -and using it on demand. -<P> -The server has a string of alphabets from a-z which are converted to -uppercase -by the client proving that the same memory locations are being shared -between -the two processes. The syncronisation between the server and client is -done -using the ACE_OS::sleep () instead of a semaphore/mutexes with the aim -of keeping our first dive into shared memory usage simple and easy to -fathom. -</UL> -SHAR_EOF - $shar_touch -am 0403170299 'page01.pre' && - chmod 0664 'page01.pre' || - $echo 'restore of' 'page01.pre' 'failed' - if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ - && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then - md5sum -c << SHAR_EOF >/dev/null 2>&1 \ - || $echo 'page01.pre:' 'MD5 check failed' -5679e782c6b5d10a12a894cee1d88bc0 page01.pre -SHAR_EOF - else - shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page01.pre'`" - test 2010 -eq "$shar_count" || - $echo 'page01.pre:' 'original size' '2010,' 'current size' "$shar_count!" - fi -fi -# ============= page02.pre ============== -if test -f 'page02.pre' && test "$first_param" != -c; then - $echo 'x -' SKIPPING 'page02.pre' '(file already exists)' -else - $echo 'x -' extracting 'page02.pre' '(text)' - sed 's/^X//' << 'SHAR_EOF' > 'page02.pre' && -We'll first take a look at the server side. As usual with -co-operating applications, you need the server up and running first. -In the case of shared memory applications, the server will create the -shared memory segment. In this example, it will also remove the -segment when done. It is important to realize though that the segment -can be created external to your application and can persist beyond -it's lifetime. In fact, you can use shared memory to create a layer -of persistence between application instances (at least, until the -machine comes down.) -<HR> -SHAR_EOF - $shar_touch -am 0403170299 'page02.pre' && - chmod 0664 'page02.pre' || - $echo 'restore of' 'page02.pre' 'failed' - if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ - && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then - md5sum -c << SHAR_EOF >/dev/null 2>&1 \ - || $echo 'page02.pre:' 'MD5 check failed' -e6c9fee2eb20324a2f0504fb1c687ddd page02.pre -SHAR_EOF - else - shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page02.pre'`" - test 563 -eq "$shar_count" || - $echo 'page02.pre:' 'original size' '563,' 'current size' "$shar_count!" - fi -fi -# ============= page03.pre ============== -if test -f 'page03.pre' && test "$first_param" != -c; then - $echo 'x -' SKIPPING 'page03.pre' '(file already exists)' -else - $echo 'x -' extracting 'page03.pre' '(text)' - sed 's/^X//' << 'SHAR_EOF' > 'page03.pre' && -The client app looks much like the server. We could have included the -CREATE flag with no ill effects but note the use of close() instead of -remove(). Picking the correct detachment method is rather important! -<HR> -SHAR_EOF - $shar_touch -am 1228160398 'page03.pre' && - chmod 0664 'page03.pre' || - $echo 'restore of' 'page03.pre' 'failed' - if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ - && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then - md5sum -c << SHAR_EOF >/dev/null 2>&1 \ - || $echo 'page03.pre:' 'MD5 check failed' -d7658702d31436f5124bf4dbec330e69 page03.pre -SHAR_EOF - else - shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page03.pre'`" - test 219 -eq "$shar_count" || - $echo 'page03.pre:' 'original size' '219,' 'current size' "$shar_count!" - fi -fi -# ============= page04.pre ============== -if test -f 'page04.pre' && test "$first_param" != -c; then - $echo 'x -' SKIPPING 'page04.pre' '(file already exists)' -else - $echo 'x -' extracting 'page04.pre' '(text)' - sed 's/^X//' << 'SHAR_EOF' > 'page04.pre' && -X Before we move on to shmem.h, I want to show a different approach. In -X this new client/server pair, I use placement new to stuff an object -X (instead of a blob of bytes) into the shared memory segment. -X <P> -X There are a few caveats to putting objects into shared memory. The -X most important ones all deal with pointers: -X <ul> -X <li>Be sure your pointers point into the shared memory and not -X local process memory. -X <li>Only in very special cases will objects with virtual methods -X work (because of the VTable pointers). -X </ul> -<P> -That's not to say you shouldn't try... Just try carefully and test a lot! -X <HR> -SHAR_EOF - $shar_touch -am 1228160798 'page04.pre' && - chmod 0664 'page04.pre' || - $echo 'restore of' 'page04.pre' 'failed' - if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ - && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then - md5sum -c << SHAR_EOF >/dev/null 2>&1 \ - || $echo 'page04.pre:' 'MD5 check failed' -f34318496f39858e4ddadebe5647dfd2 page04.pre -SHAR_EOF - else - shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page04.pre'`" - test 676 -eq "$shar_count" || - $echo 'page04.pre:' 'original size' '676,' 'current size' "$shar_count!" - fi -fi -# ============= page05.pre ============== -if test -f 'page05.pre' && test "$first_param" != -c; then - $echo 'x -' SKIPPING 'page05.pre' '(file already exists)' -else - $echo 'x -' extracting 'page05.pre' '(text)' - sed 's/^X//' << 'SHAR_EOF' > 'page05.pre' && -X Here's the mysterious shmem.h. I wanted to show it after the -X placement-new client and server so that the SharedData object -X would have some relevance. -X <HR> -SHAR_EOF - $shar_touch -am 1228162198 'page05.pre' && - chmod 0664 'page05.pre' || - $echo 'restore of' 'page05.pre' 'failed' - if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ - && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then - md5sum -c << SHAR_EOF >/dev/null 2>&1 \ - || $echo 'page05.pre:' 'MD5 check failed' -42f4ddae6f0ce1583d1dc03d5e485cba page05.pre -SHAR_EOF - else - shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page05.pre'`" - test 178 -eq "$shar_count" || - $echo 'page05.pre:' 'original size' '178,' 'current size' "$shar_count!" - fi -fi -# ============= page06.pre ============== -if test -f 'page06.pre' && test "$first_param" != -c; then - $echo 'x -' SKIPPING 'page06.pre' '(file already exists)' -else - $echo 'x -' extracting 'page06.pre' '(text)' - sed 's/^X//' << 'SHAR_EOF' > 'page06.pre' && -X That's it! I warned you that this one was pretty primitive. -X -X <ul> -X <li><A HREF="server.cpp">server.cpp</A> -X <li><A HREF="client.cpp">client.cpp</A> -X <li><A HREF="server2.cpp">server2.cpp</A> -X <li><A HREF="client2.cpp">client2.cpp</A> -X <li><A HREF="shmem.h">shmem.h</A> -X <li><A HREF="shmem.cpp">shmem.cpp</A> -X <li><A HREF="Makefile">Makefile</A> -X </ul> -SHAR_EOF - $shar_touch -am 1228162998 'page06.pre' && - chmod 0664 'page06.pre' || - $echo 'restore of' 'page06.pre' 'failed' - if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ - && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then - md5sum -c << SHAR_EOF >/dev/null 2>&1 \ - || $echo 'page06.pre:' 'MD5 check failed' -6e3002889733f5e80e7f9cc945965955 page06.pre -SHAR_EOF - else - shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page06.pre'`" - test 401 -eq "$shar_count" || - $echo 'page06.pre:' 'original size' '401,' 'current size' "$shar_count!" - fi -fi -rm -fr _sh05234 -exit 0 diff --git a/docs/tutorials/019/page01.html b/docs/tutorials/019/page01.html deleted file mode 100644 index 21cc0af6beb..00000000000 --- a/docs/tutorials/019/page01.html +++ /dev/null @@ -1,61 +0,0 @@ -<!-- $Id$ --> -<HTML> -<HEAD> - <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> - <META NAME="Author" CONTENT="James CE Johnson"> - <TITLE>ACE Tutorial 019</TITLE> -</HEAD> -<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#000FFF" VLINK="#FF0F0F"> - -<CENTER><B><FONT SIZE=+2>ACE Tutorial 019</FONT></B></CENTER> - -<CENTER><B><FONT SIZE=+2>Sharing your Memories</FONT></B></CENTER> - -<P> -<HR WIDTH="100%"> - Did you ever wish you could read someone's mind? Or that they could - read yours? - <p> - Well, we won't be doing that here but we'll try to get close by - letting your code do something similar: Shared Memory. - <p> - What we're going to do is ask the operating system to set - aside a part of RAM that we can share with another process. By - doing this, we can allow our applications to swap data very - efficiently. - <p> - Along the way, we'll have to come up with some sort of - coordination betweent the processes. That is the most - difficult part of a shared memory system. In the tutorial we're - just going to take a simplistic approach (eg -- busy loop) but - real-world applications will need to take a serious look at - process-level synch mechanisms such as ACE_*_Semaphore. - <P> - Caveat: I've barely begun to use shared memory - myself. This tutorial and the next are very simple-minded and - primitive. Anyone who wants to provide more realistic - replacements is encouraged to drop me a note - (<A HREF="mailto:jcej@lads.com">jcej@lads.com</A>). -<P> -A tutorial wouldn't be complete without Kirthika's abstract: -<UL> -This tutorial shows how to use memory as a shared resource between the -client and server processes. ACE_Shared_Memory_SV has been used for -creating -the shared memory segment. Two different approaches have been used. One -uses the malloc () method to allocate memory while the other uses the -placement new expression (C++) of allocating a memory chunk in advance -and using it on demand. -<P> -The server has a string of alphabets from a-z which are converted to -uppercase -by the client proving that the same memory locations are being shared -between -the two processes. The syncronisation between the server and client is -done -using the ACE_OS::sleep () instead of a semaphore/mutexes with the aim -of keeping our first dive into shared memory usage simple and easy to -fathom. -</UL> -<P><HR WIDTH="100%"> -<CENTER>[<A HREF="../online-tutorials.html">Tutorial Index</A>] [<A HREF="page02.html">Continue This Tutorial</A>]</CENTER> diff --git a/docs/tutorials/019/page02.html b/docs/tutorials/019/page02.html deleted file mode 100644 index 54af4e801f4..00000000000 --- a/docs/tutorials/019/page02.html +++ /dev/null @@ -1,155 +0,0 @@ -<!-- $Id$ --> -<HTML> -<HEAD> - <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> - <META NAME="Author" CONTENT="James CE Johnson"> - <TITLE>ACE Tutorial 019</TITLE> -</HEAD> -<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#000FFF" VLINK="#FF0F0F"> - -<CENTER><B><FONT SIZE=+2>ACE Tutorial 019</FONT></B></CENTER> - -<CENTER><B><FONT SIZE=+2>Sharing your Memories</FONT></B></CENTER> - -<P> -<HR WIDTH="100%"> -We'll first take a look at the server side. As usual with -co-operating applications, you need the server up and running first. -In the case of shared memory applications, the server will create the -shared memory segment. In this example, it will also remove the -segment when done. It is important to realize though that the segment -can be created external to your application and can persist beyond -it's lifetime. In fact, you can use shared memory to create a layer -of persistence between application instances (at least, until the -machine comes down.) -<HR> -<PRE> -<font color=red>// $Id$</font> - -<font color=red>/* - The client and server both need to know the shared memory key and - size. To prevent headaches, I've put those into a header they both - can share. - */</font> -<font color=blue>#include</font> "<font color=green>shmem.h</font>" - -<font color=blue>#if defined</font> (<font color=purple>ACE_LACKS_SYSV_SHMEM</font>) -int -main (int, char *[]) -{ - ACE_ERROR_RETURN ((LM_ERROR, - "<font color=green>System V Shared Memory not available on this platform\n</font>"), - 100); -} -#else <font color=red>// ACE_LACKS_SYSV_SHMEM</font> -int -main (int, char *argv[]) -{ - <font color=red>/* - You can use the ACE_Malloc template to create memory pools - from various shared memory strategies. It's really cool. - We're not going to use it. - - Instead, I want to get to the roots of it all and directly - use ACE_Shared_Memory_SV. Like many ACE objects, this is a - wrapper around OS services. - - With this constructor we create a shared memory area to - use. The ACE_CREATE flag will cause it to be created if it - doesn't already exist. The SHM_KEY value (from shmem.h) - uniquely identifies the segment and allows other apps to - attach to the same segment. Execute 'ipcs -m' before and - after starting this app to see that the segment is created. - (I can't for the life of me correlate the SHM_KEY value back - to the key/id reported by ipcs though.) - */</font> - ACE_Shared_Memory_SV shm_server (SHM_KEY, SHMSZ, - <font color=#008888>ACE_Shared_Memory_SV::ACE_CREATE</font>); - - <font color=red>/* - The constructor created the segment for us but we still need - to map the segment into our address space. (Note that you - can pass a value to malloc() but it will be silently - igored.) The void* (cast to char*) that is returned will - point to the beginning of the shared segment. - */</font> - char *shm = (char *) shm_server.malloc (); - - <font color=red>/* - Since we're asking to create the segment, we will fail if it - already exists. We could fall back and simply attach to it - like the client but I'd rather not assume it was a previous - instance of this app that left the segment around. - */</font> - if (shm == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "<font color=green>%p\n\t(%P|%t) Cannot create shared memory segment.\n</font>" - "<font color=green>\tUse 'ipcs' to see if it already exists\n</font>", - argv[0]), - 100); - - <font color=red>/* - This second pointer will be used to walk through the block - of memory... - */</font> - char *s = shm; - - <font color=red>/* - Out of curiosity, I added this output message. The tests - I've done so far show me the same address for client and - server. What does your OS tell you? - */</font> - ACE_DEBUG ((LM_INFO, - "<font color=green>(%P|%t) Shared Memory is at 0x%x\n</font>", - shm )); - - <font color=red>/* - At this point, our application can use the pointer just like - any other given to us by new or malloc. For our purposes, - we'll copy in the alpabet as a null-terminated string. - */</font> - for (char c = 'a'; c <= 'z'; c++) - *s++ = c; - - *s = '\0'; - - <font color=red>/* - Using a simple not-too-busy loop, we'll wait for the client - (or anyone else) to change the first byte in the shared area - to a '*' character. This is where you would rather use - semaphores or some similar "<font color=green>resource light</font>" approach. - */</font> - while (*shm != '*') - <font color=#008888>ACE_OS::sleep</font> (1); - - <font color=red>/* - Let's see what the client did to the segment... - */</font> - for (s = shm; *s != '\0'; s++) - putchar (*s); - - putchar ('\n'); - - <font color=red>/* - If you're done with the segment and ready for it to be - removed from the system, use the remove() method. Once the - program exits, do 'ipcs -m' again and you'll see that the - segment is gone. If you just want to terminate your use of - the segment but leave it around for other apps, use the - close() method instead. - - The free() method may be tempting but it doesn't actually do - anything. If your app is *really* done with the shared - memory then use either close() or remove(). - */</font> - if (shm_server.remove () < 0) - ACE_ERROR ((LM_ERROR, - "<font color=green>%p\n</font>", - "<font color=green>remove</font>")); - return 0; -} - -<font color=blue>#endif</font> <font color=red>/* ACE_LACKS_SYSV_SHMEM */</font> -</PRE> -<P><HR WIDTH="100%"> -<CENTER>[<A HREF="../online-tutorials.html">Tutorial Index</A>] [<A HREF="page03.html">Continue This Tutorial</A>]</CENTER> diff --git a/docs/tutorials/019/page03.html b/docs/tutorials/019/page03.html deleted file mode 100644 index 5b35f19c8dd..00000000000 --- a/docs/tutorials/019/page03.html +++ /dev/null @@ -1,97 +0,0 @@ -<!-- $Id$ --> -<HTML> -<HEAD> - <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> - <META NAME="Author" CONTENT="James CE Johnson"> - <TITLE>ACE Tutorial 019</TITLE> -</HEAD> -<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#000FFF" VLINK="#FF0F0F"> - -<CENTER><B><FONT SIZE=+2>ACE Tutorial 019</FONT></B></CENTER> - -<CENTER><B><FONT SIZE=+2>Sharing your Memories</FONT></B></CENTER> - -<P> -<HR WIDTH="100%"> -The client app looks much like the server. We could have included the -CREATE flag with no ill effects but note the use of close() instead of -remove(). Picking the correct detachment method is rather important! -<HR> -<PRE> -<font color=red>// $Id$</font> - -<font color=red>// Again, the common stuff</font> -<font color=blue>#include</font> "<font color=green>shmem.h</font>" - -<font color=blue>#if defined</font>(<font color=purple>ACE_LACKS_SYSV_SHMEM</font>) -int -main (int, char *[]) -{ - ACE_ERROR_RETURN ((LM_ERROR, - "<font color=green>System V Shared Memory not available on this platform\n</font>"), - 100); -} -#else <font color=red>// ACE_LACKS_SYSV_SHMEM</font> -int -main (int, char *[]) -{ - <font color=red>/* - Attach ourselves to the shared memory segment. - */</font> - ACE_Shared_Memory_SV shm_client (SHM_KEY, SHMSZ); - - <font color=red>/* - Get our reference to the segment... - */</font> - char *shm = (char *) shm_client.malloc (); - - <font color=red>/* - If the segment identified by SHM_KEY didn't exist then we'll - get back a 0 from malloc(). You should do this check even - if you include the CREATE flag 'cause you never know when it - might fail. - */</font> - if (shm == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "<font color=green>(%P|%t) Could not get the segment!\n</font>"), - 100); - - <font color=red>/* - Does this match what your server said? - */</font> - ACE_DEBUG ((LM_INFO, - "<font color=green>(%P|%t) Shared Memory is at 0x%x\n</font>", - shm )); - - <font color=red>/* - Show the shared data to the user and convert it all to - uppper-case along the way. - */</font> - for (char *s = shm; *s != '\0'; s++) - { - putchar (*s); - *s = toupper(*s); - } - - putchar ('\n'); - - <font color=red>/* - Flag the server that we're done. - */</font> - *shm = '*'; - - <font color=red>/* - Here, we use close() instead of remove(). Remember, that - will just remove our attachment to the segment. Look - closely at the 'nattch' column of the ipcs output & you'll - see that this decrements it by one. - */</font> - shm_client.close(); - - return 0; -} - -<font color=blue>#endif</font> <font color=red>/* ACE_LACKS_SYSV_SHMEM */</font> -</PRE> -<P><HR WIDTH="100%"> -<CENTER>[<A HREF="../online-tutorials.html">Tutorial Index</A>] [<A HREF="page04.html">Continue This Tutorial</A>]</CENTER> diff --git a/docs/tutorials/019/page04.html b/docs/tutorials/019/page04.html deleted file mode 100644 index de471e1ac08..00000000000 --- a/docs/tutorials/019/page04.html +++ /dev/null @@ -1,151 +0,0 @@ -<!-- $Id$ --> -<HTML> -<HEAD> - <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> - <META NAME="Author" CONTENT="James CE Johnson"> - <TITLE>ACE Tutorial 019</TITLE> -</HEAD> -<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#000FFF" VLINK="#FF0F0F"> - -<CENTER><B><FONT SIZE=+2>ACE Tutorial 019</FONT></B></CENTER> - -<CENTER><B><FONT SIZE=+2>Sharing your Memories</FONT></B></CENTER> - -<P> -<HR WIDTH="100%"> - Before we move on to shmem.h, I want to show a different approach. In - this new client/server pair, I use placement new to stuff an object - (instead of a blob of bytes) into the shared memory segment. - <P> - There are a few caveats to putting objects into shared memory. The - most important ones all deal with pointers: - <ul> - <li>Be sure your pointers point into the shared memory and not - local process memory. - <li>Only in very special cases will objects with virtual methods - work (because of the VTable pointers). - </ul> -<P> -That's not to say you shouldn't try... Just try carefully and test a lot! - <HR> -<HR width=50%><P><center>server2.cpp</center><HR width=50%> -<PRE> -<font color=red>// $Id$</font> - -<font color=blue>#include</font> "<font color=green>shmem.h</font>" - -<font color=blue>#if defined</font> (<font color=purple>ACE_LACKS_SYSV_SHMEM</font>) -int -main (int, char *[]) -{ - ACE_ERROR_RETURN ((LM_ERROR, - "<font color=green>System V Shared Memory not available on this platform\n</font>"), - 100); -} -#else <font color=red>// ACE_LACKS_SYSV_SHMEM</font> -int -main (int, char *argv[]) -{ - <font color=red>// Be sure the segment is sized to hold our object.</font> - ACE_Shared_Memory_SV shm_server (SHM_KEY, - sizeof (SharedData), - <font color=#008888>ACE_Shared_Memory_SV::ACE_CREATE</font>); - char *shm = (char *) shm_server.malloc (); - - if (shm == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "<font color=green>%p\n\t(%P|%t) Cannot create shared memory segment.\n</font>" - "<font color=green>\tUse 'ipcs' to see if it already exists\n</font>", - argv[0]), - 100); - - ACE_DEBUG ((LM_INFO, - "<font color=green>(%P|%t) Shared Memory is at 0x%x\n</font>", - shm )); - - <font color=red>/* - Use the placement new syntax to stuff the object into the - correct location. I think they generally reserve this for - the advanced class... - */</font> - SharedData *sd = new (shm) SharedData; - - <font color=red>// Use the set() method to put some data into the object</font> - sd->set (); - - <font color=red>// Set the 'available' flag to zero so that we can wait on it</font> - sd->available (0); - - <font color=red>/* - Another cheesy busy loop while we wait for the object to - become available. The cool way would be to hide a semaphore - or two behind this method call & eliminate the sleep. - */</font> - while (sd->available () == 0) - <font color=#008888>ACE_OS::sleep</font> (1); - - <font color=red>// Show the user what's in the segment</font> - sd->show (); - - <font color=red>// All done.</font> - if (shm_server.remove () < 0) - ACE_ERROR ((LM_ERROR, - "<font color=green>%p\n</font>", - "<font color=green>remove</font>")); - return 0; -} - -<font color=blue>#endif</font> <font color=red>/* ACE_LACKS_SYSV_SHMEM */</font> -</PRE> -<HR width=50%><P><center>client2.cpp</center><HR width=50%> -<PRE> -<font color=red>// $Id$</font> - -<font color=blue>#include</font> "<font color=green>shmem.h</font>" - -<font color=blue>#if defined</font>(<font color=purple>ACE_LACKS_SYSV_SHMEM</font>) -int -main (int, char *[]) -{ - ACE_ERROR_RETURN ((LM_ERROR, - "<font color=green>System V Shared Memory not available on this platform\n</font>"), - 100); -} -#else <font color=red>// ACE_LACKS_SYSV_SHMEM</font> -int -main (int, char *[]) -{ - ACE_Shared_Memory_SV shm_client (SHM_KEY, - sizeof (SharedData)); - - char *shm = (char *) shm_client.malloc (); - - ACE_DEBUG ((LM_INFO, - "<font color=green>(%P|%t) Shared Memory is at 0x%x\n</font>", - shm)); - - <font color=red>/* - More placement new. The constructor parameter prevents - clobbering what the server may have written with it's show() - method. - */</font> - SharedData *sd = new (shm) SharedData (0); - - <font color=red>// Show it</font> - sd->show (); - - <font color=red>// Change it</font> - sd->set (); - - <font color=red>// Advertise it</font> - sd->available (1); - - shm_client.close (); - - return 0; -} - -<font color=blue>#endif</font> <font color=red>/* ACE_LACKS_SYSV_SHMEM */</font> -</PRE> -<P><HR WIDTH="100%"> -<CENTER>[<A HREF="../online-tutorials.html">Tutorial Index</A>] [<A HREF="page05.html">Continue This Tutorial</A>]</CENTER> diff --git a/docs/tutorials/019/page05.html b/docs/tutorials/019/page05.html deleted file mode 100644 index 510affb2249..00000000000 --- a/docs/tutorials/019/page05.html +++ /dev/null @@ -1,124 +0,0 @@ -<!-- $Id$ --> -<HTML> -<HEAD> - <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> - <META NAME="Author" CONTENT="James CE Johnson"> - <TITLE>ACE Tutorial 019</TITLE> -</HEAD> -<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#000FFF" VLINK="#FF0F0F"> - -<CENTER><B><FONT SIZE=+2>ACE Tutorial 019</FONT></B></CENTER> - -<CENTER><B><FONT SIZE=+2>Sharing your Memories</FONT></B></CENTER> - -<P> -<HR WIDTH="100%"> - Here's the mysterious shmem.h. I wanted to show it after the - placement-new client and server so that the SharedData object - would have some relevance. - <HR> -<HR width=50%><P><center>shmem.h</center><HR width=50%> -<PRE> -<font color=red>// $Id$</font> - -<font color=blue>#ifndef</font> <font color=purple>SHMEM_H</font> -<font color=blue>#define</font> <font color=purple>SHMEM_H</font> - -<font color=red>// This is where you'll find the ACE_Shared_Memory_SV object</font> -<font color=blue>#include</font> "<A HREF="../../../ace/Shared_Memory_SV.h">ace/Shared_Memory_SV.h</A>" - -<font color=red>// SHMSZ is just enough for the alphabet and a null terminator</font> -<font color=blue>#define</font> <font color=purple>SHMSZ</font> 27 - -<font color=red>// Play with this, pick a value you like that isn't used by something else.</font> -<font color=blue>#define</font> <font color=purple>SHM_KEY</font> 4200 - -<font color=red>/* - This is what we stuff into shared memory via placement new in the - second client/server pair. Notice that it is a very basic object - with no virtual methods and only concrete data. - */</font> -class SharedData -{ -public: - <font color=red>// Construct the object and optionally initialize buf_.</font> - SharedData (int initialized = 1); - - <font color=red>// Put some data into buf_</font> - void set (void); - - <font color=red>// Show the data in buf_</font> - void show (void); - - <font color=red>// What is the value of available_</font> - int available (void); - - <font color=red>// Set the value of available_</font> - void available (int not_in_use); - -protected: - <font color=red>// Big enough for a simple message</font> - char buf_[128]; - <font color=red>// A cheap mutex</font> - int available_; -}; - -<font color=blue>#endif</font> <font color=red>/* SHMEM_H */</font> -</PRE> -<HR width=50%><P><center>shmem.cpp</center><HR width=50%> -<PRE> -<font color=red>// $Id$</font> - -<font color=blue>#include</font> "<font color=green>shmem.h</font>" - -#if ! defined (ACE_LACKS_SYSV_SHMEM) - -<font color=red>/* - Set the available_ flag to zero & optionally initialize the buf_ - area. -*/</font> - -<font color=#008888>SharedData::SharedData</font> (int initialize) - : available_ (0) -{ - if (initialize) - <font color=#008888>ACE_OS::sprintf</font> (buf_, "<font color=green>UNSET\n</font>"); -} - -<font color=red>/* - Write the process ID into the buffer. This will prove to us that - the data really is shared between the client and server. -*/</font> -void <font color=#008888>SharedData::set</font> (void) -{ - <font color=#008888>ACE_OS::sprintf</font> (buf_, - "<font color=green>My PID is (%d)\n</font>", - <font color=#008888>ACE_OS::getpid</font> ()); -} - -<font color=red>/* - Display the buffer to the user -*/</font> -void <font color=#008888>SharedData::show</font>(void) -{ - ACE_DEBUG ((LM_INFO, - "<font color=green>(%P|%t) Shared Data text is (%s)\n</font>", - buf_)); -} - -<font color=red>// Show flag</font> -int <font color=#008888>SharedData::available</font>(void) -{ - return available_; -} - -<font color=red>// Set flag</font> -void <font color=#008888>SharedData::available</font>(int a) -{ - available_ = a; -} - -<font color=blue>#endif</font> <font color=red>/* ACE_LACKS_SYSV_SHMEM */</font> -</PRE> -<P><HR WIDTH="100%"> -<CENTER>[<A HREF="../online-tutorials.html">Tutorial Index</A>] [<A HREF="page06.html">Continue This Tutorial</A>]</CENTER> diff --git a/docs/tutorials/019/page06.html b/docs/tutorials/019/page06.html deleted file mode 100644 index 0dee71f02cc..00000000000 --- a/docs/tutorials/019/page06.html +++ /dev/null @@ -1,28 +0,0 @@ -<!-- $Id$ --> -<HTML> -<HEAD> - <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> - <META NAME="Author" CONTENT="James CE Johnson"> - <TITLE>ACE Tutorial 019</TITLE> -</HEAD> -<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#000FFF" VLINK="#FF0F0F"> - -<CENTER><B><FONT SIZE=+2>ACE Tutorial 019</FONT></B></CENTER> - -<CENTER><B><FONT SIZE=+2>Sharing your Memories</FONT></B></CENTER> - -<P> -<HR WIDTH="100%"> - That's it! I warned you that this one was pretty primitive. - - <ul> - <li><A HREF="server.cpp">server.cpp</A> - <li><A HREF="client.cpp">client.cpp</A> - <li><A HREF="server2.cpp">server2.cpp</A> - <li><A HREF="client2.cpp">client2.cpp</A> - <li><A HREF="shmem.h">shmem.h</A> - <li><A HREF="shmem.cpp">shmem.cpp</A> - <li><A HREF="Makefile">Makefile</A> - </ul> -<P><HR WIDTH="100%"> -<CENTER>[<A HREF="../online-tutorials.html">Tutorial Index</A>] </CENTER> diff --git a/docs/tutorials/019/server.cpp b/docs/tutorials/019/server.cpp deleted file mode 100644 index 40997844ef8..00000000000 --- a/docs/tutorials/019/server.cpp +++ /dev/null @@ -1,126 +0,0 @@ -// $Id$ - -/* - The client and server both need to know the shared memory key and - size. To prevent headaches, I've put those into a header they both - can share. - */ -#include "shmem.h" - -#if defined (ACE_LACKS_SYSV_SHMEM) -int -main (int, char *[]) -{ - ACE_ERROR_RETURN ((LM_ERROR, - "System V Shared Memory not available on this platform\n"), - 100); -} -#else // ACE_LACKS_SYSV_SHMEM -int -main (int, char *argv[]) -{ - /* - You can use the ACE_Malloc template to create memory pools - from various shared memory strategies. It's really cool. - We're not going to use it. - - Instead, I want to get to the roots of it all and directly - use ACE_Shared_Memory_SV. Like many ACE objects, this is a - wrapper around OS services. - - With this constructor we create a shared memory area to - use. The ACE_CREATE flag will cause it to be created if it - doesn't already exist. The SHM_KEY value (from shmem.h) - uniquely identifies the segment and allows other apps to - attach to the same segment. Execute 'ipcs -m' before and - after starting this app to see that the segment is created. - (I can't for the life of me correlate the SHM_KEY value back - to the key/id reported by ipcs though.) - */ - ACE_Shared_Memory_SV shm_server (SHM_KEY, SHMSZ, - ACE_Shared_Memory_SV::ACE_CREATE); - - /* - The constructor created the segment for us but we still need - to map the segment into our address space. (Note that you - can pass a value to malloc() but it will be silently - igored.) The void* (cast to char*) that is returned will - point to the beginning of the shared segment. - */ - char *shm = (char *) shm_server.malloc (); - - /* - Since we're asking to create the segment, we will fail if it - already exists. We could fall back and simply attach to it - like the client but I'd rather not assume it was a previous - instance of this app that left the segment around. - */ - if (shm == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "%p\n\t(%P|%t) Cannot create shared memory segment.\n" - "\tUse 'ipcs' to see if it already exists\n", - argv[0]), - 100); - - /* - This second pointer will be used to walk through the block - of memory... - */ - char *s = shm; - - /* - Out of curiosity, I added this output message. The tests - I've done so far show me the same address for client and - server. What does your OS tell you? - */ - ACE_DEBUG ((LM_INFO, - "(%P|%t) Shared Memory is at 0x%x\n", - shm )); - - /* - At this point, our application can use the pointer just like - any other given to us by new or malloc. For our purposes, - we'll copy in the alpabet as a null-terminated string. - */ - for (char c = 'a'; c <= 'z'; c++) - *s++ = c; - - *s = '\0'; - - /* - Using a simple not-too-busy loop, we'll wait for the client - (or anyone else) to change the first byte in the shared area - to a '*' character. This is where you would rather use - semaphores or some similar "resource light" approach. - */ - while (*shm != '*') - ACE_OS::sleep (1); - - /* - Let's see what the client did to the segment... - */ - for (s = shm; *s != '\0'; s++) - putchar (*s); - - putchar ('\n'); - - /* - If you're done with the segment and ready for it to be - removed from the system, use the remove() method. Once the - program exits, do 'ipcs -m' again and you'll see that the - segment is gone. If you just want to terminate your use of - the segment but leave it around for other apps, use the - close() method instead. - - The free() method may be tempting but it doesn't actually do - anything. If your app is *really* done with the shared - memory then use either close() or remove(). - */ - if (shm_server.remove () < 0) - ACE_ERROR ((LM_ERROR, - "%p\n", - "remove")); - return 0; -} - -#endif /* ACE_LACKS_SYSV_SHMEM */ diff --git a/docs/tutorials/019/server2.cpp b/docs/tutorials/019/server2.cpp deleted file mode 100644 index 54d532d4134..00000000000 --- a/docs/tutorials/019/server2.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// $Id$ - -#include "shmem.h" - -#if defined (ACE_LACKS_SYSV_SHMEM) -int -main (int, char *[]) -{ - ACE_ERROR_RETURN ((LM_ERROR, - "System V Shared Memory not available on this platform\n"), - 100); -} -#else // ACE_LACKS_SYSV_SHMEM -int -main (int, char *argv[]) -{ - // Be sure the segment is sized to hold our object. - ACE_Shared_Memory_SV shm_server (SHM_KEY, - sizeof (SharedData), - ACE_Shared_Memory_SV::ACE_CREATE); - char *shm = (char *) shm_server.malloc (); - - if (shm == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "%p\n\t(%P|%t) Cannot create shared memory segment.\n" - "\tUse 'ipcs' to see if it already exists\n", - argv[0]), - 100); - - ACE_DEBUG ((LM_INFO, - "(%P|%t) Shared Memory is at 0x%x\n", - shm )); - - /* - Use the placement new syntax to stuff the object into the - correct location. I think they generally reserve this for - the advanced class... - */ - SharedData *sd = new (shm) SharedData; - - // Use the set() method to put some data into the object - sd->set (); - - // Set the 'available' flag to zero so that we can wait on it - sd->available (0); - - /* - Another cheesy busy loop while we wait for the object to - become available. The cool way would be to hide a semaphore - or two behind this method call & eliminate the sleep. - */ - while (sd->available () == 0) - ACE_OS::sleep (1); - - // Show the user what's in the segment - sd->show (); - - // All done. - if (shm_server.remove () < 0) - ACE_ERROR ((LM_ERROR, - "%p\n", - "remove")); - return 0; -} - -#endif /* ACE_LACKS_SYSV_SHMEM */ diff --git a/docs/tutorials/019/shmem.cpp b/docs/tutorials/019/shmem.cpp deleted file mode 100644 index a2442afe253..00000000000 --- a/docs/tutorials/019/shmem.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// $Id$ - -#include "shmem.h" - -#if ! defined (ACE_LACKS_SYSV_SHMEM) - -/* - Set the available_ flag to zero & optionally initialize the buf_ - area. -*/ - -SharedData::SharedData (int initialize) - : available_ (0) -{ - if (initialize) - ACE_OS::sprintf (buf_, "UNSET\n"); -} - -/* - Write the process ID into the buffer. This will prove to us that - the data really is shared between the client and server. -*/ -void SharedData::set (void) -{ - ACE_OS::sprintf (buf_, - "My PID is (%d)\n", - ACE_OS::getpid ()); -} - -/* - Display the buffer to the user -*/ -void SharedData::show(void) -{ - ACE_DEBUG ((LM_INFO, - "(%P|%t) Shared Data text is (%s)\n", - buf_)); -} - -// Show flag -int SharedData::available(void) -{ - return available_; -} - -// Set flag -void SharedData::available(int a) -{ - available_ = a; -} - -#endif /* ACE_LACKS_SYSV_SHMEM */ diff --git a/docs/tutorials/019/shmem.h b/docs/tutorials/019/shmem.h deleted file mode 100644 index 74d4798b794..00000000000 --- a/docs/tutorials/019/shmem.h +++ /dev/null @@ -1,45 +0,0 @@ -// $Id$ - -#ifndef SHMEM_H -#define SHMEM_H - -// This is where you'll find the ACE_Shared_Memory_SV object -#include "ace/Shared_Memory_SV.h" - -// SHMSZ is just enough for the alphabet and a null terminator -#define SHMSZ 27 - -// Play with this, pick a value you like that isn't used by something else. -#define SHM_KEY 4200 - -/* - This is what we stuff into shared memory via placement new in the - second client/server pair. Notice that it is a very basic object - with no virtual methods and only concrete data. - */ -class SharedData -{ -public: - // Construct the object and optionally initialize buf_. - SharedData (int initialized = 1); - - // Put some data into buf_ - void set (void); - - // Show the data in buf_ - void show (void); - - // What is the value of available_ - int available (void); - - // Set the value of available_ - void available (int not_in_use); - -protected: - // Big enough for a simple message - char buf_[128]; - // A cheap mutex - int available_; -}; - -#endif /* SHMEM_H */ |