Public Member Functions | Private Member Functions | Private Attributes | List of all members
SurgSim::DataStructures::DataGroupCopier Class Reference

A class that assists in copying from one DataGroup to another, when assignment is not possible. More...

#include <SurgSim/DataStructures/DataGroupCopier.h>

Public Member Functions

 DataGroupCopier (const DataGroup &source, DataGroup *target)
 Construct a copier. More...
 
void copy (const DataGroup &source, DataGroup *target)
 Copies the NamedData entries with the same names. More...
 

Private Member Functions

NamedDataCopyMap findMap (std::shared_ptr< const IndexDirectory > source, std::shared_ptr< const IndexDirectory > target) const
 Find the entries (by name) from the source to target IndexDirectories, and return the matching entries. More...
 

Private Attributes

DataGroupCopyMap m_map
 The map from source to target. More...
 

Detailed Description

A class that assists in copying from one DataGroup to another, when assignment is not possible.

See also
SurgSim::DataStructures::DataGroup

Constructor & Destructor Documentation

◆ DataGroupCopier()

SurgSim::DataStructures::DataGroupCopier::DataGroupCopier ( const DataGroup source,
DataGroup target 
)

Construct a copier.

Parameters
sourceThe source DataGroup.
targetThe target DataGroup.

Member Function Documentation

◆ copy()

void SurgSim::DataStructures::DataGroupCopier::copy ( const DataGroup source,
DataGroup target 
)

Copies the NamedData entries with the same names.

Resets entries in the target that are reset in the source. The source and target IndexDirectories are assumed to be the same as the source and target used in the constructor.

Parameters
sourceThe source DataGroup.
targetThe target DataGroup.

◆ findMap()

NamedDataCopyMap SurgSim::DataStructures::DataGroupCopier::findMap ( std::shared_ptr< const IndexDirectory source,
std::shared_ptr< const IndexDirectory target 
) const
private

Find the entries (by name) from the source to target IndexDirectories, and return the matching entries.

Parameters
sourceThe source IndexDirectory.
targetThe target IndexDirectory.
Returns
The map from source to target indices.

Member Data Documentation

◆ m_map

DataGroupCopyMap SurgSim::DataStructures::DataGroupCopier::m_map
private

The map from source to target.


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