Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

AIDA_StoreXML.h

Go to the documentation of this file.
00001 // Emacs -*- C++ -*-
00002 #ifndef ANAPHE_STOREXML
00003 #define ANAPHE_STOREXML 1
00004 
00005 #include <vector>
00006 #include <string>
00007 #include <map>
00008 #include <set>
00009 #include "AIDA_Dev/IStore.h"
00010 #include "AIDA_Dev/IBackingStore.h"
00011 
00012 // type ahead declarations 
00013 namespace AIDA {
00014   class IManagedObject;
00015   class ITuple;
00016   namespace Dev {
00017     class IDevManagedObject;
00018   }
00019 }
00020 
00021 namespace DataXML { 
00022   class DataObject; 
00023 }
00024 
00025 namespace Anaphe {
00026   namespace AIDA_XMLStore {
00027 
00028     class StoreTranslator; 
00029 
00031 
00032 class AIDA_StoreXML : virtual public AIDA::Dev::IStore,
00033                        virtual public AIDA::Dev::IBackingStore
00034 {
00035 public:
00037   AIDA_StoreXML( const std::string& name,
00038                  bool readOnly,
00039                  bool createNew,
00040                  const std::string& options );
00042   ~AIDA_StoreXML();
00043 
00045   const std::string& name() const;
00046   bool writeObject( const AIDA::IManagedObject& dataObject,
00047                     const std::string& path );
00048   AIDA::IManagedObject* copyAndWrite( const AIDA::IManagedObject& dataObject,
00049                                       const std::string& path );
00050   AIDA::IManagedObject* retrieveObject( const std::string & path );
00051   bool removeObject( const std::string& path );
00052   bool moveObject(const std::string& from, const std::string& to );
00053   bool commit();
00054   bool close();
00055   std::vector< std::string > listObjectPaths( const std::string directory,
00056                                               bool recursive = false ) const;
00057   std::vector< std::string > listObjectTypes( const std::string directory,
00058                                               bool recursive = false ) const;
00059   bool canMoveTuples() const;
00060   bool canCopyTuples() const;
00061 
00063   bool writeTupleHeader( AIDA::Dev::ITupleHeader& header );
00064   bool readTupleHeader( AIDA::Dev::ITupleHeader& header );
00065   bool bindVariable( AIDA::Dev::ITupleHeader& header, int variableIndex );
00066   void* variableAddress( AIDA::Dev::ITupleHeader& header, int variableIndex );
00067   const void* variableAddress( const AIDA::Dev::ITupleHeader& header, int variableIndex ) const;
00068   bool clearBindings( const AIDA::Dev::ITupleHeader& header );
00069   bool writeTupleRow( AIDA::Dev::ITupleHeader& header );
00070   bool readTupleRow( AIDA::Dev::ITupleHeader& header );  
00071   bool resetTuple( AIDA::Dev::ITupleHeader& header );
00072 
00073 private:
00074 
00075   // helper methods 
00076 
00078   bool readAllObjects( ); 
00080   AIDA::Dev::IDevManagedObject * createFromXML(const DataXML::DataObject * xmlObj, std::string & path); 
00082   bool writeToXML(AIDA::Dev::IDevManagedObject * object, const std::string & path); 
00083 
00084   std::string m_name;
00085   Anaphe::AIDA_XMLStore::StoreTranslator * m_outputTranslator; 
00086 
00087   std::map< std::string, std::string > m_objectTypes;
00088   std::map< std::string, AIDA::Dev::IDevManagedObject* > m_objectRefs;
00089   std::set< std::string > m_objectsToDelete;
00090   std::set< std::string > m_objectsToAdd;
00091   std::set< std::string > m_objectsToUpdate;
00092 
00093   bool m_compress; 
00094 
00095 };
00096 
00097   }
00098 }
00099 
00100 #endif /* ifndef ANAPHE_StoreXML */

Generated on Tue Nov 19 12:32:56 2002 for AIDA_XMLStore by doxygen1.2.16