~ubuntu-branches/ubuntu/quantal/zeroc-ice/quantal

« back to all changes in this revision

Viewing changes to cpp/demo/book/evictor_filesystem/PersistentFilesystemI.h

  • Committer: Bazaar Package Importer
  • Author(s): Cleto Martin Angelina
  • Date: 2011-04-25 18:44:24 UTC
  • mfrom: (6.1.14 sid)
  • Revision ID: james.westby@ubuntu.com-20110425184424-sep9i9euu434vq4c
Tags: 3.4.1-7
* Bug fix: "libdb5.1-java.jar was renamed to db.jar", thanks to Ondřej
  Surý (Closes: #623555).
* Bug fix: "causes noise in php5", thanks to Jayen Ashar (Closes:
  #623533).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// **********************************************************************
 
2
//
 
3
// Copyright (c) 2003-2010 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
// **********************************************************************
 
9
 
 
10
#ifndef PERSISTENT_FILESYSTEM_I_H
 
11
#define PERSISTENT_FILESYSTEM_I_H
 
12
 
 
13
#include <PersistentFilesystem.h>
 
14
#include <IceUtil/IceUtil.h>
 
15
#include <Freeze/Freeze.h>
 
16
 
 
17
namespace Filesystem
 
18
{
 
19
 
 
20
class FileI : virtual public PersistentFile
 
21
{
 
22
public:
 
23
 
 
24
    FileI();
 
25
 
 
26
    virtual std::string name(const Ice::Current&);
 
27
    virtual void destroy(const Ice::Current&);
 
28
 
 
29
    virtual Lines read(const Ice::Current&);
 
30
    virtual void write(const Lines&, const Ice::Current&);
 
31
 
 
32
    static Freeze::EvictorPtr _evictor;
 
33
 
 
34
private:
 
35
 
 
36
    bool _destroyed;
 
37
    IceUtil::Mutex _mutex;
 
38
};
 
39
 
 
40
class DirectoryI : virtual public PersistentDirectory
 
41
{
 
42
public:
 
43
 
 
44
    DirectoryI();
 
45
 
 
46
    virtual std::string name(const Ice::Current&);
 
47
    virtual void destroy(const Ice::Current&);
 
48
 
 
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&);
 
54
 
 
55
    static Freeze::EvictorPtr _evictor;
 
56
 
 
57
public:
 
58
 
 
59
    bool _destroyed;
 
60
    IceUtil::Mutex _mutex;
 
61
};
 
62
 
 
63
class NodeFactory : virtual public Ice::ObjectFactory
 
64
{
 
65
public:
 
66
 
 
67
    virtual Ice::ObjectPtr create(const std::string&);
 
68
    virtual void destroy();
 
69
};
 
70
 
 
71
}
 
72
 
 
73
#endif