Fish.hpp

00001 #ifndef __FISH_BONE_FISH_HPP
00002 #define __FISH_BONE_FISH_HPP
00003 
00004 #include "fishboneDllApi.h"
00005 
00006 #include <ocean/plankton/VObject.hpp>
00007 #include <ocean/plankton/VTime.hpp>
00008 #include <ocean/shrimp/Range.hpp>
00009 
00010 #include <bundle/Bundle.hpp>
00011 #include "BundleInput.hpp"
00012 
00013 namespace Wizt
00014 {
00015         using std::pair;
00016 
00028 template <class FiberType>
00029         class Fish;
00030 
00031 typedef TypedSlot<Fiber::BundlePtr>     BundleSlot;
00032 
00080 template <>
00081 class   fishbone_API    Fish<VObject>
00082 {
00083 protected:
00084         VObject*myself; 
00085 
00095         Fish<VObject>(VObject*that);
00096 
00097 public:
00098 
00100         virtual ~Fish<VObject>(); 
00101 
00102         const char*FishName() const
00103         {
00104                 if (!myself)
00105                         return ""; 
00106 
00107                 return myself->Name().c_str();
00108         } 
00109 };
00110 
00114 template <>
00115 class   fishbone_API    Fish<double> : public virtual Fish<VObject>
00116 {
00117 public:
00118 
00120         Fish<double>(); 
00121 
00123         ~Fish<double>(); 
00124 
00128         virtual double getTime(const RefPtr<ValuePool>&VP, const RefPtr<Fiber::Bundle>&SpaceTime) const = 0;
00129 
00134         virtual int getMaxRefinementLevel(const RefPtr<ValuePool>&VP) const; 
00135         virtual int getMinRefinementLevel(const RefPtr<ValuePool>&VP) const;
00136 
00137         virtual Fiber::Info<Fiber::Skeleton>
00138                         getRefinementLevel(int Level,
00139                                            const RefPtr<ValuePool>&VP,
00140                                            int IndexDepth = 0,
00141                                            const Fiber::BundlePtr&SpaceTime = Fiber::BundlePtr(NullPtr() ) ) = 0; 
00142 
00149         struct  fishbone_API LevelIterator
00150         {
00152                 virtual ~LevelIterator() = 0; 
00153 
00157                 virtual bool apply(const RefPtr<Fiber::Representation>&CartesianLevelRep,
00158                                    double time, int Level,
00159                                    const RefPtr<Fiber::Grid>&GridWithCoarsetRefinementLevel, 
00160                                    const RefPtr<ValuePool>&Context) = 0;
00161         }; 
00162 
00167         bool    IterateLevels(LevelIterator&LI, const Fiber::Info<Fiber::Grid>&G, const RefPtr<ValuePool>&Context);
00168 };
00169 
00170 
00171 } // namespace Wizt
00172 
00173 #endif /* __FISH_BONE_FISH_HPP */
00174