VR-Forces 4.1 Class Documentation
DtAgentDefinition.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2010 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtAgentDefinition.h,v $ $Revision: 1.15 $ $State: Exp $
7 ******************************************************************************/
8 
12 
13 #ifndef DtSceneObjectDefinition_H_
14 #define DtSceneObjectDefinition_H_
15 
16 #include <vrvCore/vrvCore.h>
18 #include <vrvUtil/templateUtil.h>
19 
20 #include <map>
21 #include <string>
22 
23 namespace makVrv
24 {
25 
26  class DtDe;
27 
35  template <typename ObjectClass>
37  {
38  public:
39 
40  typedef std::map<unsigned int,DtMessageMemberCall<ObjectClass>*> CallMap;
41 
43  DtAgentDefinition(const std::string& className)
44  {
46  }
47 
49  {
51  }
52 
54  virtual bool doCall(DtDe& de,unsigned int function,ObjectClass* o, DtMessage& message);
55 
57  virtual void handle(DtDe& de, ObjectClass* o,DtMessage& msg);
58 
60  virtual void bindFunction(unsigned int function,DtMessageMemberCall<ObjectClass>* member);
61 
62  virtual const std::string& className() const
63  {
64  return myClassName;
65  }
66 
67  virtual bool containsClassName(const std::string& className)
68  {
69  return myClassName == className;
70  }
71 
72  protected:
73  std::string myClassName;
75  };
76 
86  template <typename BaseClassDefinition, typename ObjectClass>
88  : public DtAgentDefinition<ObjectClass>
89  , public BaseClassDefinition
90  {
91  public:
92 
94  : DtAgentDefinition<ObjectClass>(className)
95  , BaseClassDefinition(className)
96  {
98  }
99 
101  {
103  }
104 
105  typedef std::map<unsigned int,DtMessageMemberCall<ObjectClass>*> CallMap;
106 
109  virtual bool doCall(DtDe& de,unsigned int function,ObjectClass* o, DtMessage& message);
110 
114  virtual void handle(DtDe& de,ObjectClass* o,DtMessage& msg);
115 
117  virtual void bindFunction(unsigned int function,DtMessageMemberCall<ObjectClass>* member);
118 
120  virtual const std::string& className() const
121  {
122  return myClassName;
123  }
124 
125  virtual bool containsClassName(const std::string& className)
126  {
127  return myClassName == className ||
130  }
131 
132  protected:
133  std::string myClassName;
135  };
136 }
137 
138 #define DtAgentDefinition_INL_
139 #include "DtAgentDefinition.inl"
140 #undef DtAgentDefinition_INL_
141 
142 #endif
143 

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)