Rename members for clarity

This commit is contained in:
Vinnie Falco
2013-06-14 08:06:44 -07:00
parent 968768cdb8
commit 36bd8f7173
4 changed files with 23 additions and 10 deletions

View File

@@ -151,7 +151,7 @@ Pathfinder::Pathfinder(RLCache::ref cache,
theApp->getOrderBookDB().setup(mLedger); theApp->getOrderBookDB().setup(mLedger);
mLoadMonitor = theApp->getJobQueue().getLoadEvent(jtPATH_FIND, "FindPath"); m_loadEvent = theApp->getJobQueue().getLoadEvent(jtPATH_FIND, "FindPath");
// Construct the default path for later comparison. // Construct the default path for later comparison.

View File

@@ -70,7 +70,7 @@ private:
Ledger::pointer mLedger; Ledger::pointer mLedger;
PathState::pointer mPsDefault; PathState::pointer mPsDefault;
LoadEvent::pointer mLoadMonitor; LoadEvent::pointer m_loadEvent;
RLCache::pointer mRLCache; RLCache::pointer mRLCache;
boost::unordered_map<uint160, AccountItems::pointer> mRLMap; boost::unordered_map<uint160, AccountItems::pointer> mRLMap;

View File

@@ -21,8 +21,7 @@ Job::Job (JobType type,
, mJob (job) , mJob (job)
, mName (name) , mName (name)
{ {
// VFALCO NOTE what the heck does this do? m_loadEvent = boost::make_shared <LoadEvent> (boost::ref (lm), name, false);
mLoadMonitor = boost::make_shared <LoadEvent> (boost::ref (lm), name, false);
} }
JobType Job::getType() const JobType Job::getType() const
@@ -32,9 +31,15 @@ JobType Job::getType() const
void Job::doJob () void Job::doJob ()
{ {
mLoadMonitor->start(); m_loadEvent->start();
mJob (*this); mJob (*this);
mLoadMonitor->reName(mName);
// VFALCO TODO Isn't there a way to construct the load event with
// the proper name? This way the load event object
// can have the invariant "name is always set"
//
m_loadEvent->reName (mName);
} }
void Job::rename (std::string const& newName) void Job::rename (std::string const& newName)

View File

@@ -42,9 +42,18 @@ enum JobType
class Job class Job
{ {
public: public:
/** Default constructor.
// VFALCO TODO find out why these extra constructors are needed Allows Job to be used as a container type.
Job();
This is used to allow things like jobMap [key] = value.
*/
// VFALCO NOTE I'd prefer not to have a default constructed object.
// What is the semantic meaning of a Job with no associated
// function? Having the invariant "all Job objects refer to
// a job" would reduce the number of states.
//
Job ();
Job (JobType type, uint64 index); Job (JobType type, uint64 index);
@@ -73,8 +82,7 @@ private:
JobType mType; JobType mType;
uint64 mJobIndex; uint64 mJobIndex;
FUNCTION_TYPE <void (Job&)> mJob; FUNCTION_TYPE <void (Job&)> mJob;
// VFALCO TODO why is this called mLoadMonitor if the type is LoadEvent pointer? LoadEvent::pointer m_loadEvent;
LoadEvent::pointer mLoadMonitor;
std::string mName; std::string mName;
}; };