Program Listing for File Frame.h

Program Listing for File Frame.h#

Return to documentation for file (include/Karana/Frame/Frame.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/KCore/LockingBase.h"
#include"Karana/KCore/RegistryList.h"
#include<string>

namespaceKarana::Frame{

namespacekc=Karana::Core;

classFrameContainer;
classEdgeFrameToFrame;
classChainedFrameToFrame;
classOrientedChainedFrameToFrame;

classFrame:publickc::LockingBase{
friendFrameContainer;
//Foraccessto_edgeand_children
friendEdgeFrameToFrame;

public:
statickc::ks_ptr<Frame>create(std::string_viewname,kc::ks_ptr<FrameContainer>fc);

voiddiscard(kc::ks_ptr<Frame>&frame);

virtual~Frame();

constkc::ks_ptr<Frame>&parent()const;

constkc::ks_ptr<EdgeFrameToFrame>&edge()const;

//std::iterator<kc::ks_ptr<Frame>>childIterator();

FrameContainer&container()const;

constkc::ks_ptr<FrameContainer>&containerPtr()const;

constkc::ks_ptr<ChainedFrameToFrame>&frameToFrame(constkc::ks_ptr<Frame>&frame)const;

constkc::ks_ptr<ChainedFrameToFrame>&frameToFrameRef(constFrame&frame)const;

constkc::ks_ptr<OrientedChainedFrameToFrame>&
orientedFrameToFrame(constkc::ks_ptr<Frame>&frame)const;

constkc::ks_ptr<OrientedChainedFrameToFrame>&
orientedFrameToFrameRef(constFrame&frame)const;

boolisAncestorOf(constFrame&other,boolstrict)const;

constkc::ks_ptr<Frame>&getAncestor(constFrame&other)const;

public:
Frame(std::string_viewname,kc::ks_ptr<FrameContainer>frame_container);

std::stringdumpString(std::string_viewprefix="",
constBase::DumpOptions*options=nullptr)constoverride;

structDumpFrameTreeOptions{
booltype_string=true;
booledge_type=false;
boollock_status=false;
boolref_count=false;
booledge_ref_count=false;
boolid=false;
};

voiddumpFrameTree(std::string_viewprefix="",
constDumpFrameTreeOptionsoptions=
DumpFrameTreeOptions(true,false,false,false,false,false))const;

protected:
void_discard(kc::ks_ptr<Base>&base)override;

private:
//FrameContainer*_frame_container;///<Pointertotheframecontainer.
kc::ks_ptr<FrameContainer>_frame_container;
kc::ks_ptr<EdgeFrameToFrame>_edge;
kc::RegistryList<Frame>_children;
};
}//namespaceKarana::Frame