00001 #ifndef ANAPHE_AIDADATAPOINTSETFACTORY
00002 #define ANAPHE_AIDADATAPOINTSETFACTORY 1
00003
00004
00005 #include "AIDA/IDataPointSetFactory.h"
00006
00007
00008 namespace AIDA {
00009 namespace Dev {
00010 class IDevTree;
00011 class IDevDataPointSetFactory;
00012 }
00013 }
00014
00015 namespace Anaphe {
00016 namespace AIDA_DataPointSet_native {
00017
00019
00020 class AIDA_DataPointSetFactory : virtual public AIDA::IDataPointSetFactory
00021 {
00022 public:
00023 AIDA_DataPointSetFactory( AIDA::Dev::IDevTree& tree, AIDA::Dev::IDevDataPointSetFactory& factory );
00025 ~AIDA_DataPointSetFactory() { ; }
00026
00027 AIDA::IDataPointSet* create( const std::string& name, const std::string& title, int dimensionOfPoint );
00028 AIDA::IDataPointSet* create( const std::string& name, int dimensionOfPoint );
00029 AIDA::IDataPointSet* createCopy( const std::string& name, const AIDA::IDataPointSet & original );
00030 bool destroy( AIDA::IDataPointSet * dataPointSet );
00031 AIDA::IDataPointSet* create( const std::string & name, const AIDA::IHistogram1D & h );
00032 AIDA::IDataPointSet* create( const std::string & name, const AIDA::IHistogram2D & h );
00033 AIDA::IDataPointSet* create( const std::string & name, const AIDA::IHistogram3D & h );
00034 AIDA::IDataPointSet* create( const std::string & name, const AIDA::ICloud1D & c );
00035 AIDA::IDataPointSet* create( const std::string & name, const AIDA::ICloud2D & c );
00036 AIDA::IDataPointSet* create( const std::string & name, const AIDA::ICloud3D & c );
00037 AIDA::IDataPointSet* create( const std::string & name, const AIDA::IProfile1D & p );
00038 AIDA::IDataPointSet* create( const std::string & name, const AIDA::IProfile2D & p );
00039 AIDA::IDataPointSet* add( const std::string & name, const AIDA::IDataPointSet& a, const AIDA::IDataPointSet& b );
00040 AIDA::IDataPointSet* subtract( const std::string & name, const AIDA::IDataPointSet& a, const AIDA::IDataPointSet& b );
00041 AIDA::IDataPointSet* multiply( const std::string & name, const AIDA::IDataPointSet& a, const AIDA::IDataPointSet& b );
00042 AIDA::IDataPointSet* divide( const std::string & name, const AIDA::IDataPointSet& a, const AIDA::IDataPointSet& b );
00043 AIDA::IDataPointSet* weightedMean( const std::string & name, const AIDA::IDataPointSet& a, const AIDA::IDataPointSet& b );
00044
00045 private:
00047 AIDA::Dev::IDevTree& m_tree;
00048 AIDA::Dev::IDevDataPointSetFactory& m_factory;
00049
00051 template< class T >
00052 T* registerObject( T* p, const std::string& name );
00053 };
00054
00055 }
00056 }
00057
00058 template< class T >
00059 inline T* Anaphe::AIDA_DataPointSet_native::AIDA_DataPointSetFactory::registerObject( T* p, const std::string& name ) {
00060 if ( p ) {
00061 p->setName( name );
00062 if ( ! m_tree.add( p ) ) {
00063 m_factory.destroy( p );
00064 p = 0;
00065 }
00066 }
00067 return p;
00068 }
00069
00070 #endif