summaryrefslogtreecommitdiff
path: root/cpp/demo/Freeze/library/LibraryI.h
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2002-03-13 03:55:22 +0000
committerMatthew Newhook <matthew@zeroc.com>2002-03-13 03:55:22 +0000
commit0ac325172b7608a2fa0c366a7665940ef14c562f (patch)
tree47e65b54c6e4e870a7b3e78f032bcb88f65f96be /cpp/demo/Freeze/library/LibraryI.h
parentbug fix (diff)
downloadice-0ac325172b7608a2fa0c366a7665940ef14c562f.tar.bz2
ice-0ac325172b7608a2fa0c366a7665940ef14c562f.tar.xz
ice-0ac325172b7608a2fa0c366a7665940ef14c562f.zip
Initial version of library demo.
Diffstat (limited to 'cpp/demo/Freeze/library/LibraryI.h')
-rw-r--r--cpp/demo/Freeze/library/LibraryI.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/cpp/demo/Freeze/library/LibraryI.h b/cpp/demo/Freeze/library/LibraryI.h
new file mode 100644
index 00000000000..6c6166e0b83
--- /dev/null
+++ b/cpp/demo/Freeze/library/LibraryI.h
@@ -0,0 +1,69 @@
+// **********************************************************************
+//
+// Copyright (c) 2001
+// MutableRealms, Inc.
+// Huntsville, AL, USA
+//
+// All Rights Reserved
+//
+// **********************************************************************
+
+#ifndef LIBRARY_I_H
+#define LIBRARY_I_H
+
+#include <IceUtil/RWRecMutex.h>
+
+#include <Library.h>
+#include <LibraryTypes.h>
+
+class LibraryI : public Library, public IceUtil::RWRecMutex
+{
+public:
+
+ LibraryI(const Ice::ObjectAdapterPtr&, const Freeze::DBPtr&, const Freeze::EvictorPtr&);
+ virtual ~LibraryI();
+
+ virtual ::BookPrx createBook(const ::BookDescription&, const Ice::Current&);
+ virtual ::BookPrx findByIsbn(const ::std::string&, const Ice::Current&);
+ virtual ::BookPrxSeq findByAuthors(const ::std::string&, const Ice::Current&);
+ virtual void setEvictorSize(::Ice::Int, const Ice::Current&);
+ virtual void shutdown(const Ice::Current&);
+
+ void remove(const BookDescription&);
+
+private:
+
+ Ice::ObjectAdapterPtr _adapter;
+ Freeze::EvictorPtr _evictor;
+
+ //
+ // This is a dictionary of authors to a sequence of isbn numbers
+ // for efficient lookup of books by authors.
+ //
+ StringIsbnSeqDict _authors;
+};
+
+typedef IceUtil::Handle<LibraryI> LibraryIPtr;
+
+class BookI : public Book, public IceUtil::RWRecMutex
+{
+public:
+
+ BookI(const LibraryIPtr&, const Freeze::EvictorPtr&);
+ virtual ~BookI();
+
+ virtual ::BookDescription getBookDescription(const Ice::Current&);
+ virtual void destroy(const Ice::Current&);
+ virtual void rentBook(const ::std::string&, const Ice::Current&);
+ virtual ::std::string getRenterName(const Ice::Current&);
+ virtual void returnBook(const Ice::Current&);
+
+ static Ice::Identity createIdentity(const ::std::string&);
+
+private:
+
+ LibraryIPtr _library;
+ Freeze::EvictorPtr _evictor;
+};
+
+#endif