Program Listing for File SyncRealTime.h#
↰ Return to documentation for file (include/Karana/GeneralKModels/SyncRealTime.h)
/*
*Copyright(c)2024-2026KaranaDynamicsPtyLtd.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/SOADyn/KModel.h"
#include<chrono>
namespaceKarana::Models{
namespacekm=Karana::Math;
namespacekd=Karana::Dynamics;
classSyncRealTime:publicKModel<SyncRealTime>{
//Foraccessto_enabledfortesting
friendvoidforceEnableSyncRealTime(constkc::ks_ptr<SyncRealTime>&);
public:
SyncRealTime(std::string_viewname,
constkc::ks_ptr<kd::ModelManager>&mm,
doublert_speed=1.0);
~SyncRealTime();
statickc::ks_ptr<SyncRealTime>
create(std::string_viewname,constkc::ks_ptr<kd::ModelManager>&mm,doublert_speed);
voidpreHop(constkm::Ktime&t,constkm::Vec&x);
voidpostHop(constkm::Ktime&t,constkm::Vec&x);
private:
double_rt_speed;
km::Ktime_pre_hop_st;
std::chrono::high_resolution_clock::time_point_pre_hop_rt;
bool_enabled;
};
}//namespaceKarana::Models