TransientTopicI.h
Go to the documentation of this file.
1 // **********************************************************************
2 //
3 // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
4 //
5 // This copy of Ice is licensed to you under the terms described in the
6 // ICE_LICENSE file included in this distribution.
7 //
8 // **********************************************************************
9 
10 #ifndef TRANSIENT_TOPIC_I_H
11 #define TRANSIENT_TOPIC_I_H
12 
14 
15 namespace IceStorm
16 {
17 
18  // Forward declarations.
19  class Instance;
21 
22  class Subscriber;
24 
26  {
27  public:
28 
29  TransientTopicImpl(const InstancePtr&, const std::string&, const Ice::Identity&);
31 
32  virtual std::string getName(const Ice::Current&) const;
33  virtual Ice::ObjectPrx getPublisher(const Ice::Current&) const;
34  virtual Ice::ObjectPrx getNonReplicatedPublisher(const Ice::Current&) const;
35  virtual void subscribe(const QoS&, const Ice::ObjectPrx&, const Ice::Current&);
36  virtual Ice::ObjectPrx subscribeAndGetPublisher(const QoS&, const Ice::ObjectPrx&, const Ice::Current&);
37  virtual void unsubscribe(const Ice::ObjectPrx&, const Ice::Current&);
38  virtual TopicLinkPrx getLinkProxy(const Ice::Current&);
39  virtual void link(const TopicPrx&, Ice::Int, const Ice::Current&);
40  virtual void unlink(const TopicPrx&, const Ice::Current&);
41  virtual LinkInfoSeq getLinkInfoSeq(const Ice::Current&) const;
42  virtual Ice::IdentitySeq getSubscribers(const Ice::Current&) const;
43  virtual void destroy(const Ice::Current&);
44  virtual void reap(const Ice::IdentitySeq&, const Ice::Current&);
45 
46  // Internal methods
47  bool destroyed() const;
48  Ice::Identity id() const;
49  void publish(bool, const EventDataSeq&);
50 
51  void shutdown();
52 
53  private:
54 
55  //
56  // Immutable members.
57  //
58  const InstancePtr _instance;
59  const std::string _name; // The topic name
60  const Ice::Identity _id; // The topic identity
61 
62  /*const*/ Ice::ObjectPrx _publisherPrx;
63  /*const*/ TopicLinkPrx _linkPrx;
64 
65  //
66  // We keep a vector of subscribers since the optimized behaviour
67  // should be publishing events, not searching through the list of
68  // subscribers for a particular subscriber. I tested
69  // vector/list/map and although there was little difference vector
70  // was the fastest of the three.
71  //
72  std::vector<SubscriberPtr> _subscribers;
73 
74  bool _destroyed; // Has this Topic been destroyed?
75  };
76 
78 
79 } // End namespace IceStorm
80 
81 #endif
IceStorm::TransientTopicImpl::getSubscribers
virtual Ice::IdentitySeq getSubscribers(const Ice::Current &) const
Definition: TransientTopicI.cpp:472
IceStorm
Definition: DBTypes.ice:22
IceStorm::TransientTopicImpl::getPublisher
virtual Ice::ObjectPrx getPublisher(const Ice::Current &) const
Definition: TransientTopicI.cpp:149
IceStorm::TransientTopicImpl::TransientTopicImpl
TransientTopicImpl(const InstancePtr &, const std::string &, const Ice::Identity &)
Definition: TransientTopicI.cpp:97
IceStorm::EventDataSeq
std::deque< ::IceStorm::EventDataPtr > EventDataSeq
A sequence of EventData.
Definition: IceStormInternal.h:463
IceStormInternal.h
IceStorm::TransientTopicImpl::unlink
virtual void unlink(const TopicPrx &, const Ice::Current &)
Definition: TransientTopicI.cpp:407
IceStorm::TransientTopicImpl::unsubscribe
virtual void unsubscribe(const Ice::ObjectPrx &, const Ice::Current &)
Definition: TransientTopicI.cpp:323
IceStorm::TransientTopicImpl
Definition: TransientTopicI.h:25
IceStorm::TopicInternal::getLinkProxy
idempotent TopicLink * getLinkProxy()
Retrieve a proxy to the TopicLink interface.
IceStorm::TransientTopicImpl::getName
virtual std::string getName(const Ice::Current &) const
Definition: TransientTopicI.cpp:142
IceStorm::SubscriberPtr
IceUtil::Handle< Subscriber > SubscriberPtr
Definition: Subscriber.h:25
IceStorm::TransientTopicImpl::subscribe
virtual void subscribe(const QoS &, const Ice::ObjectPrx &, const Ice::Current &)
Definition: TransientTopicI.cpp:163
IceStorm::TransientTopicImpl::reap
virtual void reap(const Ice::IdentitySeq &, const Ice::Current &)
Definition: TransientTopicI.cpp:521
IceStorm::TopicInternal
Internal operations for a topic.
Definition: IceStormInternal.h:734
GfxTL::Identity
void Identity(MatrixXX< N, N, T > *a)
Definition: MatrixXX.h:523
IceStorm::TransientTopicImpl::id
Ice::Identity id() const
Definition: TransientTopicI.cpp:533
IceStorm::TransientTopicImpl::subscribeAndGetPublisher
virtual Ice::ObjectPrx subscribeAndGetPublisher(const QoS &, const Ice::ObjectPrx &, const Ice::Current &)
Definition: TransientTopicI.cpp:265
IceStorm::TransientTopicImpl::~TransientTopicImpl
~TransientTopicImpl()
Definition: TransientTopicI.cpp:137
IceStorm::InstancePtr
IceUtil::Handle< Instance > InstancePtr
Definition: Instance.h:126
IceStorm::TransientTopicImpl::publish
void publish(bool, const EventDataSeq &)
Definition: TransientTopicI.cpp:540
IceStorm::TransientTopicImpl::destroyed
bool destroyed() const
Definition: TransientTopicI.cpp:526
IceStorm::TransientTopicImpl::shutdown
void shutdown()
Definition: TransientTopicI.cpp:603
IceStorm::TransientTopicImpl::getLinkInfoSeq
virtual LinkInfoSeq getLinkInfoSeq(const Ice::Current &) const
Definition: TransientTopicI.cpp:452
IceUtil::Handle
Definition: forward_declarations.h:29
IceInternal::ProxyHandle< ::IceProxy::IceStorm::TopicLink >
IceStorm::TransientTopicImpl::link
virtual void link(const TopicPrx &, Ice::Int, const Ice::Current &)
Definition: TransientTopicI.cpp:368
armarx::VariantType::Int
const VariantTypeId Int
Definition: Variant.h:916
armarx::Mutex
boost::mutex Mutex
Definition: Synchronization.h:131
IceStorm::TransientTopicImpl::getNonReplicatedPublisher
virtual Ice::ObjectPrx getNonReplicatedPublisher(const Ice::Current &) const
Definition: TransientTopicI.cpp:156
IceStorm::TransientTopicImplPtr
IceUtil::Handle< TransientTopicImpl > TransientTopicImplPtr
Definition: TransientTopicI.h:77
IceStorm::TransientTopicImpl::destroy
virtual void destroy(const Ice::Current &)
Definition: TransientTopicI.cpp:485