Occurence.hpp

00001 #ifndef __FIBER__BUNDLE_OCCURENCE_HPP
00002 #define __FIBER__BUNDLE_OCCURENCE_HPP
00003 
00004 #include "Bundle.hpp"
00005 
00006 namespace Fiber
00007 {
00008 
00013 template <class T> struct Occurence;
00014 
00015 
00016 template <> struct BUNDLE_API Occurence<Slice>
00017 {
00018         double          time;
00019 
00020         Occurence(double t=0)
00021         : time(t)
00022         {}
00023 
00024         ~Occurence();
00025 };
00026 
00027 template <> struct BUNDLE_API Occurence<Grid> : public Occurence<Slice>
00028 {
00029         RefPtr<GridID>  TheGrid;
00030 
00031         Occurence(const Occurence<Slice>&OS, const RefPtr<GridID>&Gid)
00032         : Occurence<Slice>(OS)
00033         , TheGrid(Gid)
00034         {}
00035 
00036         Occurence()
00037         {}
00038 
00039         ~Occurence();
00040 };
00041 
00042 template <> struct BUNDLE_API Occurence<Skeleton> : public Occurence<Grid>
00043 {
00044         SkeletonID      TheSkeleton;
00045 
00046         Occurence(const Occurence<Grid>&OG, const SkeletonID&SID)
00047         : Occurence<Grid>(OG)
00048         , TheSkeleton(SID)
00049         {}
00050 
00051         Occurence()
00052         : TheSkeleton(0)
00053         {}
00054 
00055         ~Occurence();
00056 };
00057 
00058 template <> struct BUNDLE_API Occurence<Representation> : public Occurence<Skeleton>
00059 {
00060         Representer     theRepresenter;
00061 
00062         Occurence(const Occurence<Skeleton>&OS, const Representer&Rep)
00063         : Occurence<Skeleton>(OS)
00064         , theRepresenter(Rep)
00065         {}
00066 
00067         Occurence()
00068         {}
00069 
00070         ~Occurence();
00071 };
00072 
00073 template <> class BUNDLE_API Occurence<Bundle>
00074 {
00075         struct OccurenceMap; 
00076         OccurenceMap*ROM;
00077 
00078 public: 
00083         Occurence(const BundlePtr&, const RefPtr<StringList>&DoTheseGridsOnly = NullPtr() );    
00084 
00085         Occurence(const Bundle&, const RefPtr<StringList>&DoTheseGridsOnly = NullPtr() );
00086 
00087         ~Occurence();
00088 
00093         const Occurence<Representation>*operator()(const Representer&Rep) const;
00094 
00099         const Occurence<Skeleton>*operator()(const WeakPtr<Skeleton>&Rep) const;
00100 };
00101 
00102 
00103 } // namespace Fiber
00104 
00105 #endif // __FIBER__BUNDLE_OCCURENCE_HPP
00106