IceManagerImpl.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "IceManager.h"
4 
5 #include <Ice/Identity.h>
6 
7 #include <unordered_map>
8 #include <mutex>
9 
10 namespace armarx
11 {
12 
14  {
15  using ObjectRegistry = std::unordered_map<std::string, ObjectEntryPtr> ;
16  using ProxyMap = std::unordered_map<std::string, Ice::ObjectPrx> ;
17 
18  /**
19  * Application communicator
20  */
22 
23  /**
24  * IceStorm Topic Manager proxy
25  */
27 
28  /**
29  * TopicManager instantiation mutex
30  */
31  std::mutex topicManagerMutex;
32 
33  std::mutex proxyCacheMutex;
34 
35 
36  /**
37  * Ice grid admin instance used administrate component objects
38  * withing the IceGrid
39  */
41 
42  /**
43  * IceGridAdmin instantiation mutex
44  */
45  std::mutex iceGridAdminMutex;
46 
47  /**
48  * Session name
49  */
50  std::string name;
51 
52  /**
53  * Object registry which contains object dependecy and IceStorm
54  * topic information.
55  */
57 
58  /**
59  * Mutex for adding, activating and removing objects
60  */
61  std::mutex objectRegistryMutex;
62 
63  /**
64  * Retrieved and down casted checked proxies. If a requested proxy
65  * resides in this map, a unchecked cast solely is performed before
66  * returning the proxy.
67  */
69 
70  /**
71  * Suffix for all topics. This is mainly used to direct all topics to another, unused topic
72  * for replaying purposes.
73  */
74  std::string topicSuffix;
75  /**
76  * Retrieved topics map
77  */
78  std::map<std::string, IceStorm::TopicPrx> topics;
79 
80  /**
81  * Subscribed IceStorm topics
82  */
83  std::vector<std::pair<std::string, Ice::ObjectPrx> > subscriptions;
84 
85  /**
86  * Mutex for delayed topic retrieval and subscription registration
87  */
89 
90  /**
91  * Mutex for retrieving and subscribing topics
92  */
93  std::mutex topicRetrievalMutex;
94 
95  /**
96  * Mutex for retrieving and subscribing topics
97  */
99 
100  /**
101  * Flag of forcing shutdown procedure.
102  */
104  };
105 
106  struct IceManager::ObjectEntry : public IceUtil::Shared
107  {
109  name(std::string()),
110  proxy(nullptr),
111  adapter(nullptr),
112  updated(true),
113  dependenciesResolved(false),
114  active(false),
115  ownAdapter(true)
116  {
117  }
118 
119  std::string name;
121  Ice::ObjectPrx proxy;
123  TopicList usedTopics;
124  TopicList offeredTopics;
125  DependencyList dependencies;
126  bool updated;
128  bool active;
130  };
131 
132 }
armarx::IceManager::Impl::objectRegistryMutex
std::mutex objectRegistryMutex
Mutex for adding, activating and removing objects.
Definition: IceManagerImpl.h:61
armarx::IceManager::Impl::topicRetrievalMutex
std::mutex topicRetrievalMutex
Mutex for retrieving and subscribing topics.
Definition: IceManagerImpl.h:93
armarx::IceManager::ObjectEntry::id
Ice::Identity id
Definition: IceManagerImpl.h:120
armarx::IceManager::Impl::proxyCacheMutex
std::mutex proxyCacheMutex
Definition: IceManagerImpl.h:33
armarx::IceManager::Impl::topics
std::map< std::string, IceStorm::TopicPrx > topics
Retrieved topics map.
Definition: IceManagerImpl.h:78
armarx::IceManager::ObjectEntry
Definition: IceManagerImpl.h:106
armarx::IceManager::Impl::name
std::string name
Session name.
Definition: IceManagerImpl.h:50
armarx::IceManager::Impl::iceGridAdmin
IceGridAdminPtr iceGridAdmin
Ice grid admin instance used administrate component objects withing the IceGrid.
Definition: IceManagerImpl.h:40
armarx::IceManager::Impl::topicRegistrationMutex
std::mutex topicRegistrationMutex
Mutex for delayed topic retrieval and subscription registration.
Definition: IceManagerImpl.h:88
armarx::IceManager::ObjectEntry::proxy
Ice::ObjectPrx proxy
Definition: IceManagerImpl.h:121
armarx::IceManager::ObjectEntry::ownAdapter
bool ownAdapter
Definition: IceManagerImpl.h:129
armarx::IceManager::Impl::ProxyMap
std::unordered_map< std::string, Ice::ObjectPrx > ProxyMap
Definition: IceManagerImpl.h:16
armarx::IceManager::Impl::communicator
Ice::CommunicatorPtr communicator
Application communicator.
Definition: IceManagerImpl.h:21
armarx::IceManager::Impl
Definition: IceManagerImpl.h:13
IceInternal::Handle< ::Ice::Communicator >
armarx::IceManager::Impl::ObjectRegistry
std::unordered_map< std::string, ObjectEntryPtr > ObjectRegistry
Definition: IceManagerImpl.h:15
GfxTL::Identity
void Identity(MatrixXX< N, N, T > *a)
Definition: MatrixXX.h:523
armarx::IceManager::ObjectEntry::active
bool active
Definition: IceManagerImpl.h:128
armarx::IceManager::Impl::checkedProxies
ProxyMap checkedProxies
Retrieved and down casted checked proxies.
Definition: IceManagerImpl.h:68
armarx::IceManager::ObjectEntry::dependenciesResolved
bool dependenciesResolved
Definition: IceManagerImpl.h:127
armarx::IceManager::ObjectEntry::name
std::string name
Definition: IceManagerImpl.h:119
IceManager.h
armarx::IceManager::Impl::topicManagerProxy
IceStorm::TopicManagerPrx topicManagerProxy
IceStorm Topic Manager proxy.
Definition: IceManagerImpl.h:26
armarx::IceManager::ObjectEntry::dependencies
DependencyList dependencies
Definition: IceManagerImpl.h:125
armarx::IceManager::ObjectEntry::ObjectEntry
ObjectEntry()
Definition: IceManagerImpl.h:108
armarx::IceManager::Impl::topicSuffix
std::string topicSuffix
Suffix for all topics.
Definition: IceManagerImpl.h:74
armarx::IceManager::Impl::topicManagerMutex
std::mutex topicManagerMutex
TopicManager instantiation mutex.
Definition: IceManagerImpl.h:31
armarx::IceManager::ObjectEntry::usedTopics
TopicList usedTopics
Definition: IceManagerImpl.h:123
std
Definition: Application.h:66
IceUtil::Handle< IceGridAdmin >
armarx::IceManager::Impl::objectRegistry
ObjectRegistry objectRegistry
Object registry which contains object dependecy and IceStorm topic information.
Definition: IceManagerImpl.h:56
IceInternal::ProxyHandle< ::IceProxy::IceStorm::TopicManager >
armarx::IceManager::ObjectEntry::offeredTopics
TopicList offeredTopics
Definition: IceManagerImpl.h:124
armarx::IceManager::ObjectEntry::adapter
Ice::ObjectAdapterPtr adapter
Definition: IceManagerImpl.h:122
armarx::IceManager::Impl::forceShutdown
bool forceShutdown
Flag of forcing shutdown procedure.
Definition: IceManagerImpl.h:103
armarx::IceManager::ObjectEntry::updated
bool updated
Definition: IceManagerImpl.h:126
armarx::IceManager::Impl::iceGridAdminMutex
std::mutex iceGridAdminMutex
IceGridAdmin instantiation mutex.
Definition: IceManagerImpl.h:45
armarx::IceManager::Impl::subscriptions
std::vector< std::pair< std::string, Ice::ObjectPrx > > subscriptions
Subscribed IceStorm topics.
Definition: IceManagerImpl.h:83
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::IceManager::Impl::topicSubscriptionMutex
std::mutex topicSubscriptionMutex
Mutex for retrieving and subscribing topics.
Definition: IceManagerImpl.h:98