ICE 3.4.2
[php5-ice-freebsdport.git] / cpp / demo / book / evictor_filesystem / PersistentFilesystemI.h
bloba8981772179942347c95d797123b05dcc97088fa
1 // **********************************************************************
2 //
3 // Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
4 //
5 // This copy of Ice is licensed to you under the terms described in the
6 // ICE_LICENSE file included in this distribution.
7 //
8 // **********************************************************************
10 #ifndef PERSISTENT_FILESYSTEM_I_H
11 #define PERSISTENT_FILESYSTEM_I_H
13 #include <PersistentFilesystem.h>
14 #include <IceUtil/IceUtil.h>
15 #include <Freeze/Freeze.h>
17 namespace Filesystem
20 class FileI : virtual public PersistentFile
22 public:
24 FileI();
26 virtual std::string name(const Ice::Current&);
27 virtual void destroy(const Ice::Current&);
29 virtual Lines read(const Ice::Current&);
30 virtual void write(const Lines&, const Ice::Current&);
32 static Freeze::EvictorPtr _evictor;
34 private:
36 bool _destroyed;
37 IceUtil::Mutex _mutex;
40 class DirectoryI : virtual public PersistentDirectory
42 public:
44 DirectoryI();
46 virtual std::string name(const Ice::Current&);
47 virtual void destroy(const Ice::Current&);
49 virtual NodeDescSeq list(const Ice::Current&);
50 virtual NodeDesc find(const std::string&, const Ice::Current&);
51 virtual DirectoryPrx createDirectory(const std::string&, const Ice::Current&);
52 virtual FilePrx createFile(const std::string&, const Ice::Current&);
53 virtual void removeNode(const std::string&, const Ice::Current&);
55 static Freeze::EvictorPtr _evictor;
57 public:
59 bool _destroyed;
60 IceUtil::Mutex _mutex;
63 class NodeFactory : virtual public Ice::ObjectFactory
65 public:
67 virtual Ice::ObjectPtr create(const std::string&);
68 virtual void destroy();
73 #endif