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.
handle/dataLocation.cpp
- Committer:
- dylanembed123
- Date:
- 2014-04-01
- Revision:
- 4:c75d5e5e6bfc
- Child:
- 5:eef5ea6a9916
File content as of revision 4:c75d5e5e6bfc:
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)]; }