#include <DBInterface.H>
Public Member Functions | |
DBInterface () | |
~DBInterface () | |
vector< seg_t * > * | getSegment (std::string routeid) |
Converts routeid into an int and then queries database for tuples with said routeid. Returns vector although we will always have only one segment. This is for continuity with the other methods and the helper methods. | |
vector< seg_t * > * | getStreetsAt (isect_t *i) |
Queries the database for all streets that either start or end with intersection i. Returns an STL vector of all queried matches, each match will be a filled streetSeg struct. Using STL vector because of ease of interface, the fact that this doesnt have to be sorted, and because insertion and removal at the end (the only type used in this case) is constant time, it becomes the most efficient thing to use. | |
vector< seg_t * > * | getPath (isect_t *from, isect_t *to) |
See DBInterface.H for more extensive comments. | |
vector< segComps_t * > * | getPathArcs (isect_t *from, isect_t *to) |
See DBInterface.H for more extensive comments. | |
vector< seg_t * > * | getMatches (std::vector< string > streetName, string town, string state, string zip, double address) |
Given user entered streetName, etc return all streetSegs that match the general description of the road given by the parameters. What elements are required of the parameters is dictated by the UI's form checking. If the number of matches exceeds what is easily displayable by UI this interface will return an error, and the user will be forced to reenter search terms. | |
int | addQuantRanking (seg_t *where, double shoulder_val, int numShoulder_val, double traffic_val, int numTraffic_val, double condition_val, int numCondition_val, double steepness_val, int numSteepness_val) |
given a streetSeg, and updated rankings information we will do a SQL insert or update to make the database reflect the new information on the road. Returns an int for error codes. Not per user of course as there are no users in BQ v1. Since there are many rankings per segment, the mechanism to addRanking is as follows: a call to getRanking is done to receive existing data on the road (the number of votes for shoulder, and the average of it, etc). With the current information, the rankings code will average the new information, add a vote to the total, and call addRanking() with the newly calculated information. | |
int | addQualRanking (seg_t *where, string comment, int commenttype, string author) |
Interface to add qualitative comments to bikequest database. Based on the enumeration in BQStructs, the caller will give what type of comment it is. This method, in addition to adding this to the database, will concatenate the current date to the comment. | |
seg_t * | getRanking (isect_t *from, isect_t *to) |
Given a street segment that starts with from, and ends with to, query the database for a row which meets the from, to criteria. Also fills out a streetSeg struct with the information returned. The data that is needed out of the street segment is its ranking information. The qualitative information from tables is parsed here, and put into a multimap for ease of information retrieval. | |
vector< segComps_t * > * | getArcs () |
Given a full path description we will traverse the linked list of street segments and return a string of comma separated values that are the exact point to point geometry of the streets in the path. Used by mapvis. Mapvis will parse the numbers sent back and convert the stateplane coordinates to their own xy coordinate plane. | |
Private Member Functions | |
pqxx::result | executeTransaction (pqxx::connection *c, std::string sql) |
pqxx::result | executeNonTransaction (pqxx::connection *c, std::string sql) |
pqxx::connection * | getConnection () |
pqxx::connection * | makeConnection () |
void | tryDisconnect (pqxx::connection *c) |
vector< seg_t * > * | processRDQUANTTuple (pqxx::result &R) |
void | addQUALResults (std::vector< seg_t * > *segvector, pqxx::connection *c) |
|
|
|
|
|
Interface to add qualitative comments to bikequest database. Based on the enumeration in BQStructs, the caller will give what type of comment it is. This method, in addition to adding this to the database, will concatenate the current date to the comment. SQL Structure: Deviations: |
Here is the call graph for this function:
|
|
Here is the call graph for this function:
|
given a streetSeg, and updated rankings information we will do a SQL insert or update to make the database reflect the new information on the road. Returns an int for error codes. Not per user of course as there are no users in BQ v1. Since there are many rankings per segment, the mechanism to addRanking is as follows: a call to getRanking is done to receive existing data on the road (the number of votes for shoulder, and the average of it, etc). With the current information, the rankings code will average the new information, add a vote to the total, and call addRanking() with the newly calculated information. SQL Structure: Deviations: |
Here is the call graph for this function:
|
|
|
|
|
Given a full path description we will traverse the linked list of street segments and return a string of comma separated values that are the exact point to point geometry of the streets in the path. Used by mapvis. Mapvis will parse the numbers sent back and convert the stateplane coordinates to their own xy coordinate plane. SQL Structure: Deviations: |
Here is the call graph for this function:
|
|
|
Given user entered streetName, etc return all streetSegs that match the general description of the road given by the parameters. What elements are required of the parameters is dictated by the UI's form checking. If the number of matches exceeds what is easily displayable by UI this interface will return an error, and the user will be forced to reenter search terms. SQL Structure: Deviations: |
Here is the call graph for this function:
|
See DBInterface.H for more extensive comments. SQL Structure: Deviations: |
Here is the call graph for this function:
|
See DBInterface.H for more extensive comments. SQL Structure: Deviations: |
Here is the call graph for this function:
|
Given a street segment that starts with from, and ends with to, query the database for a row which meets the from, to criteria. Also fills out a streetSeg struct with the information returned. The data that is needed out of the street segment is its ranking information. The qualitative information from tables is parsed here, and put into a multimap for ease of information retrieval. SQL Structure: Deviations: |
Here is the call graph for this function:
|
Converts routeid into an int and then queries database for tuples with said routeid. Returns vector although we will always have only one segment. This is for continuity with the other methods and the helper methods. SQL Structure: Deviations: |
Here is the call graph for this function:
|
Queries the database for all streets that either start or end with intersection i. Returns an STL vector of all queried matches, each match will be a filled streetSeg struct. Using STL vector because of ease of interface, the fact that this doesnt have to be sorted, and because insertion and removal at the end (the only type used in this case) is constant time, it becomes the most efficient thing to use. SQL Structure: Deviations: |
Here is the call graph for this function:
|
|
|
|
|
|