VR-Forces 4.1.1 Class Documentation
DtChannelKeywordObjectManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2010 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtChannelKeywordObjectManager.h,v $ $Revision: 1.23 $ $State: Exp $
7 ******************************************************************************/
8 
12 
13 #pragma once
14 
15 #include <vrvCore/vrvCore.h>
16 
19 
20 #include <boost/unordered_map.hpp>
21 #include <string>
22 #include <vector>
23 
24 namespace makVrv
25 {
26  class DtAgentManagerInterface;
27  class DtChannel;
28  class DtChannelKeywordObject;
29  class DtChannelConfiguration;
30  class DtWindowConfiguration;
31  class DtChannelManager;
32  class DtDe;
33  class DtWindowConfiguration;
34 
35 
39  {
40 
41  public:
42  // This is a map of channel keyword objects indexed by keyword name. each channel may
43  // have such a map
44  typedef boost::unordered_map<std::string, DtChannelKeywordObject*> ObjectMap;
45 
46  // This is a map of ObjectMaps, indexed by DisplayName :: WindowName :: ChannelName
47  typedef boost::unordered_map<std::string, ObjectMap> ChannelMap;
48 
49 
50  public:
53 
56 
59  static DtChannelKeywordObjectManager& instance( DtDe& de );
60 
62  const ChannelMap& channelMap() const;
63 
64  protected:
65 
66  // Signal Slots
67  virtual void slot_channelCreated( DtChannelManager*, DtChannel* );
68 
69  virtual void slot_channelToBeDestroyed( const std::string& deName,
70  const std::string& winName, const std::string& channelName );
71 
72  virtual void slot_channelConfigurationAdded( const std::string& deName,
73  const std::string& winName, const DtChannelConfiguration& config);
74 
75  virtual void slot_displayConfigurationRealized( const std::string& igName,
76  const std::string& displayName );
77 
78  virtual void slot_displayToBeDestroyed( const std::string& displayName );
79 
80  virtual void slot_channelConfigurationModified( const std::string& deName,
81  const std::string& winName, const std::string& oldChannelName,
82  const DtChannelConfiguration& config);
83 
84  virtual void slot_windowConfigurationModified( const std::string& deName,
85  const std::string& oldWindowName, const DtWindowConfiguration& config);
86 
87  // Helper methods
88  // we may get deName, windowName, and configuration in different ways, but once
89  // we have them, call this
90  virtual void processChannelConfiguration(const std::string& deName,
91  const std::string& winName, const DtChannelConfiguration& config );
92 
93  virtual std::string makeChannelKey( const std::string& deName,
94  const std::string& winName, const std::string& channelName );
95 
96  virtual std::string makeWindowKey( const std::string& deName,
97  const std::string& winName );
98 
99  virtual void addChannelKeywordObject( const std::string& channelKey,
100  const std::string& keyword, DtChannelKeywordObject* keywordObject );
101 
102  virtual void removeChannelKeywordObject( const std::string& channelKey,
103  const std::string& keyword );
104 
105  // Special case; can't use removeChannelKeywordObjects() because we're iterating over the
106  // object map, so this one method removes them all
107  virtual void removeAllChannelKeywordObjectsFromChannel( const std::string& channelKey );
108 
109  void addToWindowMap( const std::string& windowKey, const std::string& channelKey );
110 
111  void removeFromWindowMap( const std::string& windowKey, const std::string& channelKey );
112 
113  static std::string getChannelNameFromChannelKey( const std::string& channelKey );
114 
115  protected:
118  protected:
119 
120  // This is a map of channel key lists indexed by window key
121  // Given a deName/windowName, we can get all the channel keys for channels in that
122  // window that have compasses
123 
124  typedef std::vector<std::string> ChannelKeyList;
125  typedef boost::unordered_map<std::string, ChannelKeyList > WindowMap;
126 
129 
130  // This map provides a pointer to CompassMap given
131  // a DisplayName :: WindowName :: ChannelName string. The CompassMap
132  // can then provide a pointer to a compass based on keyword
134 
136 
137  };
138 
142  {
143 
144  public:
146  static DtChannelKeywordObjectManagerCreator& instance( DtDe& );
147 
149  static void registerInstance( DtDe& theIG, DtChannelKeywordObjectManagerCreator* anInstance );
150 
152  virtual DtChannelKeywordObjectManager* create( DtDe& );
153  };
154 }
155 

Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)