Program Listing for File TimeKeeper.h#
↰ Return to documentation for file (include/Karana/SOADyn/TimeKeeper.h)
/*
*Copyright(c)2024-2025KaranaDynamicsPtyLtd.Allrightsreserved.
*
*NOTICETOUSER:
*
*Thissourcecodeand/ordocumentation(the"LicensedMaterials")is
*theconfidentialandproprietaryinformationofKaranaDynamicsInc.
*UseoftheseLicensedMaterialsisgovernedbythetermsandconditions
*ofaseparatesoftwarelicenseagreementbetweenKaranaDynamicsandthe
*Licensee("LicenseAgreement").Unlessexpresslypermittedunderthat
*agreement,anyreproduction,modification,distribution,ordisclosure
*oftheLicensedMaterials,inwholeorinpart,toanythirdparty
*withoutthepriorwrittenconsentofKaranaDynamicsisstrictlyprohibited.
*
*THELICENSEDMATERIALSAREPROVIDED"ASIS"WITHOUTWARRANTYOFANYKIND.
*KARANADYNAMICSDISCLAIMSALLWARRANTIES,EXPRESSORIMPLIED,INCLUDING
*BUTNOTLIMITEDTOWARRANTIESOFMERCHANTABILITY,NON-INFRINGEMENT,AND
*FITNESSFORAPARTICULARPURPOSE.
*
*INNOEVENTSHALLKARANADYNAMICSBELIABLEFORANYDAMAGESWHATSOEVER,
*INCLUDINGBUTNOTLIMITEDTOLOSSOFPROFITS,DATA,ORUSE,EVENIF
*ADVISEDOFTHEPOSSIBILITYOFSUCHDAMAGES,WHETHERINCONTRACT,TORT,
*OROTHERWISEARISINGOUTOFORINCONNECTIONWITHTHELICENSEDMATERIALS.
*
*U.S.GovernmentEndUsers:TheLicensedMaterialsarea"commercialitem"
*asdefinedat48C.F.R.2.101,andareprovidedtotheU.S.Government
*onlyasacommercialenditemunderthetermsofthislicense.
*
*AnyuseoftheLicensedMaterialsinindividualorcommercialsoftwaremust
*include,intheuserdocumentationandinternalsourcecodecomments,
*thisNotice,Disclaimer,andU.S.GovernmentUseProvision.
*/
#pragmaonce
#include"Karana/Frame/FrameContainer.h"
#include"Karana/Math/Defs.h"
namespaceKarana::Dynamics{
namespacekm=Karana::Math;
namespacekc=Karana::Core;
namespacekf=Karana::Frame;
//Forwarddeclaration
classSpiceTimeKeeper;
classTimeKeeper:publickc::Base{
public:
TimeKeeper(constkc::ks_ptr<kf::FrameContainer>&fc);
TimeKeeper(constTimeKeeper&other);
constkm::Ktime&getTime()const;
virtualvoidsetTime(constkm::Ktime&time);
boolisFinalized()constoverride;
//Eventhoughwedon'tuseephemerisinTimeKeeper,wehaveallthemethods
//tosetandchangeit.ThisisbecauseausermaytrytosettheEphemeris
//beforethereareanySpiceFrames.
voidsetInitialEphemeris(doubleinitial_ephemeris);
voidsetInitialEphemeris(conststd::string&utc_time);
staticdoubleutcTimeToEphemeris(conststd::string&utc_time);
protected:
km::Ktime_time;
kc::ks_ptr<kf::FrameContainer>_fc;
double_initial_ephemeris=km::uninitializedNaN;
};
classSpiceTimeKeeper:publicTimeKeeper{
public:
SpiceTimeKeeper(constkc::ks_ptr<kf::FrameContainer>&fc);
SpiceTimeKeeper(constTimeKeeper&other);
voidsetTime(constkm::Ktime&time)final;
boolisFinalized()constoverride;
};
}//namespaceKarana::Dynamics