The Sparta Modeling Framework
Loading...
Searching...
No Matches
sparta::statistics::RootArchiveNode Class Reference

There is one of these root node objects at the top of each report's archive. The hierarchy looks like this: More...

#include <RootArchiveNode.hpp>

Inheritance diagram for sparta::statistics::RootArchiveNode:
Collaboration diagram for sparta::statistics::RootArchiveNode:

Public Member Functions

 RootArchiveNode (const std::string &name)
 
void initialize ()
 
void setMetadata (const app::NamedExtensions &metadata)
 Metadata.
 
template<typename MetadataT >
void setMetadataValue (const std::string &name, const MetadataT &value)
 
template<typename MetadataT >
const MetadataT & getMetadataValue (const std::string &name) const
 
template<typename MetadataT >
const MetadataT * tryGetMetadataValue (const std::string &name) const
 
size_t getTotalNumLeaves () const
 
void setArchiveController (const std::shared_ptr< ArchiveController > &controller)
 
void saveTo (const std::string &dir)
 
bool synchronize ()
 
- Public Member Functions inherited from sparta::statistics::ArchiveNode
 ArchiveNode ()=default
 
 ArchiveNode (const std::string &name)
 Construct a named node.
 
 ArchiveNode (const std::string &name, const StatisticInstance *)
 
 ArchiveNode (const std::string &name, const Report *)
 
const std::string & getName () const
 Return the name that this node was originally created with.
 
void setLeafIndex (const size_t index)
 
std::vector< std::shared_ptr< ArchiveNode > > & getChildren ()
 
const std::vector< std::shared_ptr< ArchiveNode > > & getChildren () const
 
void setParent (std::shared_ptr< ArchiveNode > &parent)
 
void setParent (ArchiveNode *parent)
 
RootArchiveNodegetRoot ()
 
bool isLeaf () const
 
bool canAccessDataSeries () const
 
ArchiveDataSeriescreateDataSeries ()
 
size_t getTotalNumLeaves () const
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Protected Attributes inherited from sparta::statistics::ArchiveNode
std::string name_
 
std::vector< std::shared_ptr< ArchiveNode > > children_
 

Detailed Description

There is one of these root node objects at the top of each report's archive. The hierarchy looks like this:

 archives        StatisticsArchives
   out_csv         RootArchiveNode
     top             ArchiveNode
       core0         ArchiveNode
   out_json        RootArchiveNode
     top             ArchiveNode
 ...             ...

This object holds onto shared metadata common to all of its child nodes, as well as a controller object used to interact with the data source on this archive's behalf (such as saving the entire archive to a new directory).

Definition at line 34 of file RootArchiveNode.hpp.

Constructor & Destructor Documentation

◆ RootArchiveNode()

sparta::statistics::RootArchiveNode::RootArchiveNode ( const std::string &  name)
inlineexplicit

Definition at line 39 of file RootArchiveNode.hpp.

Member Function Documentation

◆ getMetadataValue()

template<typename MetadataT >
const MetadataT & sparta::statistics::RootArchiveNode::getMetadataValue ( const std::string &  name) const
inline

Definition at line 61 of file RootArchiveNode.hpp.

◆ getTotalNumLeaves()

size_t sparta::statistics::RootArchiveNode::getTotalNumLeaves ( ) const
inline

Definition at line 88 of file RootArchiveNode.hpp.

◆ initialize()

void sparta::statistics::RootArchiveNode::initialize ( )
inline

Definition at line 43 of file RootArchiveNode.hpp.

◆ setArchiveController()

void sparta::statistics::RootArchiveNode::setArchiveController ( const std::shared_ptr< ArchiveController > &  controller)
inline

Saving and synchronizing archives are done through the given archive controller. How this controller performs these actions will depend on whether this archive is for a live simulation, or offline. But the archive node classes do not have to know about which mode we are in.

Definition at line 97 of file RootArchiveNode.hpp.

◆ setMetadata()

void sparta::statistics::RootArchiveNode::setMetadata ( const app::NamedExtensions &  metadata)
inline

Metadata.

Definition at line 50 of file RootArchiveNode.hpp.

◆ setMetadataValue()

template<typename MetadataT >
void sparta::statistics::RootArchiveNode::setMetadataValue ( const std::string &  name,
const MetadataT &  value 
)
inline

Definition at line 55 of file RootArchiveNode.hpp.

◆ tryGetMetadataValue()

template<typename MetadataT >
const MetadataT * sparta::statistics::RootArchiveNode::tryGetMetadataValue ( const std::string &  name) const
inline

Definition at line 76 of file RootArchiveNode.hpp.

Friends And Related Symbol Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Serialization routine for writing/reading this node to/from an archive's metadata file

Definition at line 118 of file RootArchiveNode.hpp.


The documentation for this class was generated from the following file: