blob: 074a416d04d9443b4bf7e38457e074a25ab2c557 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
// **********************************************************************
//
// Copyright (c) 2003-2004 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 PHONE_BOOK_I_H
#define PHONE_BOOK_I_H
#include <IceUtil/IceUtil.h>
#include <Ice/Ice.h>
#include <Freeze/Freeze.h>
#include <PhoneBook.h>
#include <NameIndex.h>
#include <ContactFactory.h>
class PhoneBookI;
typedef IceUtil::Handle<PhoneBookI> PhoneBookIPtr;
class ContactI;
typedef IceUtil::Handle<ContactI> ContactIPtr;
class ContactI : public Demo::Contact,
public IceUtil::AbstractMutexReadI<IceUtil::RWRecMutex>
{
public:
ContactI(const ContactFactoryPtr&);
virtual std::string getName(const Ice::Current&) const;
virtual void setName(const std::string&, const Ice::Current&);
virtual std::string getAddress(const Ice::Current&) const;
virtual void setAddress(const std::string&, const Ice::Current&);
virtual std::string getPhone(const Ice::Current&) const;
virtual void setPhone(const std::string&, const Ice::Current&);
virtual void destroy(const Ice::Current&);
private:
ContactFactoryPtr _factory;
};
class PhoneBookI : public Demo::PhoneBook
{
public:
PhoneBookI(const Freeze::EvictorPtr& evictor, const ContactFactoryPtr& factory, const NameIndexPtr& index);
virtual Demo::ContactPrx createContact(const Ice::Current&);
virtual Demo::Contacts findContacts(const std::string&, const Ice::Current&) const;
virtual void setEvictorSize(Ice::Int, const Ice::Current&);
virtual void shutdown(const Ice::Current&) const;
private:
Freeze::EvictorPtr _evictor;
ContactFactoryPtr _contactFactory;
NameIndexPtr _index;
};
#endif
|