summaryrefslogtreecommitdiff
path: root/cpp/demo/Freeze/library/BookFactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/demo/Freeze/library/BookFactory.cpp')
-rw-r--r--cpp/demo/Freeze/library/BookFactory.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/cpp/demo/Freeze/library/BookFactory.cpp b/cpp/demo/Freeze/library/BookFactory.cpp
new file mode 100644
index 00000000000..7833f36366e
--- /dev/null
+++ b/cpp/demo/Freeze/library/BookFactory.cpp
@@ -0,0 +1,37 @@
+// **********************************************************************
+//
+// Copyright (c) 2001
+// MutableRealms, Inc.
+// Huntsville, AL, USA
+//
+// All Rights Reserved
+//
+// **********************************************************************
+
+#include <BookFactory.h>
+
+using namespace std;
+using namespace Ice;
+
+BookFactory::BookFactory(const LibraryIPtr& library, const Freeze::EvictorPtr& evictor) :
+ _library(library),
+ _evictor(evictor)
+{
+}
+
+ObjectPtr
+BookFactory::create(const string& type)
+{
+ assert(type == "::Book");
+ return new BookI(_library, _evictor);
+}
+
+void
+BookFactory::destroy()
+{
+ //
+ // Break cyclic object dependencies
+ //
+ _library = 0;
+ _evictor = 0;
+}