iwtree.hh

Go to the documentation of this file.
00001 #ifndef __IW_TREE__
00002 #define __IW_TREE__
00003 
00004 #include "except.hh"
00005 #include "iwinfo.hh"
00006 #include "iwave.h"
00007 
00008 namespace TSOpt {
00009 
00010   using RVL::RVLException;
00011 
00012   // array of IWaveStates with ref object of same
00013   // type pointing to first half of array
00014   class IWaveTree {
00015   private:
00016     bool own;
00017     std::vector<IWAVE *> sa;
00018     std::vector<RDOM *> rd;
00019     IWaveTree * ref;
00020     // required for proper destruction
00021     IWaveInfo const & ic;
00022     IWaveTree();
00023     IWaveTree(IWaveTree const &);
00024     IWaveTree(std::vector<IWAVE *> sv, IWaveInfo const & _ic);
00025 
00026   public:
00027     IWaveTree(PARARRAY & _pars, FILE * _stream, IWaveInfo const & _ic,
00028           int order=0);
00029     ~IWaveTree();
00030     
00031     std::vector<IWAVE *> & getStateArray() { return sa; }
00032     std::vector<IWAVE *> const & getStateArray() const { return sa; }
00033     std::vector<IWAVE *> & getRefStateArray() { 
00034       if (ref) return ref->getStateArray();
00035       else {
00036     RVLException e;
00037     e<<"ERROR: IWaveTree::getRefStateArray()\n";
00038     e<<"  ref state not initialized - probably order = 0\n";
00039     e<<"  so no derivative so no reference state\n";
00040     throw e;
00041       }
00042     }
00043     std::vector<IWAVE *> const & getRefStateArray() const { 
00044       if (ref) {return ref->getStateArray(); }
00045       else {
00046     RVLException e;
00047     e<<"ERROR: IWaveTree::getRefStateArray()\n";
00048     e<<"  ref state not initialized - probably order = 0\n";
00049     e<<"  so no derivative so no reference state\n";
00050     throw e;
00051       }
00052     }
00053     std::vector<RDOM *> const & getRDOMArray() const { return rd; }
00054     std::vector<RDOM *> const & getRefRDOMArray() const { return ref->getRDOMArray(); }
00055 
00056     ostream & write(ostream & str) const {
00057       str<<"IWaveTree, length "<<sa.size()<<"\n";
00058       return str;
00059     }
00060   };
00061 }
00062 
00063 #endif

Generated on 5 Jan 2017 for IWAVECORE by  doxygen 1.4.7