Browse Source

export template functions properly from DLL

David Rose 24 years ago
parent
commit
f5b2498898

+ 2 - 2
panda/src/graph/Sources.pp

@@ -43,7 +43,7 @@
      pt_NodeRelation.h setTransitionHelpers.T  \
      pt_NodeRelation.h setTransitionHelpers.T  \
      setTransitionHelpers.h transitionDirection.h  \
      setTransitionHelpers.h transitionDirection.h  \
      traverserVisitor.T traverserVisitor.h vector_PT_Node.h  \
      traverserVisitor.T traverserVisitor.h vector_PT_Node.h  \
-     vector_PT_NodeRelation.h vector_NodeRelation_star.h wrt.I \
+     vector_PT_NodeRelation.h vector_NodeRelation_star.h wrt.T \
      wrt.h
      wrt.h
 
 
    #define INCLUDED_SOURCES \
    #define INCLUDED_SOURCES \
@@ -97,7 +97,7 @@
     setTransitionHelpers.T setTransitionHelpers.h \
     setTransitionHelpers.T setTransitionHelpers.h \
     transitionDirection.h traverserVisitor.T traverserVisitor.h \
     transitionDirection.h traverserVisitor.T traverserVisitor.h \
     vector_PT_Node.h vector_PT_NodeRelation.h vector_NodeRelation_star.h \
     vector_PT_Node.h vector_PT_NodeRelation.h vector_NodeRelation_star.h \
-    wrt.I wrt.h
+    wrt.T wrt.h
 
 
   #define IGATESCAN all
   #define IGATESCAN all
 
 

+ 0 - 30
panda/src/graph/nodeTransitions.I

@@ -63,36 +63,6 @@ end() const {
   return _transitions.end();
   return _transitions.end();
 }
 }
 
 
-////////////////////////////////////////////////////////////////////
-//     Function: get_transition_into
-//  Description: This external template function is handy for
-//               extracting a transition of a particular type from the
-//               set.  If the transition exists, it is automatically
-//               downcasted to the correct type and stored in the
-//               pointer given in the first parameter, and the return
-//               value is true.  If the transition does not exist, the
-//               pointer is filled with NULL and the return value is
-//               false.
-////////////////////////////////////////////////////////////////////
-template<class Transition>
-INLINE_GRAPH bool
-get_transition_into(Transition *&ptr, const NodeTransitions &trans,
-                    TypeHandle transition_type) {
-  NodeTransition *nt = trans.get_transition(transition_type);
-  if (nt == (NodeTransition *)NULL) {
-    ptr = (Transition *)NULL;
-    return false;
-  }
-  DCAST_INTO_R(ptr, nt, false);
-  return true;
-}
-
-template<class Transition>
-INLINE_GRAPH bool
-get_transition_into(Transition *&ptr, const NodeTransitions &trans) {
-  return get_transition_into(ptr, trans, Transition::get_class_type());
-}
-
 INLINE_GRAPH ostream &operator << (ostream &out, const NodeTransitions &nts) {
 INLINE_GRAPH ostream &operator << (ostream &out, const NodeTransitions &nts) {
   nts.output(out);
   nts.output(out);
   return out;
   return out;

+ 11 - 0
panda/src/graph/nodeTransitions.h

@@ -88,8 +88,19 @@ private:
 
 
 INLINE_GRAPH ostream &operator << (ostream &out, const NodeTransitions &nts);
 INLINE_GRAPH ostream &operator << (ostream &out, const NodeTransitions &nts);
 
 
+template<class Transition>
+INLINE_GRAPH bool
+get_transition_into(Transition *&ptr, const NodeTransitions &trans,
+                    TypeHandle transition_type);
+
+template<class Transition>
+INLINE_GRAPH bool
+get_transition_into(Transition *&ptr, const NodeTransitions &trans);
+
 #ifndef DONT_INLINE_GRAPH
 #ifndef DONT_INLINE_GRAPH
 #include "nodeTransitions.I"
 #include "nodeTransitions.I"
 #endif
 #endif
 
 
+#include "nodeTransitions.T"
+
 #endif
 #endif

+ 1 - 1
panda/src/graph/wrt.I → panda/src/graph/wrt.T

@@ -1,4 +1,4 @@
-// Filename: wrt.I
+// Filename: wrt.T
 // Created by:  drose (26Oct98)
 // Created by:  drose (26Oct98)
 //
 //
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 1 - 3
panda/src/graph/wrt.h

@@ -146,8 +146,6 @@ wrt_subtree(NodeRelation *arc, Node *to, UpdateSeq as_of, UpdateSeq now,
 extern EXPCL_PANDA PStatCollector _wrt_pcollector;
 extern EXPCL_PANDA PStatCollector _wrt_pcollector;
 extern EXPCL_PANDA PStatCollector _wrt_subtree_pcollector;
 extern EXPCL_PANDA PStatCollector _wrt_subtree_pcollector;
 
 
-#ifndef DONT_INLINE_GRAPH
-#include "wrt.I"
-#endif
+#include "wrt.T"
 
 
 #endif
 #endif