VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtChannelKeywordObjectManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2010 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvCore/vrvCore.h>
13 
16 
17 #include <boost/unordered_map.hpp>
18 #include <string>
19 #include <vector>
20 
21 namespace makVrv
22 {
23  class DtAgentManagerInterface;
24  class DtChannel;
25  class DtChannelKeywordObject;
26  class DtChannelConfiguration;
27  class DtWindowConfiguration;
28  class DtChannelManager;
29  class DtDe;
30  class DtWindowConfiguration;
31 
32 
36  {
37 
38  public:
39  // This is a map of channel keyword objects indexed by keyword name. each channel may
40  // have such a map
41  typedef boost::unordered_map<std::string, DtChannelKeywordObject*> ObjectMap;
42 
43  // This is a map of ObjectMaps, indexed by DisplayName :: WindowName :: ChannelName
44  typedef boost::unordered_map<std::string, ObjectMap> ChannelMap;
45 
46 
47  public:
50 
53 
56  static DtChannelKeywordObjectManager& instance( DtDe& de );
57 
59  const ChannelMap& channelMap() const;
60 
61  protected:
62 
63  // Signal Slots
64  virtual void slot_channelCreated( DtChannelManager*, DtChannel* );
65 
66  virtual void slot_channelToBeDestroyed( const std::string& deName,
67  const std::string& winName, const std::string& channelName );
68 
69  virtual void slot_channelConfigurationAdded( const std::string& deName,
70  const std::string& winName, const DtChannelConfiguration& config);
71 
72  virtual void slot_displayConfigurationRealized( const std::string& igName,
73  const std::string& displayName );
74 
75  virtual void slot_displayToBeDestroyed( const std::string& displayName );
76 
77  virtual void slot_channelConfigurationModified( const std::string& deName,
78  const std::string& winName, const std::string& oldChannelName,
79  const DtChannelConfiguration& config);
80 
81  virtual void slot_windowConfigurationModified( const std::string& deName,
82  const std::string& oldWindowName, const DtWindowConfiguration& config);
83 
84  // Helper methods
85  // we may get deName, windowName, and configuration in different ways, but once
86  // we have them, call this
87  virtual void processChannelConfiguration(const std::string& deName,
88  const std::string& winName, const DtChannelConfiguration& config );
89 
90  virtual std::string makeChannelKey( const std::string& deName,
91  const std::string& winName, const std::string& channelName );
92 
93  virtual std::string makeWindowKey( const std::string& deName,
94  const std::string& winName );
95 
96  virtual void addChannelKeywordObject( const std::string& channelKey,
97  const std::string& keyword, DtChannelKeywordObject* keywordObject );
98 
99  virtual void removeChannelKeywordObject( const std::string& channelKey,
100  const std::string& keyword );
101 
102  // Special case; can't use removeChannelKeywordObjects() because we're iterating over the
103  // object map, so this one method removes them all
104  virtual void removeAllChannelKeywordObjectsFromChannel( const std::string& channelKey );
105 
106  void addToWindowMap( const std::string& windowKey, const std::string& channelKey );
107 
108  void removeFromWindowMap( const std::string& windowKey, const std::string& channelKey );
109 
110  static std::string getChannelNameFromChannelKey( const std::string& channelKey );
111 
112  protected:
115  protected:
116 
117  // This is a map of channel key lists indexed by window key
118  // Given a deName/windowName, we can get all the channel keys for channels in that
119  // window that have compasses
120 
121  typedef std::vector<std::string> ChannelKeyList;
122  typedef boost::unordered_map<std::string, ChannelKeyList > WindowMap;
123 
126 
127  // This map provides a pointer to CompassMap given
128  // a DisplayName :: WindowName :: ChannelName string. The CompassMap
129  // can then provide a pointer to a compass based on keyword
131 
133 
134  };
135 
139  {
140 
141  public:
143  static DtChannelKeywordObjectManagerCreator& instance( DtDe& );
144 
146  static void registerInstance( DtDe& theIG, DtChannelKeywordObjectManagerCreator* anInstance );
147 
149  virtual DtChannelKeywordObjectManager* create( DtDe& );
150  };
151 }
152 
An object that manages 2D Channel-specific keyword-specified objects.
Definition: DtChannelKeywordObjectManager.h:35
The base class for all channel keyword objects.
Definition: DtChannelKeywordObject.h:25
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
ChannelMap myChannelMap
Definition: DtChannelKeywordObjectManager.h:130
DtSignalConnectionManager myConnections
Definition: DtChannelKeywordObjectManager.h:125
std::vector< std::string > ChannelKeyList
Definition: DtChannelKeywordObjectManager.h:121
boost::unordered_map< std::string, ChannelKeyList > WindowMap
Definition: DtChannelKeywordObjectManager.h:122
This owns a list of channel configurations.
Definition: DtWindowConfiguration.h:28
boost::unordered_map< std::string, ObjectMap > ChannelMap
Definition: DtChannelKeywordObjectManager.h:44
WindowMap myWindowMap
Definition: DtChannelKeywordObjectManager.h:132
The abstract Channel Class.
Definition: DtChannel.h:35
Contains makVrv::DtVirtualBaseClass class.
DtDe & myDe
Definition: DtChannelKeywordObjectManager.h:124
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
Compass Manager creator.
Definition: DtChannelKeywordObjectManager.h:138
boost::unordered_map< std::string, DtChannelKeywordObject * > ObjectMap
Definition: DtChannelKeywordObjectManager.h:41
Base class for handling DtChannels. Derived classes should override the tick() method and advance the...
Definition: DtChannelManager.h:32
Base class to provide boost signal/slot management.
Configuration for a single channel Serialized and sent to remote displays as necessary to configure r...
Definition: DtChannelConfiguration.h:26
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:70
Contains DLL export macros.

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)