#include <CopyHelpers.h>
template<typename T>
struct CP::detail::ShallowCopy< T, 1 >
Definition at line 67 of file SystematicsHandles/SystematicsHandles/CopyHelpers.h.
◆ StoreType
◆ getCopy()
Definition at line 75 of file SystematicsHandles/SystematicsHandles/CopyHelpers.h.
87 assert (inputObject !=
nullptr);
90 if( ! inputObject->getConstStore() ) {
93 if( inputObject->size() ) {
96 const T* originContainer =
97 dynamic_cast< const T*
>( ( *inputObject )[ 0 ]->container() );
100 for(
size_t i = 1;
i < inputObject->size(); ++
i ) {
101 if( ( *inputObject )[
i ]->container() != originContainer ) {
103 "container come from the same container!" );
104 return StatusCode::FAILURE;
108 static const char*
const ORIGIN_POSTFIX =
"_ShallowCopyOrigin";
111 if( ( ! originCopy.first ) || ( ! originCopy.second ) ) {
112 ANA_MSG_ERROR(
"Failed to shallow copy the origin of a view "
114 return StatusCode::FAILURE;
123 auto viewCopyPtr = viewCopy.get();
124 for(
const auto* element : *inputObject ) {
125 viewCopy->push_back( originCopy.first->at( element->index() ) );
131 for(
size_t i = 0;
i < inputObject->size(); ++
i ) {
133 *( ( *viewCopy )[
i ] ) ) ) {
134 return StatusCode::FAILURE;
140 object = viewCopyPtr;
141 return StatusCode::SUCCESS;
146 auto viewCopyPtr = viewCopy.get();
149 object = viewCopyPtr;
150 return StatusCode::SUCCESS;
161 return StatusCode::FAILURE;
165 return StatusCode::FAILURE;
171 return StatusCode::SUCCESS;
The documentation for this struct was generated from the following file:
std::pair< std::unique_ptr< T >, std::unique_ptr< ShallowAuxContainer > > shallowCopyContainer(const T &cont, [[maybe_unused]] const EventContext &ctx)
Function making a shallow copy of a constant container.