Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

InMemoryPool.h

00001 // See the file LICENSE in the some directory as this file for legal
00002 // notices about this software.   
00003 // $Id: InMemoryPool_8h-source.html,v 1.8 2001/10/10 20:40:58 sandro Exp $
00004 #ifndef DEV_W3_ORG__2001_BLINDFOLD_SRC_INMEMORYPOOL_H
00005 #define DEV_W3_ORG__2001_BLINDFOLD_SRC_INMEMORYPOOL_H
00006 #include "config.h"
00007 
00008 
00009 #include "Pool.h"
00010 #include "SimpleVariableScope.h"
00011 
00012 #include <hash_set>
00013 
00034 class InMemoryPool : public Pool
00035 { 
00036       
00037 public:
00038 
00039     // STANDARD MEMBER FUNCTIONS
00040 
00041     InMemoryPool(VariableScope* scope = 0);
00042     InMemoryPool(const TripleSource& other);
00043     // to dangerous InMemoryPool(const InMemoryPool& other);
00044     const InMemoryPool& operator=(const InMemoryPool& other);
00045     bool operator==(const InMemoryPool& other) const;
00046     bool operator<(const InMemoryPool& other) const;
00047     size_t hash() const;
00048     friend std::ostream& operator<<(std::ostream& s, const InMemoryPool& me);
00049     // std::ostream& print_to(std::ostream& stream) const;  
00050     ~InMemoryPool();       
00051 
00052     // OVERRIDES AND IMPLEMENTS
00053     VariableScope* getScope() const {
00054     return scope;
00055     }
00056 
00057     // CLASS-SPECIFIC PUBLIC INTERFACE
00058 
00059     void add(Triple t);
00060 
00061     Triple fetch(Triple simplePattern, LoopState &loopState, unsigned long max_results=0) const;
00062 
00063     void remove(Triple);
00064 
00065     void replace(Symbol old, Symbol replacement);
00066 
00067     void addAll(const TripleSource& source);
00068 
00069     int size() { return triples.size(); }
00070 
00071 private:
00072 
00073     std::hash_set<Triple> triples;
00074     VariableScope* scope;
00075     bool scopeOwner;
00076 
00077 };     
00078 
00079 
00080 STANDARD_EXTERNAL(InMemoryPool)
00081 
00082 #endif   /* INMEMORYPOOL */  // -*-C++-*-

Home to blindfold. This page generated via doxygen 1.2.11.1 Wed Oct 10 16:40:33 2001.