summaryrefslogtreecommitdiff
path: root/perf/src/IceStorm/Notifier.cpp
blob: 5ff3fea3db6db2b0d5af8644a86b1a684aac941b (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
// **********************************************************************
//
// 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 <IceUtil/Thread.h>
#include <Ice/Application.h>

#include <Sync.h>

using namespace std;
using namespace Perf;

class Notifier : public Ice::Application
{
public:

    virtual int run(int, char*[]);
};

int
main(int argc, char* argv[])
{
    Notifier app;
    return app.main(argc, argv, "config");
}

int
Notifier::run(int argc, char* argv[])
{
    vector<string> proxies;
    for(int i = 1; i < argc; i++)
    {
	proxies.push_back(argv[i]);
    }

    vector<Perf::SyncPrx> syncs;
    {
	for(vector<string>::const_iterator p = proxies.begin(); p != proxies.end(); ++p)
	{
	    SyncPrx s = Perf::SyncPrx::uncheckedCast(communicator()->stringToProxy(*p)->ice_oneway());
	    s->ice_ping();
	    syncs.push_back(s);
	}
    }

    {
	for(vector<Perf::SyncPrx>::const_iterator p = syncs.begin(); p != syncs.end(); ++p)
	{
	    (*p)->notify();
	}
    }

    return EXIT_SUCCESS;
}