VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtAgentFactory.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2009 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: DtAgentFactory.h,v $ $Revision: 1.13 $ $State: Exp $
7 *******************************************************************************/
8 
12 
13 #pragma once
14 
15 #include <vrvCore/vrvCore.h>
17 #include <vrvCore/DtUniqueID.h>
18 
19 #include <boost/unordered_map.hpp>
20 #include <string>
21 #include <list>
22 
23 namespace makVrv
24 {
25 
26  class DtDe;
27  class DtAgentManagerInterface;
28  class DtAgentUpdateResolverInterface;
29  class DtAgentCreator;
30  class DtAgent;
31 
37  {
38  public:
39 
41  {
42  public:
43  DtAutoUnregistrar( const std::string& className )
44  : myClassName( className )
45  {
46  };
47 
49  {
50  DtAgentFactory::autoUnregister( myClassName );
51  }
52  private:
53  std::string myClassName;
54  };
55 
56  typedef DtAgentCreator* (*AutoRegisterFunction)();
57 
59  static DtAgentFactory& instance(DtDe& de);
60 
62  virtual ~DtAgentFactory();
63 
66  virtual void registerAgentCreator(const std::string& className,
67  DtAgentCreator* creator);
68 
72  virtual DtAgent* createAgent(const std::string& className,
73  DtAgentManagerInterface& sceneInterface) const;
74 
78  virtual DtAgentUpdateResolverInterface* createResolver(const std::string& className, DtUniqueID id) const;
79 
81  virtual void processAutoUnregisters();
82 
84  static bool autoRegister(const std::string& className,AutoRegisterFunction function );
85  static void autoUnregister( const std::string& className );
86 
87  protected:
90  DtAgentFactory(DtDe& de);
91 
92 
93  protected:
94  typedef boost::unordered_map<std::string,DtAgentCreator*> RegistrationMap;
95  typedef boost::unordered_map<std::string,AutoRegisterFunction> AutoRegistrationMap;
96  typedef std::list<std::string> RemoveList;
97 
100 
102  static AutoRegistrationMap& autoTypes();
103  static RemoveList& removeTypes();
104  static bool& destructed();
105  };
106 }
Virtual base class.
Definition: DtVirtualBaseClass.h:22
Definition: DtAgentFactory.h:40
Abstract base class for object updaters.
Definition: DtAgentUpdateResolverInterface.h:23
A distributed object agent base class.
Definition: DtAgent.h:54
static void autoUnregister(const std::string &className)
std::string myClassName
Definition: DtAgentFactory.h:53
RegistrationMap myTypes
Definition: DtAgentFactory.h:99
DtAutoUnregistrar(const std::string &className)
Definition: DtAgentFactory.h:43
Contains makVrv::DtVirtualBaseClass class.
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
~DtAutoUnregistrar()
Definition: DtAgentFactory.h:48
unsigned long long DtUniqueID
Definition: DtUniqueID.h:22
Abstract base class for the scene object creators.
Definition: DtAgentCreator.h:30
Contains makVrv::DtUniqueID type.
DtDe & myDe
Definition: DtAgentFactory.h:98
The abstract interface necessary for agents.
Definition: DtAgentManagerInterface.h:36
The scene object creators are registered with the scene object factory for accessing DtSceneObjectCre...
Definition: DtAgentFactory.h:36
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
boost::unordered_map< std::string, DtAgentCreator * > RegistrationMap
Definition: DtAgentFactory.h:94
std::list< std::string > RemoveList
Definition: DtAgentFactory.h:96
boost::unordered_map< std::string, AutoRegisterFunction > AutoRegistrationMap
Definition: DtAgentFactory.h:95
Contains DLL export macros.

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)