DEFINITIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-#define ID_PROPERTYMANAGER "$Id$"
+#define ID_PROPERTYMANAGER "$Id: FGPropertyManager.h,v 1.17 2010/07/08 11:36:28 jberndt Exp $"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FORWARD DECLARATIONS
{
private:
static bool suppress_warning;
+ static std::vector<std::string> tied_properties;
public:
/// Constructor
FGPropertyManager(void) {suppress_warning = false;}
*/
std::string GetFullyQualifiedName(void);
+ /**
+ * Get the qualified name of a node relative to given base path,
+ * otherwise the fully qualified name.
+ * This function is very slow, so is probably useful for debugging only.
+ *
+ * @param path The path to strip off, if found.
+ */
+ std::string GetRelativeName( const std::string &path = "/fdm/jsbsim/" );
+
/**
* Get a bool value for a property.
*
*/
void Untie (const std::string &name);
+ /**
+ * Unbind all properties bound by this manager to an external data source.
+ *
+ * Classes should use this function to release control of any
+ * properties they have bound using this property manager.
+ */
+ void Unbind (void);
// Templates cause ambiguity here
{
if (!tie(name.c_str(), SGRawValueFunctions<V>(getter, setter), useDefault))
std::cout << "Failed to tie property " << name << " to functions" << std::endl;
- else if (debug_lvl & 0x20)
- std::cout << name << std::endl;
+ else {
+ tied_properties.push_back(name);
+ if (debug_lvl & 0x20) std::cout << name << std::endl;
+ }
}
{
if (!tie(name.c_str(), SGRawValueFunctionsIndexed<V>(index, getter, setter), useDefault))
std::cout << "Failed to tie property " << name << " to indexed functions" << std::endl;
- else if (debug_lvl & 0x20)
- std::cout << name << std::endl;
+ else {
+ tied_properties.push_back(name);
+ if (debug_lvl & 0x20) std::cout << name << std::endl;
+ }
}
{
if (!tie(name.c_str(), SGRawValueMethods<T,V>(*obj, getter, setter), useDefault))
std::cout << "Failed to tie property " << name << " to object methods" << std::endl;
- else if (debug_lvl & 0x20)
- std::cout << name << std::endl;
+ else {
+ tied_properties.push_back(name);
+ if (debug_lvl & 0x20) std::cout << name << std::endl;
+ }
}
/**
{
if (!tie(name.c_str(), SGRawValueMethodsIndexed<T,V>(*obj, index, getter, setter), useDefault))
std::cout << "Failed to tie property " << name << " to indexed object methods" << std::endl;
- else if (debug_lvl & 0x20)
- std::cout << name << std::endl;
+ else {
+ tied_properties.push_back(name);
+ if (debug_lvl & 0x20) std::cout << name << std::endl;
+ }
}
};
}