COOPY » Guide  version 0.6.5
/home/paulfitz/cvs/coopy_scm/coopy/src/libcoopy_core/include/coopy/IndexSniffer.h
Go to the documentation of this file.
00001 #ifndef COOPY_INDEX_SNIFFER
00002 #define COOPY_INDEX_SNIFFER
00003 
00004 #include <coopy/DataSheet.h>
00005 #include <coopy/CompareFlags.h>
00006 #include <coopy/NameSniffer.h>
00007 
00008 #include <vector>
00009 #include <string>
00010 
00011 namespace coopy {
00012   namespace store {
00013     class IndexSniffer;
00014   }
00015 }
00016 
00017 class coopy::store::IndexSniffer {
00018 private:
00019   const DataSheet& sheet;
00020   std::vector<int> flags;
00021   bool guessed;
00022   const coopy::cmp::CompareFlags& cflags;
00023   NameSniffer& sniffer;
00024 public:
00025  IndexSniffer(const DataSheet& sheet,
00026               const coopy::cmp::CompareFlags& cflags,
00027               NameSniffer& sniffer) : sheet(sheet),
00028     cflags(cflags), sniffer(sniffer) {
00029     guessed = false;
00030     sniff();
00031   }
00032   
00033   void sniff(); 
00034 
00035   // this is a poorly-named vector of primary key flags
00036   std::vector<int> suggestIndexes() const {
00037     return flags;
00038   }
00039 
00040   bool isGuessed() {
00041     return guessed;
00042   }
00043 };
00044 
00045 #endif
00046 
00047 
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines