Added functions to modify the Sorting Algorithm for PostedLinks.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5359 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2012-07-30 23:39:16 +00:00
parent 2ba3f73a74
commit 363374947f
2 changed files with 19 additions and 2 deletions

View File

@ -131,6 +131,12 @@ virtual bool getRankedPost(const uint32_t &token, RsPostedPost &post) = 0;
virtual bool extractPostedCache(const std::string &str, uint32_t &votes, uint32_t &comments) = 0;
// Control Ranking Calculations.
virtual bool setViewMode(uint32_t mode) = 0;
virtual bool setViewPeriod(uint32_t period) = 0;
virtual bool setViewRange(uint32_t first, uint32_t count) = 0;
// exposed for testing...
virtual float calcPostScore(const RsMsgMetaData &meta) = 0;

View File

@ -73,8 +73,8 @@ p3PostedService::p3PostedService(uint16_t type)
int p3PostedService::tick()
{
//std::cerr << "p3PostedService::tick()";
//std::cerr << std::endl;
std::cerr << "p3PostedService::tick()";
std::cerr << std::endl;
fakeprocessrequests();
@ -1267,8 +1267,12 @@ bool p3PostedService::addExtraDummyData()
*/
bool p3PostedService::setViewMode(uint32_t mode)
{
std::cerr << "p3PostedService::setViewMode() : " << mode;
std::cerr << std::endl;
RsStackMutex stack(mPostedMtx); /********** STACK LOCKED MTX ******/
mViewMode = mode;
@ -1278,6 +1282,9 @@ bool p3PostedService::setViewMode(uint32_t mode)
bool p3PostedService::setViewPeriod(uint32_t period)
{
std::cerr << "p3PostedService::setViewPeriod() : " << period;
std::cerr << std::endl;
RsStackMutex stack(mPostedMtx); /********** STACK LOCKED MTX ******/
mViewPeriod = period;
@ -1287,6 +1294,9 @@ bool p3PostedService::setViewPeriod(uint32_t period)
bool p3PostedService::setViewRange(uint32_t first, uint32_t count)
{
std::cerr << "p3PostedService::setViewRange() : " << first << " +" << count;
std::cerr << std::endl;
RsStackMutex stack(mPostedMtx); /********** STACK LOCKED MTX ******/
mViewStart = first;
@ -1563,6 +1573,7 @@ bool p3PostedService::processPosts()
{
std::cerr << "p3PostedService::processPosts() ERROR getting postList";
std::cerr << std::endl;
background_cleanup();
return false;
}