ardupilot/libraries/AP_Common
DrZiplok@gmail.com 1a2ce433e1 I never liked the plan that variable groups could only be statically scoped; it was much too fragile. These changes address that issue by splitting the global variable list into two lists, one for standalone variables (including groups), and one for variables that are members of a group.
Now a variable belonging to a group can safely be constructed before the group it belongs to, and the group can be destroyed before its member variables.  This greatly simplifies the AP_Var constructor(s).

Remove the lookup-by-index and lookup-by-key interfaces to AP_Var and replace them with first/next interfaces for all variables, and for variables belonging to a specific group.  Document their usage.  Add an accessor for the key associated with a variable so that search-by-key can be performed by a consumer.  Throw away the lookup cache implementation, as it's not required anymore.

Re-layout the EEPROM variable header and tweak the EEPROM space allocator so that it's more resistant to interruptions during variable save.

Fix the global constants so that they work.

Add an interface for erasing all variables in EEPROM (only writes one byte).

Fix unit tests so that they work with the changed interfaces.  Also tweak the unit test framework so that it doesn't inline all its code.  This is a WIP - many more tests need to be written still.


git-svn-id: https://arducopter.googlecode.com/svn/trunk@1531 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-23 06:52:59 +00:00
..
examples I never liked the plan that variable groups could only be statically scoped; it was much too fragile. These changes address that issue by splitting the global variable list into two lists, one for standalone variables (including groups), and one for variables that are members of a group. 2011-01-23 06:52:59 +00:00
include Added inclusion guard to menu.h 2010-11-28 00:35:59 +00:00
AP_Common.cpp Drop a couple things in here in support of code moving to libraries. 2010-09-11 06:13:28 +00:00
AP_Common.h Add a new macro PROGMEM_STRING that can be used to define a constant string in program memory. 2011-01-10 01:42:59 +00:00
AP_Loop.cpp Added AP_Controller library. 2010-12-31 06:20:28 +00:00
AP_Loop.h Added AP_Controller library. 2010-12-31 06:20:28 +00:00
AP_MetaClass.cpp Formatting and naming changes for conformance with the ArduPilot Coding Conventions. 2011-01-16 09:14:21 +00:00
AP_MetaClass.h Add a templated version of AP_Meta_class::meta_type_id so that you can get a type ID for any named type without having to have an instance of the type lying around. Update the comments about caching type IDs to reflect its availability. 2011-01-23 06:44:07 +00:00
AP_Var.cpp I never liked the plan that variable groups could only be statically scoped; it was much too fragile. These changes address that issue by splitting the global variable list into two lists, one for standalone variables (including groups), and one for variables that are members of a group. 2011-01-23 06:52:59 +00:00
AP_Var.h I never liked the plan that variable groups could only be statically scoped; it was much too fragile. These changes address that issue by splitting the global variable list into two lists, one for standalone variables (including groups), and one for variables that are members of a group. 2011-01-23 06:52:59 +00:00
AP_Vector.h Added Loop class. 2010-12-24 23:59:10 +00:00
Arduino.mk Add the ability to find the sketchbook when called from a Makefile in a library example. 2011-01-02 22:16:21 +00:00
c++.cpp Added AP_Controller library. 2010-12-31 06:20:28 +00:00
c++.h Updated mavlink added eeprom class. 2010-12-23 23:02:51 +00:00
keywords.txt Add support for 'new' and 'delete', so we can cons things on the fly. 2010-10-17 04:02:06 +00:00
menu.cpp Move the warning controls for APM out to AP_Common. This makes it easier to grab these for libraries uniformly. 2010-11-27 23:27:08 +00:00