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

MetadataPlugin.h

00001 /*
00002    Copyright (C) 2002 the Strongroom project
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Lesser General Public
00006    License as published by the Free Software Foundation; either
00007    version 2.1 of the License, or (at your option) any later version.
00008 
00009    @author Wouter de Vries
00010    @author Ewald Snel
00011 */
00012 
00013 #ifndef __METADATAPLUGIN_H
00014 #define __METADATAPLUGIN_H
00015 
00016 #include <pthread.h>
00017 #include <map>
00018 
00019 #include <Common.h>
00020 #include <Document.h>
00021 #include <Error.h>
00022 #include <Plugin.h>
00023 
00024 // Defines the type and scope of the document lock
00025 enum DocumentLock
00026 {
00027     LOCK_UNLOCK = 0,            // Unlocked
00028     LOCK_DOCUMENT,              // Exclusive lock on entire document
00029     LOCK_REVISION,              // Exclusive lock on (one) revision
00030     LOCK_RENDITION              // Exclusive lock on (one) rendition
00031 };
00032 
00033 
00034 using namespace std;
00035 
00043 class MetadataPlugin : public Plugin
00044 {
00045 public:
00046     MetadataPlugin( const Config &cfg );
00047     virtual ~MetadataPlugin() = 0;
00048 
00055     virtual CoreError create( NumID &docid, const Document &document ) = 0;
00056 
00062     virtual CoreError remove( NumID docid ) = 0;
00063 
00070     virtual CoreError update( NumID docid, const Document &document ) = 0;
00071 
00078     virtual CoreError get( NumID docid, Document &document ) = 0;
00079 
00086     virtual CoreError lock( NumID docid, DocumentLock lock ) = 0;
00087 
00093     CoreError unlock( NumID docid );
00094 
00100     virtual CoreError getLocks( map<NumID,DocumentLock> &locks ) = 0;
00101 
00109     virtual CoreError query( NumID first, int maxlen, map<NumID,NumID> &updates ) = 0;
00110 };
00111 
00112 #endif

Generated on Wed Feb 18 13:45:55 2004 for strongroom by doxygen1.2.18