Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of dgps by
Diff: handle/dataLocation.cpp
- Revision:
- 7:c75d5e5e6bfc
- Child:
- 9:da906eeac51e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/handle/dataLocation.cpp Tue Apr 01 15:52:08 2014 +0000 @@ -0,0 +1,34 @@ + + +DataLocation* LocHolder::locs=NULL; +DataLocation* LocHolder::targ=NULL; +DataLocation* LocHolder::base=NULL; + +DataLocation* LocHolder::getLocs(){ + if(locs==NULL)locs=new DataLocation[MAXNUMLOCS]; + return locs; +} + +DataLocation* LocHolder::getTarg(){ + if(targ==NULL)targ=new DataLocation[MAXNUMLOCS]; + return targ; +} + +DataLocation* LocHolder::getBase(){ + if(base==NULL)base=new DataLocation[MAXNUMLOCS]; + return base; +} + +unsigned int LocHolder::getRealIndex(int index,int offset=0){ + return (index+offset)%MAXNUMLOCS; +} + +DataLocation& LocHolder::getCurrentLocs(int offset=0){ + return getLocs()[getRealIndex(headLocs,offset)]; +} +DataLocation& LocHolder::getCurrentTarg(int offset=0){ + return getTarg()[getRealIndex(headTarg,offset)]; +} +DataLocation& LocHolder::getCurrentBase(int offset=0){ + return getBase()[getRealIndex(headBase,offset)]; +}