CLASS IMPLEMENTATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-void checkTied ( FGPropertyManager *node )
-{
- int N = node->nChildren();
- string name;
-
- for (int i=0; i<N; i++) {
- if (node->getChild(i)->nChildren() ) {
- checkTied( (FGPropertyManager*)node->getChild(i) );
- }
- if ( node->getChild(i)->isTied() ) {
- name = ((FGPropertyManager*)node->getChild(i))->GetFullyQualifiedName();
- node->Untie(name);
- }
- }
-}
-
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
// Constructor
FGFDMExec::~FGFDMExec()
{
try {
- checkTied( instance );
+ Unbind();
DeAllocate();
if (IdFDM == 0) { // Meaning this is no child FDM
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-void FGPropertyManager::unbind(void)
+void FGPropertyManager::Unbind(void)
{
vector<string>::iterator it;
for (it = tied_properties.begin();it < tied_properties.end();it++)
void FGPropertyManager::Tie (const string &name, bool *pointer, bool useDefault)
{
- tied_properties.push_back(name);
if (!tie(name.c_str(), SGRawValuePointer<bool>(pointer), useDefault))
cerr << "Failed to tie property " << name << " to a pointer" << endl;
- else if (debug_lvl & 0x20)
- cout << name << endl;
+ else {
+ tied_properties.push_back(name);
+ if (debug_lvl & 0x20) std::cout << name << std::endl;
+ }
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGPropertyManager::Tie (const string &name, int *pointer,
bool useDefault )
{
- tied_properties.push_back(name);
if (!tie(name.c_str(), SGRawValuePointer<int>(pointer), useDefault))
cerr << "Failed to tie property " << name << " to a pointer" << endl;
- else if (debug_lvl & 0x20)
- cout << name << endl;
+ else {
+ tied_properties.push_back(name);
+ if (debug_lvl & 0x20) std::cout << name << std::endl;
+ }
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGPropertyManager::Tie (const string &name, long *pointer,
bool useDefault )
{
- tied_properties.push_back(name);
if (!tie(name.c_str(), SGRawValuePointer<long>(pointer), useDefault))
cerr << "Failed to tie property " << name << " to a pointer" << endl;
- else if (debug_lvl & 0x20)
- cout << name << endl;
+ else {
+ tied_properties.push_back(name);
+ if (debug_lvl & 0x20) std::cout << name << std::endl;
+ }
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGPropertyManager::Tie (const string &name, float *pointer,
bool useDefault )
{
- tied_properties.push_back(name);
if (!tie(name.c_str(), SGRawValuePointer<float>(pointer), useDefault))
cerr << "Failed to tie property " << name << " to a pointer" << endl;
- else if (debug_lvl & 0x20)
- cout << name << endl;
+ else {
+ tied_properties.push_back(name);
+ if (debug_lvl & 0x20) std::cout << name << std::endl;
+ }
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGPropertyManager::Tie (const string &name, double *pointer, bool useDefault)
{
- tied_properties.push_back(name);
if (!tie(name.c_str(), SGRawValuePointer<double>(pointer), useDefault))
cerr << "Failed to tie property " << name << " to a pointer" << endl;
- else if (debug_lvl & 0x20)
- cout << name << endl;
+ else {
+ tied_properties.push_back(name);
+ if (debug_lvl & 0x20) std::cout << name << std::endl;
+ }
}
} // namespace JSBSim
* Classes should use this function to release control of any
* properties they have bound using this property manager.
*/
- void unbind (void);
+ 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;
+ }
}
};
}