ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/CallbackFunctor.hpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/CallbackFunctor.hpp (file contents):
Revision 1248 by tim, Fri Jun 4 19:30:05 2004 UTC vs.
Revision 1252 by gezelter, Mon Jun 7 14:26:33 2004 UTC

# Line 12 | Line 12 | class CallbackFunctor{
12   class ConstraintRigidBody;
13  
14   class CallbackFunctor{
15 <  public:
16 <    typedef pair<TypeInfo, TypeInfo> KeyType;
17 <    typedef int (CallbackFunctor::*MappedType)(ConstraintElement*, ConstraintElement*);
18 <    typedef map<KeyType, MappedType> DoubleDispatchMap;
19 <    
20 <    ~CallbackFunctor(){}
21 <
22 <    //operator() is resiponsible for double dispatching
23 <    int operator()(ConstraintPair* consPair);
24 <
25 <    //double dispatch map can not store virtual function
26 <    //below functions are just wrapping functions which will be forwarded to virtual function
27 <    int constrainAtomAtom(ConstraintElement* ce1, ConstraintElement* ce2);
28 <    int constrainAtomRigidBody(ConstraintElement* ce1, ConstraintElement* ce2);
29 <    int constrainRigidBodyAtom(ConstraintElement* ce1, ConstraintElement* ce2);
30 <    int constrainRigidBodyRigidBody(ConstraintElement* ce1, ConstraintElement* ce2);
31 <    
32 <  protected:
33 <    CallbackFunctor(SimInfo* rhs);
34 <
35 <    void registerFunction(const KeyType& key, MappedType f);
36 <    
37 <    //
38 <    virtual int operator()(ConstraintAtom*, ConstraintAtom*) = 0;
39 <    virtual int operator()(ConstraintAtom*, ConstraintRigidBody*) = 0;
40 <    virtual int operator()(ConstraintRigidBody*, ConstraintRigidBody*) = 0;
41 <
42 <    SimInfo* info;
43 <    ConstraintPair* curPair;
44 <
45 <    DoubleDispatchMap ddMap;
46 <
47 <    const double consTolerance;
15 > public:
16 >  typedef pair<TypeInfo, TypeInfo> KeyType;
17 >  typedef int (CallbackFunctor::*MappedType)(ConstraintElement*, ConstraintElement*);
18 >  typedef map<KeyType, MappedType> DoubleDispatchMap;
19 >  
20 >  virtual ~CallbackFunctor(){}
21 >  
22 >  //operator() is resiponsible for double dispatching
23 >  int operator()(ConstraintPair* consPair);
24 >  
25 >  //double dispatch map can not store virtual function
26 >  //below functions are just wrapping functions which will be forwarded to virtual function
27 >  int constrainAtomAtom(ConstraintElement* ce1, ConstraintElement* ce2);
28 >  int constrainAtomRigidBody(ConstraintElement* ce1, ConstraintElement* ce2);
29 >  int constrainRigidBodyAtom(ConstraintElement* ce1, ConstraintElement* ce2);
30 >  int constrainRigidBodyRigidBody(ConstraintElement* ce1, ConstraintElement* ce2);
31 >  
32 > protected:
33 >  CallbackFunctor(SimInfo* rhs);
34 >  
35 >  void registerFunction(const KeyType& key, MappedType f);
36 >  
37 >  //
38 >  virtual int operator()(ConstraintAtom*, ConstraintAtom*) = 0;
39 >  virtual int operator()(ConstraintAtom*, ConstraintRigidBody*) = 0;
40 >  virtual int operator()(ConstraintRigidBody*, ConstraintRigidBody*) = 0;
41 >  
42 >  SimInfo* info;
43 >  ConstraintPair* curPair;
44 >  
45 >  DoubleDispatchMap ddMap;
46 >  
47 >  const double consTolerance;
48   };
49  
50   #endif //end ifndef _CALLBACK_FUNCTOR_H_

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines