VR-Forces 4.0.4 Class Documentation
include/vrvCore/DtBaseConnection.h
Go to the documentation of this file.
00001 /******************************************************************************
00002 ** Copyright (c) 2009 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 ******************************************************************************/
00005 /******************************************************************************
00006 ** $RCSfile: DtBaseConnection.h,v $ $Revision: 1.43 $ $State: Exp $
00007 ******************************************************************************/
00008 
00012 
00013 #pragma once
00014 #include <vrvCore/vrvCore.h>
00015 #include <vrvCore/DtUniqueID.h>
00016 #include <vrvUtil/DtRandomNumberGenerator.h>
00017 #include <vrvUtil/DtVirtualBaseClass.h>
00018 #include <vrvUtil/templateUtil.h>
00019 #include <vrvUtil/DtUnicode.h>
00020 
00021 #include <boost/unordered_map.hpp>
00022 
00023 #include <string>
00024 #include <map>
00025 
00026 namespace makVrv
00027 {
00028    class DtSharedSettingsManager;
00029    class DtAgentManagerInterface;
00030    class DtElementChanges;
00031    class DtElementAttribute;
00032    class DtBlinkingObjectManager;
00033    class DtTemporaryAgentManager;
00034 
00037    class DT_DLL_VRVCORE DtBaseConnection
00038    {
00039 
00040    public:
00042       DtBaseConnection(DtSharedSettingsManager&, DtAgentManagerInterface&);
00043 
00046       virtual ~DtBaseConnection();
00047 
00050       virtual void clearInstances();
00051 
00053       DtSharedSettingsManager& settingsManager();
00054 
00056       virtual DtAgentManagerInterface& sceneInterface();
00057 
00059       const DtSharedSettingsManager& settingsManager() const;
00060 
00062       void reportElementCreated(DtElementID id, DtElementID parentId, unsigned int type);
00063 
00064       //The attribute passed in should not be used again.
00065       void reportElementAttribute(DtElementID id, DtElementAttribute* attribute);
00066 
00068       void reportElementDestroyed(DtElementID id);
00069 
00071       const DtElementChanges& currentElementChanges() const;
00072 
00074       DtElementChanges* takeElementChanges();
00075 
00077       DtTemporaryAgentManager& temporaryEffects();
00078 
00080       DtBlinkingObjectManager& blinkManager();
00081 
00083       DtRandomNumberGenerator& randomNumberGenerator();
00084 
00086       virtual const std::string& tag()
00087       {
00088          const static std::string tagStr = "";
00089          return tagStr;
00090       }
00091 
00093       const DtUnicode& emptyString() const;
00094 
00100       virtual DtVirtualBaseClass* findInstance(const std::string& instanceName);
00101 
00115       inline bool destroyingInstances() const
00116       {
00117          return myDestroyingInstanceFlag;
00118       }
00119 
00122       virtual void registerInstance(const std::string& instanceName, 
00123          DtVirtualBaseClass* instance);
00124 
00125 
00126    protected:
00127 
00128       //Hold on to the shared simulation manager.
00129       DtSharedSettingsManager& mySettingsManagerCache;
00130 
00131       //The random number generator for the local simulation.
00132       DtRandomNumberGenerator myRandomNumberGenerator;
00133 
00134       //Thread specific Variables.  This variables are used by the second thread.
00135       //They should not be used in any functions in the main thread while the
00136       //secondary thread is running.
00137       DtAgentManagerInterface& mySceneInterface;
00138 
00139       //Internal working element changes
00140       DtElementChanges* myWorkingElementChanges;
00141 
00142       //Manager for temporary global effects.
00143       DtTemporaryAgentManager* myTemporaryEffects;
00144 
00146       DtBlinkingObjectManager* myBlinkManager;
00147 
00148       DtUnicode myEmptyString;
00149 
00150       typedef boost::unordered_map<std::string,DtVirtualBaseClass*> InstanceMap;
00151 
00152       //Stores a pointer to simulation specific instances.
00153       InstanceMap myInstances;
00154 
00155       //Flag to store if the connection is destroying the instances in it's 
00156       //DTOR
00157       bool myDestroyingInstanceFlag;
00158    };
00159 }

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)