summaryrefslogtreecommitdiff
path: root/cpp/test/IceStorm/federation/Subscriber.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2007-02-01 17:09:49 +0000
committerBernard Normier <bernard@zeroc.com>2007-02-01 17:09:49 +0000
commitabada90e3f84dc703b8ddc9efcbed8a946fadead (patch)
tree2c6f9dccd510ea97cb927a7bd635422efaae547a /cpp/test/IceStorm/federation/Subscriber.cpp
parentremoving trace message (diff)
downloadice-abada90e3f84dc703b8ddc9efcbed8a946fadead.tar.bz2
ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.tar.xz
ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.zip
Expanded tabs into spaces
Diffstat (limited to 'cpp/test/IceStorm/federation/Subscriber.cpp')
-rw-r--r--cpp/test/IceStorm/federation/Subscriber.cpp110
1 files changed, 55 insertions, 55 deletions
diff --git a/cpp/test/IceStorm/federation/Subscriber.cpp b/cpp/test/IceStorm/federation/Subscriber.cpp
index c6c3efc8578..876a09686fe 100644
--- a/cpp/test/IceStorm/federation/Subscriber.cpp
+++ b/cpp/test/IceStorm/federation/Subscriber.cpp
@@ -24,19 +24,19 @@ class EventI : public Event
public:
EventI(const CommunicatorPtr& communicator) :
- _communicator(communicator)
+ _communicator(communicator)
{
}
virtual void
pub(const string& data, const Ice::Current&)
{
- IceUtil::StaticMutex::Lock sync(_countMutex);
+ IceUtil::StaticMutex::Lock sync(_countMutex);
- if(++_count == 30 + 40 + 30)
- {
- _communicator->shutdown();
- }
+ if(++_count == 30 + 40 + 30)
+ {
+ _communicator->shutdown();
+ }
}
private:
@@ -56,11 +56,11 @@ void
usage(const char* appName)
{
cerr << "Usage: " << appName << " [options]\n";
- cerr <<
- "Options:\n"
- "-h, --help Show this message.\n"
- "-b Use batch reliability.\n"
- ;
+ cerr <<
+ "Options:\n"
+ "-h, --help Show this message.\n"
+ "-b Use batch reliability.\n"
+ ;
}
int
@@ -71,27 +71,27 @@ run(int argc, char* argv[], const CommunicatorPtr& communicator)
int idx = 1;
while(idx < argc)
{
- if(strcmp(argv[idx], "-b") == 0)
- {
+ if(strcmp(argv[idx], "-b") == 0)
+ {
batch = true;
- for(int i = idx ; i + 1 < argc ; ++i)
- {
- argv[i] = argv[i + 1];
- }
- --argc;
- }
- else if(strcmp(argv[idx], "-h") == 0 || strcmp(argv[idx], "--help") == 0)
- {
- usage(argv[0]);
- return EXIT_SUCCESS;
- }
- else if(argv[idx][0] == '-')
- {
- cerr << argv[0] << ": unknown option `" << argv[idx] << "'" << endl;
- usage(argv[0]);
- return EXIT_FAILURE;
- }
+ for(int i = idx ; i + 1 < argc ; ++i)
+ {
+ argv[i] = argv[i + 1];
+ }
+ --argc;
+ }
+ else if(strcmp(argv[idx], "-h") == 0 || strcmp(argv[idx], "--help") == 0)
+ {
+ usage(argv[0]);
+ return EXIT_SUCCESS;
+ }
+ else if(argv[idx][0] == '-')
+ {
+ cerr << argv[0] << ": unknown option `" << argv[idx] << "'" << endl;
+ usage(argv[0]);
+ return EXIT_FAILURE;
+ }
}
PropertiesPtr properties = communicator->getProperties();
@@ -99,16 +99,16 @@ run(int argc, char* argv[], const CommunicatorPtr& communicator)
string managerProxy = properties->getProperty(managerProxyProperty);
if(managerProxy.empty())
{
- cerr << argv[0] << ": property `" << managerProxyProperty << "' is not set" << endl;
- return EXIT_FAILURE;
+ cerr << argv[0] << ": property `" << managerProxyProperty << "' is not set" << endl;
+ return EXIT_FAILURE;
}
ObjectPrx base = communicator->stringToProxy(managerProxy);
IceStorm::TopicManagerPrx manager = IceStorm::TopicManagerPrx::checkedCast(base);
if(!manager)
{
- cerr << argv[0] << ": `" << managerProxy << "' is not running" << endl;
- return EXIT_FAILURE;
+ cerr << argv[0] << ": `" << managerProxy << "' is not running" << endl;
+ return EXIT_FAILURE;
}
ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("SubscriberAdapter", "default");
@@ -128,15 +128,15 @@ run(int argc, char* argv[], const CommunicatorPtr& communicator)
IceStorm::QoS qos;
if(batch)
{
- objFed1 = objFed1->ice_batchOneway();
- objFed2 = objFed1->ice_batchOneway();
- objFed3 = objFed1->ice_batchOneway();
+ objFed1 = objFed1->ice_batchOneway();
+ objFed2 = objFed1->ice_batchOneway();
+ objFed3 = objFed1->ice_batchOneway();
}
else
{
- objFed1 = objFed1->ice_oneway();
- objFed2 = objFed1->ice_oneway();
- objFed3 = objFed1->ice_oneway();
+ objFed1 = objFed1->ice_oneway();
+ objFed2 = objFed1->ice_oneway();
+ objFed3 = objFed1->ice_oneway();
}
TopicPrx fed1;
@@ -151,8 +151,8 @@ run(int argc, char* argv[], const CommunicatorPtr& communicator)
}
catch(const IceStorm::NoSuchTopic& e)
{
- cerr << argv[0] << ": NoSuchTopic: " << e.name << endl;
- return EXIT_FAILURE;
+ cerr << argv[0] << ": NoSuchTopic: " << e.name << endl;
+ return EXIT_FAILURE;
}
fed1->subscribeAndGetPublisher(qos, objFed1);
@@ -176,26 +176,26 @@ main(int argc, char* argv[])
try
{
- communicator = initialize(argc, argv);
- status = run(argc, argv, communicator);
+ communicator = initialize(argc, argv);
+ status = run(argc, argv, communicator);
}
catch(const Exception& ex)
{
- cerr << ex << endl;
- status = EXIT_FAILURE;
+ cerr << ex << endl;
+ status = EXIT_FAILURE;
}
if(communicator)
{
- try
- {
- communicator->destroy();
- }
- catch(const Exception& ex)
- {
- cerr << ex << endl;
- status = EXIT_FAILURE;
- }
+ try
+ {
+ communicator->destroy();
+ }
+ catch(const Exception& ex)
+ {
+ cerr << ex << endl;
+ status = EXIT_FAILURE;
+ }
}
return status;