diff options
author | Matthew Newhook <matthew@zeroc.com> | 2006-11-08 06:29:26 +0000 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2006-11-08 06:29:26 +0000 |
commit | 852598485134d30425c8c5838e138433c2795ae1 (patch) | |
tree | e7571a753e08cb0b875a3cd62448820b98d50a0a /cpp/src/IceStorm/Subscriber.h | |
parent | Replaced static Mutex by static StaticMutex (diff) | |
download | ice-852598485134d30425c8c5838e138433c2795ae1.tar.bz2 ice-852598485134d30425c8c5838e138433c2795ae1.tar.xz ice-852598485134d30425c8c5838e138433c2795ae1.zip |
updated IceStorm.
Diffstat (limited to 'cpp/src/IceStorm/Subscriber.h')
-rw-r--r-- | cpp/src/IceStorm/Subscriber.h | 137 |
1 files changed, 0 insertions, 137 deletions
diff --git a/cpp/src/IceStorm/Subscriber.h b/cpp/src/IceStorm/Subscriber.h deleted file mode 100644 index d35da04cc07..00000000000 --- a/cpp/src/IceStorm/Subscriber.h +++ /dev/null @@ -1,137 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2006 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 SUBSCRIBER_H -#define SUBSCRIBER_H - -#include <IceUtil/Handle.h> -#include <IceUtil/Shared.h> -#include <IceUtil/Mutex.h> -#include <Ice/CommunicatorF.h> -#include <Ice/Identity.h> - -namespace IceStorm -{ - -// -// Forward declarations. -// -class TraceLevels; -typedef IceUtil::Handle<TraceLevels> TraceLevelsPtr; - -class SubscriberFactory; -typedef IceUtil::Handle<SubscriberFactory> SubscriberFactoryPtr; - -class Event; -typedef IceUtil::Handle<Event> EventPtr; - -class QueuedProxy; -typedef IceUtil::Handle<QueuedProxy> QueuedProxyPtr; - -// -// Subscriber interface. -// -class Subscriber : public virtual IceUtil::Shared -{ -public: - - Subscriber(const SubscriberFactoryPtr&, const Ice::CommunicatorPtr&, - const TraceLevelsPtr&, const QueuedProxyPtr&); - ~Subscriber(); - - virtual bool persistent() const = 0; - - // - // Return true if the Subscriber is not active, false otherwise. - // - bool inactive() const; - - // - // Retrieve true if the Subscriber is in the error state, false - // otherwise. - // - bool error() const; - - // - // Retrieve the identity of the Subscriber. - // - Ice::Identity id() const; - - // - // Activate. Called after any other subscribers with the same - // identity have been deactivated. - // - virtual void activate(); - - // - // Unsubscribe. Mark the state as Unsubscribed. - // - virtual void unsubscribe(); - - // - // Unsubscribe. Mark the state as Replaced. - // - virtual void replace(); - - // - // Mark the state as reachable. - // - virtual void reachable() = 0; - - // - // Publish the given event. Mark the state as Error in the event of - // a problem. - // - virtual void publish(const EventPtr&) = 0; - -protected: - - // Immutable - const SubscriberFactoryPtr _factory; - const std::string _desc; - const TraceLevelsPtr _traceLevels; - const QueuedProxyPtr _obj; - - // - // Subscriber state. - // - enum State - { - // - // The Subscriber is active. - // - StateActive, - // - // The Subscriber encountered an error during event - // transmission. - // - StateError, - // - // The Subscriber has been unsubscribed. - // - StateUnsubscribed, - // - // The Subscriber has been replaced. - // - StateReplaced, - // - // The Subscriber is no longer reachable. - // - StateUnreachable - }; - - IceUtil::Mutex _stateMutex; - State _state; -}; - -typedef IceUtil::Handle<Subscriber> SubscriberPtr; - -} // End namespace IceStorm - -#endif |