diff options
author | Benoit Foucher <benoit@zeroc.com> | 2014-11-03 15:58:54 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2014-11-03 15:58:54 +0100 |
commit | 581d0449b2c5f1bbfd5bb3d6d1216040b832b273 (patch) | |
tree | c3ebc0b05f1ad8d5dc2156e471c799b30be8ecde /cpp/demo/manual/simple_filesystem/FilesystemI.h | |
parent | Fixed ICE-5816: Silverlight build failure (diff) | |
download | ice-581d0449b2c5f1bbfd5bb3d6d1216040b832b273.tar.bz2 ice-581d0449b2c5f1bbfd5bb3d6d1216040b832b273.tar.xz ice-581d0449b2c5f1bbfd5bb3d6d1216040b832b273.zip |
Fixed ICE-5811: renamed book demos to manual demos
Diffstat (limited to 'cpp/demo/manual/simple_filesystem/FilesystemI.h')
-rw-r--r-- | cpp/demo/manual/simple_filesystem/FilesystemI.h | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/cpp/demo/manual/simple_filesystem/FilesystemI.h b/cpp/demo/manual/simple_filesystem/FilesystemI.h new file mode 100644 index 00000000000..8da0dae9566 --- /dev/null +++ b/cpp/demo/manual/simple_filesystem/FilesystemI.h @@ -0,0 +1,77 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2014 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. +// +// ********************************************************************** + +#ifndef __FilesystemI_h__ +#define __FilesystemI_h__ + +#include <Ice/Ice.h> +#include <Filesystem.h> + +#ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable:4250) // ... : inherits ... via dominance +#endif + +namespace Filesystem +{ + class DirectoryI; + typedef IceUtil::Handle<DirectoryI> DirectoryIPtr; + + class NodeI : virtual public Node + { + public: + + virtual std::string name(const Ice::Current&); + NodeI(const Ice::CommunicatorPtr&, const std::string&, const DirectoryIPtr&); + void activate(const Ice::ObjectAdapterPtr&); + + private: + + std::string _name; + Ice::Identity _id; + DirectoryIPtr _parent; + NodeI(const NodeI&); // Copy forbidden + void operator=(const NodeI&); // Assignment forbidden + }; + typedef IceUtil::Handle<NodeI> NodeIPtr; + + class FileI : public File, public NodeI + { + public: + + virtual Lines read(const Ice::Current&); + virtual void write(const Lines&, + const Ice::Current& = Ice::Current()); + FileI(const Ice::CommunicatorPtr&, const std::string&, const DirectoryIPtr&); + + private: + + Lines _lines; + }; + typedef IceUtil::Handle<FileI> FileIPtr; + + class DirectoryI : public Directory, public NodeI + { + public: + + virtual NodeSeq list(const Ice::Current&); + DirectoryI(const Ice::CommunicatorPtr&, const std::string&, const DirectoryIPtr&); + void addChild(const Filesystem::NodePrx&); + + private: + + Filesystem::NodeSeq _contents; + }; +} + +#ifdef _MSC_VER +# pragma warning(pop) +#endif + +#endif |