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.
Diff: handle/dataLocation.h
- Revision:
- 5:eef5ea6a9916
- Parent:
- 4:c75d5e5e6bfc
- Child:
- 6:f0248eb6714d
diff -r c75d5e5e6bfc -r eef5ea6a9916 handle/dataLocation.h --- a/handle/dataLocation.h Tue Apr 01 15:52:08 2014 +0000 +++ b/handle/dataLocation.h Thu Apr 03 15:56:05 2014 +0000 @@ -1,3 +1,7 @@ +/** + * \brief Camera interface + **/ + #define MAXNUMLOCS 256 // Storage of data location @@ -6,11 +10,25 @@ // Current value of lat lon and alt double lat,lon,alt; public: + DataLocation(double latA,double lonA,double altA):lat(latA),lon(lonA),alt(altA){} double& getLat(){return lat;} double& getLon(){return lon;} double& getAlt(){return alt;} } +/// \brief Location holder type +enum LHType{ + LHType_locs=0, + LHType_targ, + LHType_base +}; + +/// \brief Location holder index type +enum LHIType{ + LHIType_head=0, + LHIType_size +}; + // Singleton location holder class LocHolder{ private: @@ -22,14 +40,27 @@ static DataLocation base[MAXNUMLOCS]; // Index of the head of the circular buffers static unsigned int headLocs,headTarg,headBase; + // Number of locations + static unsigned int sizeLocs,sizeTarg,sizeBase; public: - static DataLocation* getLocs(); - static DataLocation* getTarg(); - static DataLocation* getBase(); + /// \brief Get locations type + static DataLocation* get(LHType type); + + /// \brief Get Current value + DataLocation& getC(LHType type,int offset=0); + + /// \brief Get Index + unsigned int& getI(LHType type,LHIType indexType=LHIType_head); - DataLocation& getCurrentLocs(int offset=0); - DataLocation& getCurrentTarg(int offset=0); - DataLocation& getCurrentBase(int offset=0); + /// \brief Increment index + void inc(LHType type,int amount=1); + /// \brief Add data + void addLocs(DataLocation newLoc); + void addTarg(DataLocation newLoc); + void addBase(DataLocation newLoc); + void incLocs(int amount=1); + void incLocs(int amount=1); + void incLocs(int amount=1); }; \ No newline at end of file