20 #include <boost/unordered_map.hpp> 21 #include <boost/shared_ptr.hpp> 39 typedef std::map<std::string, std::map<std::string, std::vector<VoteSpecifierPtr> > >
ObjectToVoteMap;
41 typedef std::map<std::string, std::map<std::string, std::map<std::string, std::vector<VoteSpecifierPtr> > > >
PatternToObjectToVoteMap;
50 TableHelper(std::string dbfilename =
"record.sqlite");
54 void createTablesIfNecessary()
const;
55 void createColumnsIfNecessary();
56 void createTable(
const std::string& tablename,
const std::string& sql)
const;
57 void dropTable(
const std::string& tablename)
const;
58 void dropRecordTables()
const;
59 void dropTables()
const;
60 void dropModelTables()
const;
62 bool recordDataExists()
const;
63 bool modelDataExists()
const;
65 int getLastInsertId(
const std::string& tablename)
const;
67 const std::set<std::string> getObjectsInPattern(std::string pattern_name);
71 int insertRecordedObject(
const boost::shared_ptr<Object>& o,
int setId);
72 int insertRecordedObjectSet(
const boost::shared_ptr<ObjectSet>& os,
const std::string&
patternName);
73 int insertRecordedPattern(
const std::string&
patternName)
const;
82 int getRecordedPatternId(
const std::string&
patternName)
const;
83 int ensureRecordedPatternName(
const std::string&
patternName)
const;
90 std::vector<std::string> getRecordedPatternNames()
const;
93 const std::vector<int> getSetIds()
const;
94 const ObjectSetPtr getRecordedObjectSet(
int setId)
const;
98 int insertModelPattern(
const std::string&
patternName)
const;
99 int upsertModelPattern(
const std::string&
patternName,
int expectedMaxWeight)
const;
100 int insertModelObjectType(
const std::string& objectType)
const;
108 int getModelPatternId(
const std::string&
patternName)
const;
109 int getModelObjectTypeId(
const std::string& objectType)
const;
110 int ensureModelPatternName(
const std::string&
patternName)
const;
111 int ensureModelObjectType(
const std::string& objectType)
const;
118 std::vector<std::string> getModelPatternNames()
const;
120 const PatternNameToPatternMap getPatternDefinitionsByName(
const std::set<std::string>& patternNames)
const;
127 const std::set<std::string> getObjectTypes()
const;
134 const std::map<std::string, boost::filesystem::path> getRessourcePaths()
const;
136 const std::map<std::string, std::map<std::string, std::string>> getModelWeightsPerTypeAndId()
const;
143 const std::set<std::pair<std::string, std::string> > getObjectTypesAndIdsFromModelObjects()
const;
144 const std::set<std::pair<std::string, std::string> > getObjectTypesAndIdsFromRecordedObjects()
const;
145 const ObjectTypeToVoteMap getVoteSpecifiersForObjectTypes(
const std::set<std::string>& objectTypes)
const;
153 const std::set<std::pair<std::string, std::string> > getObjectTypesAndIdsBelongingToPattern(
const std::string&
patternName)
const;
162 const ObjectToVoteMap getVoteSpecifiersForPatternAndObjects(
const std::string&
patternName, std::set<std::pair<std::string, std::string> > objects)
const;
169 const std::vector<std::pair<int, ObjectPtr>> getAllMarkerObjects();
178 int updateObjectQuaternion(
int dbId,
ObjectPtr object);
180 int insertRecordedObjectIfNecessary(
ObjectPtr object);
181 boost::unordered_map<std::pair<std::string, std::string>,
int>
objectIdMap_;
boost::unordered_map< std::pair< std::string, std::string >, int > objectIdMap_
boost::shared_ptr< RecordedPattern > RecordedPatternPtr
boost::shared_ptr< TableHelper > TableHelperPtr
std::map< std::string, std::map< std::string, std::vector< VoteSpecifierPtr > > > ObjectToVoteMap
boost::shared_ptr< VoteSpecifier > VoteSpecifierPtr
boost::shared_ptr< ObjectSet > ObjectSetPtr
std::map< std::string, std::map< std::string, std::map< std::string, std::vector< VoteSpecifierPtr > > > > PatternToObjectToVoteMap
boost::shared_ptr< session > sqlite
std::map< std::string, PatternPtr > PatternNameToPatternMap
this namespace contains all generally usable classes.
std::map< std::string, std::vector< VoteSpecifierPtr > > ObjectTypeToVoteMap
boost::shared_ptr< Object > ObjectPtr