diff options
author | Marc Laukien <marc@zeroc.com> | 2001-09-15 01:30:12 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2001-09-15 01:30:12 +0000 |
commit | 15b9f75e092d1e288c9ba4c70f2cc9ec72c88d00 (patch) | |
tree | 7d33b6d51e0490cf4539253ccbb2329398c66bd6 /cpp | |
parent | streamlined object adpater (diff) | |
download | ice-15b9f75e092d1e288c9ba4c70f2cc9ec72c88d00.tar.bz2 ice-15b9f75e092d1e288c9ba4c70f2cc9ec72c88d00.tar.xz ice-15b9f75e092d1e288c9ba4c70f2cc9ec72c88d00.zip |
started with Freeze
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/include/Freeze/Freeze.h | 18 | ||||
-rw-r--r-- | cpp/include/Freeze/Initialize.h | 35 | ||||
-rw-r--r-- | cpp/slice/Freeze/DB.ice | 141 | ||||
-rw-r--r-- | cpp/slice/Freeze/DBF.ice | 25 | ||||
-rw-r--r-- | cpp/slice/Ice/Communicator.ice | 5 | ||||
-rw-r--r-- | cpp/slice/IcePack/Admin.ice | 2 | ||||
-rw-r--r-- | cpp/src/Freeze/Makefile | 58 | ||||
-rw-r--r-- | cpp/src/Freeze/freeze.dsp | 203 | ||||
-rw-r--r-- | cpp/src/Makefile | 1 |
9 files changed, 487 insertions, 1 deletions
diff --git a/cpp/include/Freeze/Freeze.h b/cpp/include/Freeze/Freeze.h new file mode 100644 index 00000000000..474c7eb5708 --- /dev/null +++ b/cpp/include/Freeze/Freeze.h @@ -0,0 +1,18 @@ +// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef FREEZE_FREEZE_H +#define FREEZE_FREEZE_H + +#include <Ice/Ice.h> +#include <Freeze/Initialize.h> +#include <Freeze/DB.h> + +#endif diff --git a/cpp/include/Freeze/Initialize.h b/cpp/include/Freeze/Initialize.h new file mode 100644 index 00000000000..142cb55e9b7 --- /dev/null +++ b/cpp/include/Freeze/Initialize.h @@ -0,0 +1,35 @@ +// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef FREEZE_INITIALIZE_H +#define FREEZE_INITIALIZE_H + +#include <Ice/CommunicatorF.h> +#include <Freeze/DBF.h> + +#ifdef WIN32 +# ifdef SLICE_API_EXPORTS +# define SLICE_API __declspec(dllexport) +# else +# define SLICE_API __declspec(dllimport) +# endif +#else +# define SLICE_API /**/ +#endif + +namespace Freeze +{ + +FREEZE_API DBFactoryPtr initialize(int&, char*[], const CommunicatorPtr&); +FREEZE_API DBFactoryPtr initializeWithProperties(const PropertiesPtr&, const CommunicatorPtr&); + +} + +#endif diff --git a/cpp/slice/Freeze/DB.ice b/cpp/slice/Freeze/DB.ice new file mode 100644 index 00000000000..4676e0adff1 --- /dev/null +++ b/cpp/slice/Freeze/DB.ice @@ -0,0 +1,141 @@ +// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef FREEZE_DB_ICE +#define FREEZE_DB_ICE + +/** + * + * The Ice module for object persistence. + * + **/ +module Freeze +{ + +local class DB; +local class DBFactory; + +/** + * + * The base class for all Freeze exceptions. + * + **/ +local class Exception +{ + /** + * + * A message describing the failure that caused the exception. + * + **/ + string _msg; +}; + +/** + * + * This exception is raised by <literal>DB</literal> + * operations. + * + * @see DB + * + **/ +local class DBException extends Exception +{ + /** + * + * The database object that raised this exception. + * + **/ + DB _factory; +}; + +/** + * + * An object representing a database. + * + * @see DBException + * @see DBFactory + * + **/ +local class DB +{ + /** + * + * Open the database. + * + **/ + void open(string name) throws DBException; + + /** + * + * Close the database. + * + **/ + void close() throws DBException; + + /** + * + * Destroy this database object. If the database has not been + * closed before, <literal>destroy</literal> also closes the + * database. + * + **/ + void destroy(); +}; + +/** + * + * This exception is raised by <literal>DBFactory</literal> + * operations. + * + * @see DBFactory + * + **/ +local class DBFactoryException extends Exception +{ + /** + * + * The database object factory that raised this exception. + * + **/ + DBFactory _factory; +}; + +/** + * + * A factory for database objects. + * + * @see DBFactoryException + * @see DB + * + **/ +local class DBFactory +{ + /** + * + * Create a new database object. + * + * @return The new database object. + * + * @see DB + * + **/ + DB createDB() throws DBFactoryException; + + /** + * + * Destroy this factory and all database objects that have been created by this factory. + * + **/ + void destroy() throws DBFactoryException, DBException; +}; + +}; + +#endif diff --git a/cpp/slice/Freeze/DBF.ice b/cpp/slice/Freeze/DBF.ice new file mode 100644 index 00000000000..edf7d71c0a2 --- /dev/null +++ b/cpp/slice/Freeze/DBF.ice @@ -0,0 +1,25 @@ +// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef FREEZE_DB_F_ICE +#define FREEZE_DB_F_ICE + +module Freeze +{ + +local class DB; +local class DBFactory; +local class Exception; +local class DBException; +local class DBFactoryException; + +}; + +#endif diff --git a/cpp/slice/Ice/Communicator.ice b/cpp/slice/Ice/Communicator.ice index ab7d2c5f683..7e00bfd06f6 100644 --- a/cpp/slice/Ice/Communicator.ice +++ b/cpp/slice/Ice/Communicator.ice @@ -17,6 +17,11 @@ #include <Ice/PropertiesF.ice> #include <Ice/ValueFactoryF.ice> +/** + * + * The basic Ice module, containing all the Ice core functionality. + * + **/ module Ice { diff --git a/cpp/slice/IcePack/Admin.ice b/cpp/slice/IcePack/Admin.ice index 13a060c4d9a..1f824b89533 100644 --- a/cpp/slice/IcePack/Admin.ice +++ b/cpp/slice/IcePack/Admin.ice @@ -13,7 +13,7 @@ /** * - * The Ice object locator and activator. + * The Ice module for object location and activation. * **/ module IcePack diff --git a/cpp/src/Freeze/Makefile b/cpp/src/Freeze/Makefile new file mode 100644 index 00000000000..8bdd14d853b --- /dev/null +++ b/cpp/src/Freeze/Makefile @@ -0,0 +1,58 @@ +# ********************************************************************** +# +# Copyright (c) 2001 +# MutableRealms, Inc. +# Huntsville, AL, USA +# +# All Rights Reserved +# +# ********************************************************************** + +top_srcdir = ../.. + +BASE = libFreeze.so +VERSIONED_BASE = $(BASE).$(VERSION) + +NAME = $(top_srcdir)/lib/$(BASE) +VERSIONED_NAME = $(top_srcdir)/lib/$(VERSIONED_BASE) + +TARGETS = $(NAME) $(VERSIONED_NAME) + +OBJS = DB.o + +SRCS = $(OBJS:.o=.cpp) + +HDIR = $(includedir)/Freeze +IDIR = $(slicedir)/Freeze +SLICECMD = $(SLICE) --include-dir Freeze --dll-export FREEZE_API -I$(slicedir) + +include $(top_srcdir)/config/Make.rules + +CPPFLAGS := -I.. $(CPPFLAGS) + +$(VERSIONED_NAME): $(OBJS) + rm -f $@ + $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $@ $(OBJS) + +$(NAME): $(VERSIONED_NAME) + rm -f $@ + ln -s $(VERSIONED_BASE) $@ + +$(HDIR)/DB.h DB.cpp: $(IDIR)/DB.ice $(SLICE) + rm -f $(HDIR)/DB.h DB.cpp + $(SLICECMD) $(IDIR)/DB.ice + mv DB.h $(HDIR) + +clean:: + rm -f $(HDIR)/DB.h DB.cpp + +$(HDIR)/DBF.h: $(IDIR)/DBF.ice $(SLICE) + rm -f $(HDIR)/DBF.h DBF.cpp + $(SLICECMD) $(IDIR)/DBF.ice + mv DBF.h $(HDIR) + rm -f DBF.cpp + +clean:: + rm -f $(HDIR)/DBF.h + +include .depend diff --git a/cpp/src/Freeze/freeze.dsp b/cpp/src/Freeze/freeze.dsp new file mode 100644 index 00000000000..8c71ec58cb0 --- /dev/null +++ b/cpp/src/Freeze/freeze.dsp @@ -0,0 +1,203 @@ +# Microsoft Developer Studio Project File - Name="Freeze" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=Freeze - 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 "Freeze.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 "Freeze.mak" CFG="Freeze - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Freeze - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "Freeze - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Freeze - 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 Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBRARY_EXPORTS" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MD /Ze /W3 /GR /GX /O2 /I ".." /I "../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_USRDLL" /D "FREEZE_API_EXPORTS" /YX /FD /c
+# SUBTRACT CPP /Fr
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# 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 /dll /machine:I386
+# ADD LINK32 ws2_32.lib jtc.lib /nologo /dll /machine:I386 /out:"Release/icepack001.dll" /libpath:"../../../lib"
+# SUBTRACT LINK32 /pdb:none
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Cmds=copy Release\icepack001.* ..\..\lib
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "Freeze - 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 Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBRARY_EXPORTS" /Yu"stdafx.h" /FD /GZ /c
+# ADD CPP /nologo /MDd /Ze /W3 /Gm /GR /GX /Zi /Od /I ".." /I "../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_USRDLL" /D "FREEZE_API_EXPORTS" /YX /FD /GZ /c
+# SUBTRACT CPP /Fr
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# 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 /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 ws2_32.lib jtcd.lib /nologo /dll /debug /machine:I386 /out:"Debug/icepack001d.dll" /pdbtype:sept /libpath:"../../../lib"
+# SUBTRACT LINK32 /pdb:none
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Cmds=copy Debug\icepack001d.* ..\..\lib
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "Freeze - Win32 Release"
+# Name "Freeze - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\DB.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\include\Freeze\DB.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\Freeze\DBF.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=..\..\slice\Freeze\DB.ice
+
+!IF "$(CFG)" == "Freeze - Win32 Release"
+
+# Begin Custom Build
+InputPath=..\..\slice\Freeze\DB.ice
+
+BuildCmds= \
+ set PATH=%PATH%;..\..\lib \
+ ..\..\bin\slice2cpp.exe --dll-export FREEZE_API --include-dir Freeze -I../../slice ../../slice/Freeze/DB.ice \
+ move DB.h ..\..\include\Freeze \
+
+
+"..\..\include\Freeze\DB.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"DB.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "Freeze - Win32 Debug"
+
+# Begin Custom Build
+InputPath=..\..\slice\Freeze\DB.ice
+
+BuildCmds= \
+ set PATH=%PATH%;..\..\lib \
+ ..\..\bin\slice2cpp.exe --dll-export FREEZE_API --include-dir Freeze -I../../slice ../../slice/Freeze/DB.ice \
+ move DB.h ..\..\include\Freeze \
+
+
+"..\..\include\Freeze\DB.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"DB.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\slice\Freeze\DBF.ice
+
+!IF "$(CFG)" == "Freeze - Win32 Release"
+
+# Begin Custom Build
+InputPath=..\..\slice\Freeze\DBF.ice
+
+"..\..\include\Freeze\DBF.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ set PATH=%PATH%;..\..\lib
+ ..\..\bin\slice2cpp.exe --dll-export FREEZE_API --include-dir Freeze -I../../slice ../../slice/Freeze/DBF.ice
+ move DBF.h ..\..\include\Freeze
+ del DBF.cpp
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "Freeze - Win32 Debug"
+
+# Begin Custom Build
+InputPath=..\..\slice\Freeze\DBF.ice
+
+"..\..\include\Freeze\DBF.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ set PATH=%PATH%;..\..\lib
+ ..\..\bin\slice2cpp.exe --dll-export FREEZE_API --include-dir Freeze -I../../slice ../../slice/Freeze/DBF.ice
+ move DBF.h ..\..\include\Freeze
+ del DBF.cpp
+
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/cpp/src/Makefile b/cpp/src/Makefile index 211ace85799..cf0001a8c95 100644 --- a/cpp/src/Makefile +++ b/cpp/src/Makefile @@ -16,6 +16,7 @@ SUBDIRS = Slice \ slice2cpp \ slice2docbook \ Ice \ + Freeze \ IcePack $(EVERYTHING):: |