summaryrefslogtreecommitdiff
path: root/cpp/demo/Ice/session/HelloSessionI.cpp
blob: 2f8dbedeec20fdf9de768c1df4b5489fa797669e (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
// **********************************************************************
//
// Copyright (c) 2003-2005 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.
//
// **********************************************************************

#include <Ice/Ice.h>

#include <HelloSessionI.h>

using namespace std;

HelloSessionI::HelloSessionI(const SessionManagerIPtr& manager) :
    _manager(manager)
{
}

HelloSessionI::~HelloSessionI()
{
}

void
HelloSessionI::sayHello(const Ice::Current&) const
{
    cout << "Hello World!" << endl;
}

//
// Destroy all session specific state.
//
void
HelloSessionI::destroyed(const Ice::Current& c)
{
    c.adapter->remove(c.id);
}

//
// This method is called by the client to destroy a session. All
// it should do is call remove on the session manager. All user
// specific cleanup should go in the destroyed() callback.
//
void
HelloSessionI::destroy(const Ice::Current& c)
{
    _manager->remove(c.id);
}

void
HelloSessionI::refresh(const Ice::Current& c)
{
    _manager->refresh(c.id);
}