Represents a CSL model as it is saved on disk.
More...
#include <CSLModels.h>
|
| | CSLModel () |
| | Constructor.
|
| |
| | CSLModel (CSLModel &&o)=default |
| | Generate standard move constructor.
|
| |
| CSLModel & | operator= (CSLModel &&o)=default |
| |
| virtual | ~CSLModel () |
| | Destructor frees resources.
|
| |
| void | AddMatchCriteria (const std::string &_type, const MatchCritTy &_matchCrit, int lnNr) |
| | Set the a/c type model and add other match criteria.
|
| |
| void | CompModelName () |
| | Puts together the model name string from a path component and shortId
|
| |
| bool | IsValid () const |
| | Minimum requirement for using this object is: id, type, path.
|
| |
| const std::string & | GetShortId () const |
| | short id, just an arbitrary label read from xsb_aircraft.txt::OBJ8_AIRCRAFT
|
| |
| const std::string & | GetId () const |
| | full id: package name / shortId, expected to be unique
|
| |
| const std::string & | GetModelName () const |
| | name, formed by last part of path plus id (human readable, but not guaranteed to be unique)
|
| |
| const std::string & | GetIcaoType () const |
| | ICAO aircraft type this model represents: xsb_aircraft.txt::ICAO
|
| |
| const std::string & | GetIcaoAirline () const |
| | ICAO Airline code this model represents: xsb_aircraft.txt::AIRLINE
|
| |
| const std::string & | GetLivery () const |
| | Livery code this model represents: xsb_aircraft.txt::LIVERY
|
| |
| int | GetRelatedGrp () const |
| | "related" group for this model (a group of alike plane models), or 0
|
| |
| std::string | GetKeyString () const |
| | compiles the string used as key in the CSL model map
|
| |
| const Doc8643 & | GetDoc8643 () const |
| | Classification (like "L2P" or "L4J") and WTC (like "H" or "L/M")
|
| |
| const char * | GetWTC () const |
| | Wake turbulence category.
|
| |
| char | GetClassType () const |
| |
| char | GetClassNumEng () const |
| |
| int | GetNumEngines () const |
| |
| char | GetClassEngType () const |
| |
| bool | HasRotor () const |
| |
| float | GetVertOfs () const |
| | Vertical Offset to be applied to aircraft model.
|
| |
| ObjLoadStateTy | GetObjState () const |
| | (Minimum) )State of the X-Plane objects: Is it being loaded or available?
|
| |
| bool | IsObjInvalid () const |
| | (Minimum) )State of the X-Plane object: Is it invalid?
|
| |
| std::list< XPLMObjectRef > | GetAllObjRefs () |
| | Try get ALL object handles, only returns anything if it is the complete list.
|
| |
| void | IncRefCnt () |
| | Increase the reference counter for Aircraft usage.
|
| |
| void | DecRefCnt () |
| | Decrease the reference counter for Aircraft usage.
|
| |
| unsigned | GetRefCnt () const |
| | Current reference counter.
|
| |
|
| static float | GarbageCollection (float inElapsedSinceLastCall, float inElapsedTimeSinceLastFlightLoop, int inCounter, void *inRefcon) |
| | Unload all objects which haven't been used for a while.
|
| |
|
| std::string | shortId |
| | short id, just an arbitrary label read from xsb_aircraft.txt::OBJ8_AIRCRAFT
|
| |
| std::string | cslId |
| | full id: package name / shortId, expected to be unique
|
| |
| std::string | modelName |
| | name, formed by last part of path plus id
|
| |
| std::uint16_t | pkgHash = 0 |
| | simple hash of package name, for easy matching in networked setup
|
| |
| MatchCritVecTy | vecMatchCrit |
| | further match-relevant fields like airline and livery can be a list
|
| |
| listCSLObjTy | listObj |
| | list of objects representing this model
|
| |
| float | vertOfs = 3.0f |
| | Vertical offset to be applied [m].
|
| |
| bool | bVertOfsReadFromFile = true |
| | Shall we try reading vertOfs from the OBJ8 file if we need this a/c?
|
| |
| std::string | xsbAircraftPath |
| | Path to the xsb_aircraft.txt file from where this model is loaded.
|
| |
| int | xsbAircraftLn = 0 |
| | Line number in the xsb_aircraft.txt file where the model definition starts.
|
| |
|
| std::string | icaoType |
| | ICAO aircraft type this model represents: xsb_aircraft.txt::ICAO
|
| |
| const Doc8643 * | doc8643 = nullptr |
| | Proper Doc8643 entry for this model.
|
| |
| int | related = 0 |
| | "related" group for this model (a group of alike plane models), or 0
|
| |
| unsigned | refCnt = 0 |
| | Reference counter: Number of Aircraft actively using this model.
|
| |
| float | refZeroTs = 0.0f |
| | Time point when refCnt reached 0 (used in garbage collection, in terms of XP's total running time)
|
| |
| std::future< float > | futVertOfs |
| | future for asynchronously reading vertOfs
|
| |
Represents a CSL model as it is saved on disk.
◆ MatchCritVecTy
Vector of match-relevant fields.
◆ CSLModel() [1/2]
| XPMP2::CSLModel::CSLModel |
( |
| ) |
|
|
inline |
◆ CSLModel() [2/2]
| XPMP2::CSLModel::CSLModel |
( |
CSLModel && | o | ) |
|
|
default |
Generate standard move constructor.
◆ ~CSLModel()
| XPMP2::CSLModel::~CSLModel |
( |
| ) |
|
|
virtual |
Destructor frees resources.
◆ AddMatchCriteria()
| void XPMP2::CSLModel::AddMatchCriteria |
( |
const std::string & | _type, |
|
|
const MatchCritTy & | _matchCrit, |
|
|
int | lnNr ) |
Set the a/c type model and add other match criteria.
Also fills doc8643 and related. Keeps most significant match criteria only (if "DLH/-" and "DLH/D-ABCD" are defined, then only "DLH/D-ABCD" is kept as that covers the "DLH/-" case, too)
◆ CompModelName()
| void XPMP2::CSLModel::CompModelName |
( |
| ) |
|
Puts together the model name string from a path component and shortId
◆ DecRefCnt()
| void XPMP2::CSLModel::DecRefCnt |
( |
| ) |
|
Decrease the reference counter for Aircraft usage.
◆ FetchVertOfsFromObjFile()
| float XPMP2::CSLModel::FetchVertOfsFromObjFile |
( |
| ) |
const |
|
protected |
Read the obj files to fill CSLModel::vertOfs.
- Note
- Expected to be called in a separate thread via std::async
◆ GarbageCollection()
| float XPMP2::CSLModel::GarbageCollection |
( |
float | inElapsedSinceLastCall, |
|
|
float | inElapsedTimeSinceLastFlightLoop, |
|
|
int | inCounter, |
|
|
void * | inRefcon ) |
|
static |
Unload all objects which haven't been used for a while.
◆ GetAllObjRefs()
| std::list< XPLMObjectRef > XPMP2::CSLModel::GetAllObjRefs |
( |
| ) |
|
Try get ALL object handles, only returns anything if it is the complete list.
This starts async loading of all objects.
◆ GetClassEngType()
| char XPMP2::CSLModel::GetClassEngType |
( |
| ) |
const |
|
inline |
◆ GetClassNumEng()
| char XPMP2::CSLModel::GetClassNumEng |
( |
| ) |
const |
|
inline |
◆ GetClassType()
| char XPMP2::CSLModel::GetClassType |
( |
| ) |
const |
|
inline |
◆ GetDoc8643()
| const Doc8643 & XPMP2::CSLModel::GetDoc8643 |
( |
| ) |
const |
|
inline |
Classification (like "L2P" or "L4J") and WTC (like "H" or "L/M")
◆ GetIcaoAirline()
| const std::string & XPMP2::CSLModel::GetIcaoAirline |
( |
| ) |
const |
|
inline |
ICAO Airline code this model represents: xsb_aircraft.txt::AIRLINE
◆ GetIcaoType()
| const std::string & XPMP2::CSLModel::GetIcaoType |
( |
| ) |
const |
|
inline |
ICAO aircraft type this model represents: xsb_aircraft.txt::ICAO
◆ GetId()
| const std::string & XPMP2::CSLModel::GetId |
( |
| ) |
const |
|
inline |
full id: package name / shortId, expected to be unique
◆ GetKeyString()
| std::string XPMP2::CSLModel::GetKeyString |
( |
| ) |
const |
compiles the string used as key in the CSL model map
◆ GetLivery()
| const std::string & XPMP2::CSLModel::GetLivery |
( |
| ) |
const |
|
inline |
Livery code this model represents: xsb_aircraft.txt::LIVERY
◆ GetModelName()
| const std::string & XPMP2::CSLModel::GetModelName |
( |
| ) |
const |
|
inline |
name, formed by last part of path plus id (human readable, but not guaranteed to be unique)
◆ GetNumEngines()
| int XPMP2::CSLModel::GetNumEngines |
( |
| ) |
const |
|
inline |
◆ GetObjState()
(Minimum) )State of the X-Plane objects: Is it being loaded or available?
◆ GetRefCnt()
| unsigned XPMP2::CSLModel::GetRefCnt |
( |
| ) |
const |
|
inline |
Current reference counter.
◆ GetRelatedGrp()
| int XPMP2::CSLModel::GetRelatedGrp |
( |
| ) |
const |
|
inline |
"related" group for this model (a group of alike plane models), or 0
◆ GetShortId()
| const std::string & XPMP2::CSLModel::GetShortId |
( |
| ) |
const |
|
inline |
short id, just an arbitrary label read from xsb_aircraft.txt::OBJ8_AIRCRAFT
◆ GetVertOfs()
| float XPMP2::CSLModel::GetVertOfs |
( |
| ) |
const |
|
inline |
Vertical Offset to be applied to aircraft model.
◆ GetWTC()
| const char * XPMP2::CSLModel::GetWTC |
( |
| ) |
const |
|
inline |
Wake turbulence category.
◆ HasRotor()
| bool XPMP2::CSLModel::HasRotor |
( |
| ) |
const |
|
inline |
◆ IncRefCnt()
| void XPMP2::CSLModel::IncRefCnt |
( |
| ) |
|
|
inline |
Increase the reference counter for Aircraft usage.
◆ IsObjInvalid()
| bool XPMP2::CSLModel::IsObjInvalid |
( |
| ) |
const |
|
inline |
(Minimum) )State of the X-Plane object: Is it invalid?
◆ IsValid()
| bool XPMP2::CSLModel::IsValid |
( |
| ) |
const |
|
inline |
Minimum requirement for using this object is: id, type, path.
◆ operator=()
◆ Unload()
| void XPMP2::CSLModel::Unload |
( |
| ) |
|
|
protected |
◆ bVertOfsReadFromFile
| bool XPMP2::CSLModel::bVertOfsReadFromFile = true |
Shall we try reading vertOfs from the OBJ8 file if we need this a/c?
◆ cslId
| std::string XPMP2::CSLModel::cslId |
full id: package name / shortId, expected to be unique
◆ doc8643
| const Doc8643* XPMP2::CSLModel::doc8643 = nullptr |
|
protected |
Proper Doc8643 entry for this model.
◆ futVertOfs
| std::future<float> XPMP2::CSLModel::futVertOfs |
|
protected |
future for asynchronously reading vertOfs
◆ icaoType
| std::string XPMP2::CSLModel::icaoType |
|
protected |
ICAO aircraft type this model represents: xsb_aircraft.txt::ICAO
◆ listObj
list of objects representing this model
◆ modelName
| std::string XPMP2::CSLModel::modelName |
name, formed by last part of path plus id
◆ pkgHash
| std::uint16_t XPMP2::CSLModel::pkgHash = 0 |
simple hash of package name, for easy matching in networked setup
◆ refCnt
| unsigned XPMP2::CSLModel::refCnt = 0 |
|
protected |
Reference counter: Number of Aircraft actively using this model.
◆ refZeroTs
| float XPMP2::CSLModel::refZeroTs = 0.0f |
|
protected |
Time point when refCnt reached 0 (used in garbage collection, in terms of XP's total running time)
◆ related
| int XPMP2::CSLModel::related = 0 |
|
protected |
"related" group for this model (a group of alike plane models), or 0
◆ shortId
| std::string XPMP2::CSLModel::shortId |
short id, just an arbitrary label read from xsb_aircraft.txt::OBJ8_AIRCRAFT
◆ vecMatchCrit
further match-relevant fields like airline and livery can be a list
◆ vertOfs
| float XPMP2::CSLModel::vertOfs = 3.0f |
Vertical offset to be applied [m].
◆ xsbAircraftLn
| int XPMP2::CSLModel::xsbAircraftLn = 0 |
Line number in the xsb_aircraft.txt file where the model definition starts.
◆ xsbAircraftPath
| std::string XPMP2::CSLModel::xsbAircraftPath |
Path to the xsb_aircraft.txt file from where this model is loaded.
The documentation for this class was generated from the following files: