Hey,
can you help me to understand the code a little bit more?! In many files of the source code (e.g. FGWinds.cpp) I find something like this:
typedef double (FGWinds::*PMF)(int) const;
typedef int (FGWinds::*PMFt)(void) const;
typedef void (FGWinds::*PMFd)(int,double);
typedef void (FGWinds::*PMFi)(int);
typedef double (FGWinds::*Ptr)(void) const;
// User-specified steady, constant, wind properties (local navigational/geographic frame: N-E-D)
PropertyManager->Tie("atmosphere/psiw-rad", this, &FGWinds::GetWindPsi, &FGWinds::SetWindPsi);
PropertyManager->Tie("atmosphere/wind-north-fps", this, eNorth, (PMF)&FGWinds::GetWindNED,
(PMFd)&FGWinds::SetWindNED);
PropertyManager->Tie("atmosphere/wind-east-fps", this, eEast, (PMF)&FGWinds::GetWindNED,
(PMFd)&FGWinds::SetWindNED);
PropertyManager->Tie("atmosphere/wind-down-fps", this, eDown, (PMF)&FGWinds::GetWindNED,
(PMFd)&FGWinds::SetWindNED);
PropertyManager->Tie("atmosphere/wind-mag-fps", this, &FGWinds::GetWindspeed,
&FGWinds::SetWindspeed);
...
I don't really understand what is happening here. With my c++ knowledge I think that at the beginning new types called e.g. PMF are defined which refer to a pointer to a function. Later the PropertyManager is an Pointer to an object which activate the function Tie. Where is the PropertyManager defined? The function Tie seems to need some Inpurparameter like a path and always the Parameter this and so on. Sometimes you find the new types (e. g. PMFd) in this Parameterlist, too. I don't understand the connection between all this. Do I need to look into antoher file? Maybe some of you can explain what happens here and why it is implement in the code? Thank you very much in advance.
Best regards,
Sebastian
PS.: The Wikipedia entry under the topic PropertyManager didn't help me very much.