diff options
Diffstat (limited to 'cpp/demo/Freeze/library/BookFactory.cpp')
-rw-r--r-- | cpp/demo/Freeze/library/BookFactory.cpp | 34 |
1 files changed, 34 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..6ed8af4fbc9 --- /dev/null +++ b/cpp/demo/Freeze/library/BookFactory.cpp @@ -0,0 +1,34 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#include <BookFactory.h> + +using namespace std; + +BookFactory::BookFactory(const LibraryIPtr& library) : + _library(library) +{ +} + +Ice::ObjectPtr +BookFactory::create(const string& type) +{ + assert(_library); + assert(type == "::Demo::Book"); + return new BookI(_library); +} + +void +BookFactory::destroy() +{ + // + // Break cyclic object dependencies + // + _library = 0; +} |